/* === Reset & Base === */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: #f5f7fa;
    color: #1a1a2e;
    line-height: 1.5;
}

/* === Setup Page === */
.setup-container {
    max-width: 620px;
    margin: 60px auto;
    padding: 40px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
}

.setup-container h1 {
    font-size: 28px;
    margin-bottom: 4px;
}

.subtitle {
    color: #666;
    margin-bottom: 32px;
}

.step {
    margin-bottom: 28px;
}

.step h2 {
    font-size: 18px;
    margin-bottom: 16px;
    color: #333;
}

.hint {
    font-size: 14px;
    color: #666;
    margin-bottom: 16px;
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-weight: 500;
    margin-bottom: 6px;
    font-size: 14px;
    color: #444;
}

input[type="text"],
input[type="number"],
select {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 15px;
    transition: border-color 0.2s;
}

input[type="text"]:focus,
input[type="number"]:focus,
select:focus {
    outline: none;
    border-color: #4f6df5;
}

.error {
    color: #e74c3c;
    margin-top: 12px;
    padding: 10px 14px;
    background: #fdf0ef;
    border-radius: 8px;
    font-size: 14px;
}

.success {
    color: #27ae60;
    margin-top: 12px;
    padding: 10px 14px;
    background: #eafaf1;
    border-radius: 8px;
    font-size: 14px;
}

.hidden {
    display: none !important;
}

/* === Column Config (Setup) === */
.column-config-row {
    background: #f8f9fb;
    border: 1px solid #e8eaed;
    border-radius: 10px;
    padding: 14px;
    margin-bottom: 12px;
}

.config-fields {
    display: flex;
    gap: 12px;
    align-items: flex-end;
}

.config-fields .form-group {
    flex: 1;
    margin-bottom: 0;
}

.config-fields select {
    font-size: 14px;
    padding: 8px 10px;
}

.btn-remove {
    background: #fdf0ef;
    color: #e74c3c;
    border: none;
    border-radius: 6px;
    width: 36px;
    height: 36px;
    font-size: 16px;
    cursor: pointer;
    flex-shrink: 0;
}

.btn-remove:hover {
    background: #e74c3c;
    color: white;
}

.config-preview {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #e8eaed;
    font-size: 13px;
}

.preview-label {
    color: #888;
}

.preview-btn {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
}

.preview-yes {
    background: #eafaf1;
    color: #27ae60;
}

.preview-no {
    background: #fdf0ef;
    color: #e74c3c;
}

.preview-tag {
    display: inline-block;
    padding: 2px 8px;
    background: #e8eaed;
    border-radius: 4px;
    font-size: 12px;
    margin: 2px;
}

.preview-more {
    color: #999;
    font-size: 12px;
}

.preview-input {
    display: inline-block;
    padding: 2px 8px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 12px;
    color: #999;
}

.preview-example {
    color: #999;
    font-size: 12px;
}

.add-column-btn {
    background: white;
    border: 2px dashed #ccc;
    color: #666;
    width: 100%;
    padding: 10px;
    font-size: 14px;
    border-radius: 10px;
    cursor: pointer;
    margin-bottom: 20px;
}

.add-column-btn:hover {
    border-color: #4f6df5;
    color: #4f6df5;
    background: #f5f7ff;
    box-shadow: none;
    transform: none;
}

/* === Buttons === */
button, .btn {
    display: inline-block;
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    text-decoration: none;
    text-align: center;
}

button:hover, .btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

#connect-btn,
#start-btn {
    background: #4f6df5;
    color: white;
    width: 100%;
    padding: 12px;
    font-size: 16px;
}

#connect-btn:hover,
#start-btn:hover {
    background: #3d5bd9;
}

/* === Review Page === */
.review-body {
    background: #1a1a2e;
    height: 100vh;
    overflow: hidden;
}

/* Top Bar */
.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 20px;
    background: #16213e;
    color: white;
    height: 50px;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.back-link {
    color: #8899cc;
    text-decoration: none;
    font-size: 14px;
}

.back-link:hover {
    color: white;
}

.topbar-title {
    font-weight: 600;
    font-size: 15px;
}

.topbar-center {
    display: flex;
    align-items: center;
    gap: 12px;
}

.progress-container {
    width: 200px;
    height: 8px;
    background: #2a2a4a;
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #4f6df5, #27ae60);
    border-radius: 4px;
    transition: width 0.4s ease;
    width: 0%;
}

.progress-text {
    font-size: 13px;
    color: #8899cc;
    white-space: nowrap;
}

.topbar-right {
    font-size: 13px;
    color: #8899cc;
}

.btn-filter {
    background: #2a2a4a;
    color: #8899cc;
    font-size: 12px;
    padding: 5px 12px;
}

.btn-filter:hover {
    background: #3a3a5a;
    color: white;
}

/* Layout */
.review-layout {
    display: flex;
    height: calc(100vh - 50px);
}

/* Lead Panel (Left) */
.lead-panel {
    width: 380px;
    min-width: 380px;
    background: white;
    overflow-y: auto;
    padding: 24px;
}

.loading {
    text-align: center;
    padding: 40px;
    color: #666;
}

.lead-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.lead-number {
    font-weight: 600;
    font-size: 16px;
    color: #333;
}

.lead-status {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.status-yes {
    background: #eafaf1;
    color: #27ae60;
}

.status-no {
    background: #fdf0ef;
    color: #e74c3c;
}

.status-open {
    background: #fef9e7;
    color: #f39c12;
}

/* Lead Details */
.lead-details {
    margin-bottom: 16px;
}

.detail-row {
    padding: 6px 0;
    border-bottom: 1px solid #f0f0f0;
    font-size: 13px;
}

.detail-key {
    font-weight: 600;
    color: #555;
}

.detail-value {
    color: #333;
}

.lead-url-display {
    margin-bottom: 20px;
    padding: 10px 12px;
    background: #f5f7fa;
    border-radius: 8px;
    font-size: 14px;
    word-break: break-all;
}

.lead-url-display a {
    color: #4f6df5;
    text-decoration: none;
}

.lead-url-display a:hover {
    text-decoration: underline;
}

/* Edit Section */
.edit-section {
    margin-bottom: 20px;
    padding: 16px;
    background: #f0f4ff;
    border-radius: 10px;
    border: 1px solid #d8e2ff;
}

.edit-section h3 {
    font-size: 14px;
    color: #4f6df5;
    margin-bottom: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.edit-field {
    margin-bottom: 14px;
}

.edit-field:last-child {
    margin-bottom: 0;
}

.edit-label {
    display: block;
    font-weight: 600;
    font-size: 13px;
    color: #333;
    margin-bottom: 4px;
}

.current-value {
    font-size: 12px;
    color: #888;
    margin-bottom: 6px;
}

.current-value em {
    color: #bbb;
}

/* Yes/No Buttons */
.yesno-buttons {
    display: flex;
    gap: 8px;
}

.btn-yes-sm, .btn-no-sm {
    flex: 1;
    padding: 8px;
    font-size: 14px;
    border-radius: 6px;
    border: 2px solid transparent;
}

.btn-yes-sm {
    background: #eafaf1;
    color: #27ae60;
    border-color: #d4f0e0;
}

.btn-yes-sm:hover, .btn-yes-sm.active {
    background: #27ae60;
    color: white;
    border-color: #27ae60;
}

.btn-no-sm {
    background: #fdf0ef;
    color: #e74c3c;
    border-color: #f5d5d2;
}

.btn-no-sm:hover, .btn-no-sm.active {
    background: #e74c3c;
    color: white;
    border-color: #e74c3c;
}

/* Dropdown Tags */
.dropdown-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.btn-tag {
    padding: 5px 12px;
    font-size: 13px;
    background: white;
    color: #555;
    border: 2px solid #e0e0e0;
    border-radius: 20px;
}

.btn-tag:hover {
    border-color: #4f6df5;
    color: #4f6df5;
    transform: none;
    box-shadow: none;
}

.btn-tag.active {
    background: #4f6df5;
    color: white;
    border-color: #4f6df5;
}

/* Text Input */
.edit-input {
    width: 100%;
    padding: 8px 12px;
    border: 2px solid #d8e2ff;
    border-radius: 6px;
    font-size: 14px;
    background: white;
}

.edit-input:focus {
    outline: none;
    border-color: #4f6df5;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 10px;
    margin-bottom: 12px;
}

.btn-save {
    flex: 1;
    background: #4f6df5;
    color: white;
    font-size: 15px;
    padding: 12px;
}

.btn-save:hover {
    background: #3d5bd9;
}

.btn-skip {
    background: #95a5a6;
    color: white;
    padding: 12px 16px;
    font-size: 14px;
}

.btn-skip:hover {
    background: #7f8c8d;
}

.nav-buttons {
    display: flex;
    gap: 10px;
    margin-bottom: 12px;
}

.btn-nav {
    flex: 1;
    background: #ecf0f1;
    color: #333;
    font-size: 14px;
}

.btn-nav:hover {
    background: #dfe6e9;
}

.keyboard-hints {
    text-align: center;
    color: #999;
    padding-top: 8px;
    border-top: 1px solid #f0f0f0;
}

kbd {
    display: inline-block;
    padding: 2px 6px;
    background: #f0f0f0;
    border: 1px solid #ddd;
    border-radius: 3px;
    font-family: monospace;
    font-size: 12px;
}

/* Save Feedback */
.save-feedback {
    margin-top: 10px;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 13px;
    text-align: center;
    transition: opacity 0.3s;
}

.save-feedback.success {
    background: #eafaf1;
    color: #27ae60;
}

.save-feedback.error {
    background: #fdf0ef;
    color: #e74c3c;
}

.save-feedback.warning {
    background: #fef9e7;
    color: #f39c12;
}

/* Done Message */
.done-message {
    text-align: center;
    padding: 40px 20px;
}

.done-message h2 {
    color: #27ae60;
    margin-bottom: 12px;
}

.done-message p {
    color: #666;
    margin-bottom: 20px;
}

/* Website Panel (Right) */
.website-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #0f0f23;
}

.iframe-toolbar {
    display: flex;
    gap: 8px;
    padding: 8px 12px;
    background: #16213e;
}

.btn-open-tab {
    background: #4f6df5;
    color: white;
    font-size: 13px;
    padding: 6px 14px;
}

.btn-reload {
    background: #2a2a4a;
    color: #8899cc;
    font-size: 13px;
    padding: 6px 14px;
}

.btn-reload:hover {
    background: #3a3a5a;
    color: white;
}

.iframe-container {
    flex: 1;
    position: relative;
}

.iframe-container iframe {
    width: 100%;
    height: 100%;
    border: none;
    background: white;
}

.iframe-error {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: #8899cc;
    padding: 40px;
}

.iframe-error p {
    margin-bottom: 12px;
}
