/* IntelliScrape Pro - Professional Enterprise Styles */

:root {
    /* Light Mode Colors */
    --primary: #2563eb;
    --primary-dark: #1e40af;
    --secondary: #64748b;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --background: #ffffff;
    --surface: #f8fafc;
    --card-bg: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --border: #e2e8f0;
    --shadow: rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] {
    /* Dark Mode Colors */
    --primary: #3b82f6;
    --primary-dark: #2563eb;
    --secondary: #94a3b8;
    --success: #22c55e;
    --danger: #f87171;
    --warning: #fbbf24;
    --background: #0f172a;
    --surface: #1e293b;
    --card-bg: #1e293b;
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --border: #334155;
    --shadow: rgba(0, 0, 0, 0.3);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: var(--background);
    color: var(--text-primary);
    line-height: 1.6;
    transition: background 0.3s, color 0.3s;
}

/* Professional Header */
.main-header {
    background: var(--card-bg);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 1px 3px var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 64px;
}

.logo-section h1 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    display: inline-block;
}

.logo-section .pro {
    color: var(--primary);
    font-weight: 300;
    margin-left: 2px;
    transition: all 0.3s ease;
}

.logo-section h1 {
    transition: all 0.3s ease;
}

.logo-section:hover h1 {
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.3);
}

.logo-section:hover .pro {
    text-shadow: 0 0 8px rgba(59, 130, 246, 0.4);
}

.tagline {
    margin-left: 15px;
    color: var(--text-secondary);
    font-size: 14px;
}

.header-nav {
    display: flex;
    gap: 10px;
}

.nav-btn {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--border);
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.nav-btn:hover {
    background: var(--surface);
    border-color: var(--primary);
}

/* Container */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 30px 20px;
}

/* Status Bar */
.status-bar {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 15px 20px;
    margin-bottom: 30px;
    display: flex;
    gap: 40px;
}

.status-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.status-label {
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
}

.status-value {
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 600;
}

.status-online {
    color: var(--success);
}

.status-offline {
    color: var(--danger);
}

.status-warning {
    color: #f59e0b;
}

/* Cards */
.card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    margin-bottom: 24px;
    overflow: hidden;
    box-shadow: 0 1px 3px var(--shadow);
}

.card-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    background: var(--surface);
}

.card-header h2 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.card-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
}

.card-body {
    padding: 24px;
}

/* Form Elements */
textarea, input[type="text"], input[type="number"], input[type="password"], select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--background);
    color: var(--text-primary);
    font-size: 14px;
    transition: border-color 0.2s;
    font-family: inherit;
}

textarea:focus, input:focus, select:focus {
    outline: none;
    border-color: var(--primary);
}

/* Buttons */
.primary-btn, .secondary-btn, .action-btn, .export-btn, .save-btn {
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    margin-top: 12px;
}

.primary-btn {
    background: var(--primary);
    color: white;
}

.primary-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

/* Button Loading States */
.primary-btn {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.spin {
    animation: spin 1s linear infinite;
}

.primary-btn.loading .btn-text {
    opacity: 0.7;
}

.primary-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.secondary-btn {
    background: transparent;
    color: var(--primary);
    border: 1px solid var(--primary);
}

.secondary-btn:hover {
    background: var(--primary);
    color: white;
}

.action-btn, .export-btn {
    background: var(--surface);
    color: var(--text-primary);
    border: 1px solid var(--border);
    padding: 8px 16px;
    font-size: 13px;
    margin: 0 4px;
}

.action-btn:hover, .export-btn:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* Enhanced Progress Bar */
.progress-section {
    margin: 20px 0;
    padding: 16px;
    background: var(--surface);
    border-radius: 8px;
    border: 1px solid var(--border);
}

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

.progress-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.progress-timing {
    display: flex;
    flex-direction: column;
    gap: 4px;
    text-align: right;
}

.progress-bar {
    width: 100%;
    height: 12px;
    background: var(--surface);
    border-radius: 6px;
    overflow: visible; /* Changed from hidden to show percentage */
    margin-bottom: 12px;
    position: relative;
    border: 1px solid var(--border);
    margin-top: 28px; /* Increased to make room for percentage */
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--primary-dark));
    border-radius: 6px;
    transition: width 0.5s ease;
    position: relative;
    overflow: hidden;
}

/* Old progress-percentage style - removed duplicate (see line 3264 for active style) */

.progress-text {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.progress-stats {
    font-size: 12px;
    color: var(--text-secondary);
}

.time-estimate, .time-elapsed {
    font-size: 12px;
    color: var(--text-secondary);
}

.time-estimate {
    color: var(--primary);
    font-weight: 600;
}

.progress-speed {
    text-align: center;
}

.speed-indicator {
    font-size: 12px;
    color: var(--text-secondary);
    font-style: italic;
}

/* Finalize Disclaimers */
.finalize-disclaimers {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 16px;
    margin: 16px 0;
}

.disclaimer-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    color: var(--warning);
}

.warning-icon {
    font-size: 16px;
}

.disclaimer-list {
    list-style: none;
    padding: 0;
    margin: 0 0 12px 0;
}

.disclaimer-list li {
    padding: 6px 0;
    font-size: 14px;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border);
}

.disclaimer-list li:last-child {
    border-bottom: none;
}

.disclaimer-list li strong {
    color: var(--text-primary);
}

.data-summary {
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: 6px;
    padding: 12px;
    text-align: center;
}

.summary-text {
    font-size: 14px;
    color: var(--text-primary);
}

.summary-text strong {
    color: var(--primary);
    font-weight: 600;
}

/* Finalize Confirmation Modal */
.finalize-confirmation {
    padding: 24px;
}

.confirmation-summary {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 20px;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
}

.summary-item:last-child {
    border-bottom: none;
}

.summary-label {
    font-weight: 500;
    color: var(--text-primary);
}

.summary-value {
    font-weight: 600;
    color: var(--primary);
}

.session-name-input {
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--background);
    color: var(--text-primary);
    font-size: 14px;
    width: 200px;
}

.session-name-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
}

.confirmation-warnings {
    background: rgba(239, 68, 68, 0.05);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 20px;
}

.warning-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 4px 0;
    font-size: 14px;
    color: var(--text-secondary);
}

.warning-bullet {
    color: var(--danger);
    font-weight: bold;
    margin-top: 2px;
}

.confirmation-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.cancel-btn {
    padding: 10px 20px;
    background: var(--surface);
    color: var(--text-primary);
    border: 1px solid var(--border);
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.cancel-btn:hover {
    background: var(--border);
}

.confirm-btn {
    padding: 10px 20px;
    background: var(--danger);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s;
}

.confirm-btn:hover {
    background: #dc2626;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

/* Inline Verification */
.extraction-controls {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.status-checking {
    color: var(--warning);
}

.status-success {
    color: var(--success);
}

.status-error {
    color: var(--danger);
}

@keyframes blink {
    0%, 50% { border-color: var(--primary); }
    51%, 100% { border-color: transparent; }
}

@keyframes typewriter {
    from { width: 0; }
    to { width: 100%; }
}

/* Configuration Grid */
.config-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin: 20px 0;
}

.config-item label {
    display: block;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 6px;
}

/* Results Section */
.results {
    margin-top: 24px;
    padding: 20px;
    background: var(--surface);
    border-radius: 8px;
}

.results h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 16px;
}

/* Action Bar */
.action-bar {
    padding: 12px 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 6px;
    margin-bottom: 20px;
}

.action-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.action-label, .export-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-right: 8px;
}

/* Export Bar */
.export-bar {
    padding: 12px 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 6px;
    margin-top: 20px;
    display: flex;
    align-items: center;
}

/* Table */
.product-table {
    overflow-x: auto;
    margin: 20px 0;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: var(--card-bg);
}

th {
    background: var(--surface);
    color: var(--text-secondary);
    font-weight: 500;
    text-align: left;
    padding: 12px;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border);
}

td {
    padding: 12px;
    border-bottom: 1px solid var(--border);
    color: var(--text-primary);
    font-size: 14px;
}

.editable-table td {
    cursor: pointer;
}

.editable-table td:hover {
    background: var(--surface);
}

/* Summary */
.summary {
    background: var(--surface);
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 1px solid var(--border);
}

.summary h4 {
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 12px;
}

.summary p {
    margin: 6px 0;
    color: var(--text-secondary);
    font-size: 14px;
}

/* Smooth Transitions */
.fade-in {
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.slide-in {
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

/* Configuration Tabs */
.config-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 2px solid var(--border);
    padding-bottom: 10px;
}

.config-tab {
    background: transparent;
    border: none;
    padding: 10px 20px;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 6px 6px 0 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.config-tab:hover {
    background: var(--surface);
    color: var(--text-primary);
}

.config-tab.active {
    background: var(--primary);
    color: white;
}

.tab-icon {
    font-size: 16px;
}

.config-content {
    display: none;
    animation: fadeIn 0.3s ease-in;
}

.config-content.active {
    display: block;
}

/* Session Management */
.session-indicator {
    position: absolute;
    right: 24px;
    top: 20px;
}

.session-badge {
    background: var(--success);
    color: white;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.session-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: var(--surface);
    border-radius: 8px;
    margin-bottom: 20px;
}

.session-btn {
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid var(--border);
    background: var(--card-bg);
    color: var(--text-primary);
}

.session-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px var(--shadow);
}

.session-btn.success {
    background: var(--success);
    color: white;
    border-color: var(--success);
}

.session-info {
    margin-left: auto;
    font-size: 14px;
    color: var(--text-secondary);
}

/* Sessions Modal */
.sessions-tabs {
    display: flex;
    gap: 10px;
    margin: 20px 0;
    border-bottom: 2px solid var(--border);
}

.tab-btn {
    background: transparent;
    border: none;
    padding: 10px 20px;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
}

.tab-btn.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.tab-content {
    display: none;
    padding: 20px 0;
    overflow-y: auto;
    max-height: calc(70vh - 100px);
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease-in;
}

/* Extraction Options */
.extraction-options {
    display: flex;
    gap: 20px;
    margin: 15px 0;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--text-secondary);
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    /* backdrop-filter removed - causes severe performance issues */
}

.fade-modal {
    transition: opacity 0.3s ease;
}

.fade-modal.show {
    display: block;
    animation: fadeInModal 0.3s ease;
}

@keyframes fadeInModal {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background: var(--card-bg);
    margin: auto;
    padding: 30px;
    border: 1px solid var(--border);
    border-radius: 12px;
    width: 600px;
    max-width: 90%;
    max-height: 85vh;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: auto;
}

/* Finalize Modal Specific Styles */
.modal-subtitle {
    color: var(--text-secondary);
    margin-bottom: 20px;
    font-size: 14px;
}

.finalize-summary {
    margin-bottom: 20px;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}

.summary-row:last-child {
    border-bottom: none;
}

.summary-label {
    font-weight: 500;
    color: var(--text-primary);
}

.summary-value {
    font-weight: 600;
    color: var(--primary);
}

.finalize-input {
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--surface);
    color: var(--text-primary);
    font-size: 14px;
    width: 200px;
}

.finalize-warnings {
    background: rgba(255, 193, 7, 0.1);
    border: 1px solid rgba(255, 193, 7, 0.3);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 20px;
}

.warning-header {
    font-weight: 600;
    color: #f59e0b;
    margin-bottom: 8px;
}

.warning-list {
    margin: 0;
    padding-left: 20px;
    color: var(--text-secondary);
    font-size: 14px;
}

.warning-list li {
    margin-bottom: 4px;
}

.finalize-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 24px;
}

.close {
    color: var(--text-secondary);
    float: right;
    font-size: 28px;
    font-weight: 300;
    cursor: pointer;
}

.close:hover {
    color: var(--text-primary);
}

.settings-section {
    margin: 24px 0;
    padding: 20px;
    background: var(--surface);
    border-radius: 8px;
    border: 1px solid var(--border);
}

.settings-section h3 {
    color: var(--text-primary);
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.settings-section h3::before {
    content: '';
    width: 4px;
    height: 18px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 2px;
}

.setting-item {
    margin-bottom: 20px;
}

.setting-item label {
    display: block;
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 8px;
}

.setting-item input[type="password"],
.setting-item input[type="number"],
.setting-item input[type="text"] {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--card-bg);
    color: var(--text-primary);
    transition: all 0.3s ease;
    font-size: 14px;
}

.setting-item input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.setting-item input[type="password"] {
    font-family: 'Courier New', monospace;
    letter-spacing: 1px;
}

/* Help Text */
.help-text {
    display: block;
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 4px;
    font-style: italic;
}

/* Save Button Specific Styling */
.save-btn {
    width: 100%;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    box-shadow: 0 4px 6px rgba(37, 99, 235, 0.2);
}

.save-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(37, 99, 235, 0.3);
}

.save-btn:active {
    transform: translateY(0);
}

/* Notification System */
#notificationContainer {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.notification {
    min-width: 300px;
    max-width: 400px;
    padding: 16px 20px;
    border-radius: 8px;
    color: white;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    animation: slideInRight 0.3s ease-out;
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
}

.notification.success {
    background: linear-gradient(135deg, #10b981, #059669);
    border-left: 4px solid #065f46;
}

.notification.error {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    border-left: 4px solid #991b1b;
}

.notification.info {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    border-left: 4px solid #1e40af;
}

.notification.warning {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    border-left: 4px solid #92400e;
}

.notification-icon {
    font-size: 18px;
    flex-shrink: 0;
}

.notification-content {
    flex: 1;
}

.notification-title {
    font-weight: 600;
    margin-bottom: 2px;
}

.notification-message {
    font-size: 13px;
    opacity: 0.9;
}

.notification-close {
    background: none;
    border: none;
    color: white;
    font-size: 18px;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s;
    padding: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.notification-close:hover {
    opacity: 1;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* Verification Modal */
.verification-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    /* backdrop-filter removed - causes severe performance issues */
    z-index: 10000;
    animation: fadeIn 0.3s ease-out;
}

.verification-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 450px;
    max-width: 90vw;
    background: var(--card-bg);
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    animation: modalSlideIn 0.4s ease-out;
}

.verification-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 32px;
    height: 32px;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    z-index: 10;
}

.verification-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.verification-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 24px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.verification-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg,
        rgba(102, 126, 234, 0.8) 0%,
        rgba(118, 75, 162, 0.8) 25%,
        rgba(244, 143, 177, 0.8) 50%,
        rgba(59, 130, 246, 0.8) 75%,
        rgba(147, 51, 234, 0.8) 100%);
    animation: aiGradientShift 6s ease-in-out infinite;
}

.firecrawl-logo {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
}

.logo-icon {
    position: relative;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.fire-icon {
    font-size: 32px;
    position: relative;
    z-index: 2;
    animation: fireFlicker 2s ease-in-out infinite;
}

.ai-symbol {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    overflow: hidden;
}

.ai-gradient {
    width: 100%;
    height: 100%;
    background: conic-gradient(
        from 0deg,
        #3b82f6,
        #8b5cf6,
        #ec4899,
        #f59e0b,
        #10b981,
        #3b82f6
    );
    animation: aiRotate 4s linear infinite;
    opacity: 0.7;
}

.logo-text h3 {
    margin: 0;
    color: white;
    font-size: 24px;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.logo-text span {
    color: rgba(255, 255, 255, 0.9);
    font-size: 14px;
    font-weight: 400;
}

.verification-body {
    padding: 24px;
}

.verification-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
    transition: all 0.3s ease;
}

.verification-item:last-child {
    border-bottom: none;
}

.verify-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s;
}

.verify-icon.loading {
    background: linear-gradient(45deg, #f3f4f6, #e5e7eb);
    color: var(--text-secondary);
    animation: pulse 2s ease-in-out infinite;
}

.verify-icon.success {
    background: linear-gradient(45deg, #10b981, #059669);
    color: white;
    animation: checkmark 0.5s ease-out;
}

.verify-icon.error {
    background: linear-gradient(45deg, #ef4444, #dc2626);
    color: white;
    animation: shake 0.5s ease-out;
}

.verify-text {
    flex: 1;
    color: var(--text-primary);
    font-weight: 500;
}

.verify-status {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.verification-footer {
    padding: 24px;
    background: var(--surface);
    border-top: 1px solid var(--border);
}

.verification-progress {
    margin-bottom: 16px;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--border);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 8px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #3b82f6, #8b5cf6, #ec4899);
    border-radius: 4px;
    transition: width 0.5s ease;
    width: 0%;
}

.progress-text {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 500;
}

.verification-continue {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    opacity: 0.5;
}

.verification-continue:enabled {
    opacity: 1;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.verification-continue:enabled:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(59, 130, 246, 0.4);
}

/* Professional Verification Modal */
.verification-header {
    padding: 24px 24px 16px 24px;
    border-bottom: 1px solid var(--border);
    text-align: center;
}

.verification-header h3 {
    margin: 0 0 8px 0;
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.verification-subtitle {
    margin: 0;
    font-size: 14px;
    color: var(--text-secondary);
}

.verification-checklist {
    padding: 24px;
}

.check-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 0;
}

.check-icon {
    font-size: 12px;
    width: 16px;
    height: 16px;
    text-align: center;
    line-height: 16px;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.status-pending {
    color: var(--text-secondary);
    background: var(--surface);
}

.status-success {
    color: var(--success);
    background: rgba(16, 185, 129, 0.1);
}

.status-error {
    color: var(--danger);
    background: rgba(239, 68, 68, 0.1);
}

.check-text {
    font-size: 14px;
    color: var(--text-primary);
    font-weight: 500;
}

/* Skeleton Loaders */
.skeleton-container {
    margin: 20px 0;
    animation: fadeIn 0.3s ease-out;
}

.skeleton-header {
    margin-bottom: 20px;
}

.skeleton-items {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.skeleton-item {
    display: flex;
    gap: 16px;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 8px;
}

.skeleton-image {
    width: 80px;
    height: 80px;
    background: linear-gradient(90deg, var(--surface) 25%, rgba(255,255,255,0.2) 50%, var(--surface) 75%);
    background-size: 200% 100%;
    animation: skeletonShimmer 1.5s infinite;
    border-radius: 4px;
    flex-shrink: 0;
}

.skeleton-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.skeleton-line {
    height: 16px;
    background: linear-gradient(90deg, var(--surface) 25%, rgba(255,255,255,0.2) 50%, var(--surface) 75%);
    background-size: 200% 100%;
    animation: skeletonShimmer 1.5s infinite;
    border-radius: 4px;
}

.skeleton-title {
    width: 60%;
    height: 20px;
}

.skeleton-subtitle {
    width: 40%;
    height: 14px;
}

.skeleton-name {
    width: 80%;
}

.skeleton-price {
    width: 30%;
}

.skeleton-description {
    width: 100%;
    height: 12px;
}

@keyframes skeletonShimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

/* API Key Validation */
.api-validation {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
}

.api-status-icon {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
}

.api-status-icon.checking {
    background: #f3f4f6;
    color: var(--text-secondary);
    animation: pulse 1s ease-in-out infinite;
}

.api-status-icon.valid {
    background: #10b981;
    color: white;
}

.api-status-icon.invalid {
    background: #ef4444;
    color: white;
}

.api-status-text {
    font-size: 12px;
    font-weight: 500;
}

.api-status-text.checking { color: var(--text-secondary); }
.api-status-text.valid { color: #10b981; }
.api-status-text.invalid { color: #ef4444; }

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes modalSlideIn {
    from {
        transform: translate(-50%, -50%) scale(0.9);
        opacity: 0;
    }
    to {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
}

@keyframes aiGradientShift {
    0%, 100% {
        background: linear-gradient(135deg,
            rgba(102, 126, 234, 0.8) 0%,
            rgba(118, 75, 162, 0.8) 100%);
    }
    25% {
        background: linear-gradient(135deg,
            rgba(244, 143, 177, 0.8) 0%,
            rgba(59, 130, 246, 0.8) 100%);
    }
    50% {
        background: linear-gradient(135deg,
            rgba(147, 51, 234, 0.8) 0%,
            rgba(244, 143, 177, 0.8) 100%);
    }
    75% {
        background: linear-gradient(135deg,
            rgba(59, 130, 246, 0.8) 0%,
            rgba(102, 126, 234, 0.8) 100%);
    }
}

@keyframes aiRotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes checkmark {
    0% { transform: scale(0); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-4px); }
    75% { transform: translateX(4px); }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* Enhanced Export Section */
.export-section {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-top: 20px;
    padding: 20px;
    background: var(--surface);
    border-radius: 8px;
    border: 1px solid var(--border);
}

.export-naming {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.export-naming label {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 14px;
}

.csv-name-input {
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--card-bg);
    color: var(--text-primary);
    font-size: 14px;
    transition: all 0.3s ease;
    max-width: 300px;
}

.csv-name-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.export-buttons {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.export-label {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 14px;
}

.export-btn {
    padding: 8px 16px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 60px;
}

.export-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

/* Finalize Session Section */
.finalize-section {
    margin-top: 30px;
    padding: 24px;
    background: linear-gradient(135deg,
        rgba(16, 185, 129, 0.05) 0%,
        rgba(59, 130, 246, 0.05) 100%);
    border-radius: 12px;
    border: 2px dashed var(--border);
    transition: all 0.3s ease;
}

.finalize-section:hover {
    border-color: var(--primary);
    background: linear-gradient(135deg,
        rgba(16, 185, 129, 0.08) 0%,
        rgba(59, 130, 246, 0.08) 100%);
}

.finalize-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.finalize-info h4 {
    margin: 0 0 8px 0;
    color: var(--text-primary);
    font-size: 18px;
    font-weight: 700;
}

.finalize-info p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 14px;
    max-width: 400px;
    line-height: 1.5;
}

.finalize-btn {
    padding: 12px 24px;
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 160px;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
}

.finalize-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(16, 185, 129, 0.3);
    background: linear-gradient(135deg, #059669, #047857);
}

.finalize-icon {
    font-size: 18px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .finalize-content {
        flex-direction: column;
        text-align: center;
    }

    .export-buttons {
        justify-content: center;
    }

    .csv-name-input {
        max-width: 100%;
    }
}

/* Pagination Suggestion */
.pagination-suggestion {
    position: relative;
    margin-top: 10px;
    animation: fadeIn 0.3s ease;
}

.suggestion-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: var(--surface);
    border: 2px solid var(--primary);
    border-radius: 6px;
    box-shadow: 0 2px 8px var(--shadow);
}

.suggestion-text {
    color: var(--primary);
    font-weight: 600;
    font-size: 14px;
}

.suggestion-hint {
    background: var(--primary);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    animation: pulse 1.5s ease infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* Brand Summary */
.brand-summary {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px;
}

.brand-group {
    padding: 8px;
    background: var(--background);
    border-radius: 4px;
    font-size: 14px;
}

/* Dashboard */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    transition: transform 0.2s;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--shadow);
}

.stat-icon {
    font-size: 32px;
    opacity: 0.8;
}

.stat-content h3 {
    font-size: 28px;
    font-weight: 700;
    color: var(--primary);
    margin: 0;
}

.stat-content p {
    font-size: 13px;
    color: var(--text-secondary);
    margin: 0;
}

.summary-table {
    margin-top: 20px;
    padding: 20px;
    background: var(--surface);
    border-radius: 8px;
}

.summary-table h4 {
    color: var(--text-primary);
    margin-bottom: 15px;
}

/* Fire Animation */
.fire-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 10px;
}

.fire-text {
    color: var(--text-secondary);
    font-size: 14px;
}

.fire-animation {
    display: inline-flex;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 2px;
}

.fire-letter {
    display: inline-block;
    color: #ff6b00;
    animation: fireFlicker 2s ease-in-out infinite;
}

.fire-letter:nth-child(1) { animation-delay: 0s; }
.fire-letter:nth-child(2) { animation-delay: 0.1s; }
.fire-letter:nth-child(3) { animation-delay: 0.2s; }
.fire-letter:nth-child(4) { animation-delay: 0.3s; }
.fire-letter:nth-child(5) { animation-delay: 0.4s; }
.fire-letter:nth-child(6) { animation-delay: 0.5s; }
.fire-letter:nth-child(7) { animation-delay: 0.6s; }
.fire-letter:nth-child(8) { animation-delay: 0.7s; }
.fire-letter:nth-child(9) { animation-delay: 0.8s; }

@keyframes fireFlicker {
    0%, 100% {
        transform: translateY(0) scale(1);
        filter: brightness(1);
        background-position: 0% 50%;
    }
    25% {
        transform: translateY(-2px) scale(1.05);
        filter: brightness(1.2);
        background-position: 50% 50%;
    }
    50% {
        transform: translateY(-1px) scale(1.02);
        filter: brightness(1.1);
        background-position: 100% 50%;
    }
    75% {
        transform: translateY(-3px) scale(1.08);
        filter: brightness(1.3);
        background-position: 50% 50%;
    }
}

/* Enhanced ASCII Fire Effect */
.fire-base {
    display: block;
    position: relative;
    z-index: 3;
}

.fire-flame {
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%);
    color: #ff4500;
    font-size: 8px;
    opacity: 0.8;
    z-index: 2;
    animation: flameRise 1.5s ease-in-out infinite;
    text-shadow: 0 0 5px rgba(255, 69, 0, 0.7);
}

.fire-spark {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    color: #ffd700;
    font-size: 6px;
    opacity: 0.6;
    z-index: 1;
    animation: sparkDance 2.5s ease-in-out infinite;
    text-shadow: 0 0 3px rgba(255, 215, 0, 0.8);
}

.fire-letter:nth-child(3n) .fire-flame {
    animation-delay: 0.5s;
}

.fire-letter:nth-child(3n+1) .fire-spark {
    animation-delay: 1s;
}

@keyframes flameRise {
    0%, 100% {
        opacity: 0.8;
        transform: translateX(-50%) translateY(0px) scale(1);
    }
    50% {
        opacity: 1;
        transform: translateX(-50%) translateY(-3px) scale(1.1);
    }
}

@keyframes sparkDance {
    0%, 100% {
        opacity: 0.6;
        transform: translateX(-50%) translateY(0px) rotate(0deg);
    }
    33% {
        opacity: 1;
        transform: translateX(-50%) translateY(-2px) rotate(120deg);
    }
    66% {
        opacity: 0.8;
        transform: translateX(-50%) translateY(-4px) rotate(240deg);
    }
}


.fiery-code-container:hover .code-char {
    animation-duration: 2s;
}

/* Footer */
footer {
    text-align: center;
    color: var(--text-secondary);
    margin-top: 60px;
    padding: 20px;
    font-size: 13px;
}

/* Enhanced Sessions Display */
.session-item.detailed {
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--card-bg);
    margin-bottom: 16px;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px var(--shadow);
}

.session-item.detailed:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    border-color: var(--primary);
}

.session-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
}

.session-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.session-id {
    font-size: 12px;
    color: var(--text-secondary);
    font-family: 'Courier New', monospace;
    background: var(--background);
    padding: 2px 6px;
    border-radius: 4px;
    margin-top: 4px;
}

.session-actions {
    display: flex;
    gap: 8px;
}

.session-actions .action-btn {
    padding: 6px 12px;
    font-size: 12px;
    border-radius: 4px;
    transition: all 0.2s;
}

.session-actions .action-btn:hover {
    transform: translateY(-1px);
}

.session-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 16px;
    padding: 16px 20px;
}

.stat-group {
    text-align: center;
}

.stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.stat-value {
    font-size: 18px;
    font-weight: 700;
    color: var(--primary);
    margin: 0;
}

.stat-label {
    font-size: 12px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 500;
    margin: 0;
}

.session-meta {
    padding: 12px 20px;
    background: rgba(59, 130, 246, 0.05);
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    color: var(--text-secondary);
}

.session-dates {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.top-brands {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.brand-tag {
    padding: 2px 8px;
    background: var(--primary);
    color: white;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
}

/* Session Detail Modal */
.detail-modal {
    display: none;
    position: fixed;
    z-index: 1001;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.65);
    /* backdrop-filter removed - causes severe performance issues */
}

.detail-modal.show {
    display: block;
    animation: fadeInModal 0.3s ease;
}

.detail-content {
    background: var(--card-bg);
    margin: 3% auto;
    padding: 0;
    border-radius: 12px;
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
}

.detail-header {
    padding: 20px 24px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.detail-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.detail-close {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s;
}

.detail-close:hover {
    color: var(--text-primary);
    background: var(--border);
}

.detail-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

.detail-section {
    margin-bottom: 24px;
}

.detail-section h4 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 12px 0;
    border-bottom: 2px solid var(--border);
    padding-bottom: 8px;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 16px;
    margin-bottom: 16px;
}

.detail-stat {
    text-align: center;
    padding: 12px;
    background: var(--surface);
    border-radius: 8px;
}

.detail-stat-value {
    font-size: 20px;
    font-weight: 700;
    color: var(--primary);
    margin: 0;
}

.detail-stat-label {
    font-size: 12px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 4px 0 0 0;
}

.category-tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 8px;
}

.category-tag {
    padding: 4px 12px;
    background: var(--success);
    color: white;
    border-radius: 16px;
    font-size: 12px;
    font-weight: 500;
}

.product-preview {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid var(--border);
    border-radius: 8px;
}

.product-preview-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-bottom: 1px solid var(--border);
    transition: background 0.2s;
}

.product-preview-item:last-child {
    border-bottom: none;
}

.product-preview-item:hover {
    background: var(--surface);
}

.product-image-placeholder {
    width: 40px;
    height: 40px;
    background: var(--surface);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    font-size: 18px;
    flex-shrink: 0;
}

.product-info {
    flex: 1;
    min-width: 0;
}

.product-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    margin: 0 0 4px 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.product-price {
    font-size: 12px;
    color: var(--success);
    font-weight: 600;
    margin: 0;
}

/* Responsive */
@media (max-width: 768px) {
    .config-grid {
        grid-template-columns: 1fr;
    }

    .status-bar {
        flex-direction: column;
        gap: 12px;
    }

    .header-nav {
        gap: 5px;
    }

    .nav-btn {
        padding: 6px 12px;
        font-size: 13px;
    }

    .session-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .session-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .session-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .detail-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ============================================
   MODERN PROFESSIONAL UI STYLES
   ============================================ */

/* Modern Modal Styles */
.modern-modal {
    width: 90vw;
    max-width: 800px;
    min-width: 500px;
    height: 85vh;
    max-height: 800px;
    min-height: 400px;
    border-radius: 16px;
    box-shadow: 0 25px 80px rgba(0,0,0,0.15);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    margin: 2.5vh auto;
    backdrop-filter: blur(20px);
}

/* Responsive adjustments for smaller screens */
@media (max-width: 768px) {
    .modern-modal {
        width: 95vw;
        height: 90vh;
        min-width: 320px;
        margin: 1vh auto;
        border-radius: 12px;
    }
}

@media (max-width: 480px) {
    .modern-modal {
        width: 98vw;
        height: 95vh;
        margin: 0.5vh auto;
        border-radius: 8px;
    }
}

/* Sessions Modal Specific Styling */
.sessions-modal .modal-content {
    width: 90vw;
    max-width: 1000px;
    min-width: 600px;
    height: 85vh;
    max-height: 700px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.sessions-modal .tab-content {
    overflow-y: auto;
    flex: 1;
    padding-right: 8px;
}

@media (max-width: 768px) {
    .sessions-modal .modal-content {
        min-width: 320px;
        width: 95vw;
        height: 90vh;
    }

    .settings-modal .modal-content {
        width: 95vw;
        height: 90vh;
    }
}

/* Custom Modern Scrollbar Styling */
.modal-content,
.modern-modal,
.help-modal,
.settings-modern,
.tab-content {
    scrollbar-width: thin;
    scrollbar-color: rgba(59, 130, 246, 0.3) transparent;
}

/* Webkit scrollbar for Chromium browsers */
.modal-content::-webkit-scrollbar,
.modern-modal::-webkit-scrollbar,
.help-modal::-webkit-scrollbar,
.settings-modern::-webkit-scrollbar,
.tab-content::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.modal-content::-webkit-scrollbar-track,
.modern-modal::-webkit-scrollbar-track,
.help-modal::-webkit-scrollbar-track,
.settings-modern::-webkit-scrollbar-track,
.tab-content::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 10px;
}

.modal-content::-webkit-scrollbar-thumb,
.modern-modal::-webkit-scrollbar-thumb,
.help-modal::-webkit-scrollbar-thumb,
.settings-modern::-webkit-scrollbar-thumb,
.tab-content::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.6), rgba(37, 99, 235, 0.8));
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.modal-content::-webkit-scrollbar-thumb:hover,
.modern-modal::-webkit-scrollbar-thumb:hover,
.help-modal::-webkit-scrollbar-thumb:hover,
.settings-modern::-webkit-scrollbar-thumb:hover,
.tab-content::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.8), rgba(37, 99, 235, 1));
    box-shadow: 0 2px 6px rgba(59, 130, 246, 0.3);
}

/* Dark theme scrollbar adjustments */
[data-theme="dark"] .modal-content::-webkit-scrollbar-track,
[data-theme="dark"] .modern-modal::-webkit-scrollbar-track,
[data-theme="dark"] .help-modal::-webkit-scrollbar-track,
[data-theme="dark"] .settings-modern::-webkit-scrollbar-track,
[data-theme="dark"] .tab-content::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] .modal-content::-webkit-scrollbar-thumb,
[data-theme="dark"] .modern-modal::-webkit-scrollbar-thumb,
[data-theme="dark"] .help-modal::-webkit-scrollbar-thumb,
[data-theme="dark"] .settings-modern::-webkit-scrollbar-thumb,
[data-theme="dark"] .tab-content::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, rgba(96, 165, 250, 0.6), rgba(59, 130, 246, 0.8));
    border: 1px solid rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] .modal-content::-webkit-scrollbar-thumb:hover,
[data-theme="dark"] .modern-modal::-webkit-scrollbar-thumb:hover,
[data-theme="dark"] .help-modal::-webkit-scrollbar-thumb:hover,
[data-theme="dark"] .settings-modern::-webkit-scrollbar-thumb:hover,
[data-theme="dark"] .tab-content::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, rgba(96, 165, 250, 0.8), rgba(59, 130, 246, 1));
    box-shadow: 0 2px 6px rgba(96, 165, 250, 0.4);
}

.modal-header-modern {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px;
    border-bottom: 1px solid var(--border);
    background: linear-gradient(to right, var(--card-bg), rgba(59, 130, 246, 0.02));
}

.modal-header-modern h2 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
}

.modal-close-btn {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 24px;
    cursor: pointer;
    transition: all 0.2s;
}

.modal-close-btn:hover {
    background: var(--border);
    color: var(--text-primary);
}

/* Settings Cards */
.settings-modern {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}

/* Ensure proper scrolling in modal content */
.modal-content {
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* Settings specific modal fix */
.settings-modal .modal-content {
    width: 90vw;
    max-width: 900px;
    height: 85vh;
    max-height: 700px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.settings-modal .settings-modern {
    overflow-y: auto;
    overflow-x: hidden;
    flex: 1;
    padding-right: 8px; /* Extra space for scrollbar */
}

/* Ensure form elements have enough space */
.api-input-group {
    margin-bottom: 8px;
    z-index: 1;
    position: relative;
}

.settings-card-body {
    overflow: visible;
    position: relative;
    z-index: 1;
}

.modal-header-modern {
    flex-shrink: 0;
}

.modal-actions {
    flex-shrink: 0;
    margin-top: auto;
}

.settings-card {
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: visible;
    background: var(--card-bg);
}

.settings-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    background: linear-gradient(135deg, transparent, rgba(59, 130, 246, 0.02));
    border-bottom: 1px solid var(--border);
}

.settings-card-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.icon-sm {
    width: 20px;
    height: 20px;
    color: var(--primary);
}

.settings-card-body {
    padding: 20px;
}

/* Modern Input Styles */
.api-input-group {
    margin-bottom: 20px;
}

.input-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.optional-badge {
    padding: 2px 8px;
    background: var(--border);
    color: var(--text-secondary);
    border-radius: 4px;
    font-size: 11px;
    font-weight: 400;
}

.modern-input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg);
    color: var(--text-primary);
    font-size: 14px;
    transition: all 0.2s;
}

.modern-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.input-with-status {
    position: relative;
    overflow: visible;
    z-index: 1;
}

.api-status {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 12px;
}

/* Settings Row */
.settings-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.settings-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.input-with-unit {
    display: flex;
    align-items: center;
    gap: 8px;
}

.modern-input.compact {
    max-width: 120px;
}

.field-unit {
    font-size: 13px;
    color: var(--text-secondary);
}

.field-description {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 4px;
    line-height: 1.4;
    opacity: 0.8;
}

/* Extraction Mode Selection */
.extraction-mode-container {
    margin-top: 16px;
}

.mode-selector {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.mode-option {
    cursor: pointer;
    display: block;
}

.mode-option input[type="radio"] {
    display: none;
}

.mode-card {
    padding: 20px;
    border-radius: 12px;
    border: 2px solid var(--border);
    background: var(--bg-secondary);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.mode-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #3b82f6, #06b6d4);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mode-option input[type="radio"]:checked + .mode-card {
    border-color: #3b82f6;
    background: rgba(59, 130, 246, 0.05);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.15);
}

.mode-option input[type="radio"]:checked + .mode-card::before {
    opacity: 1;
}

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

.mode-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.pro-badge {
    background: linear-gradient(45deg, #3b82f6, #06b6d4, #8b5cf6);
    background-size: 200% 200%;
    animation: gradientShift 3s ease infinite;
    color: white;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.3);
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.mode-description {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 16px;
}

.mode-features {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.feature-tag {
    background: var(--accent-bg);
    color: var(--accent);
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
}

.mode-card:hover {
    border-color: rgba(59, 130, 246, 0.5);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.1);
}

/* Intelligence Engine Section */
.phase-badge.intelligence {
    background: linear-gradient(135deg, #6366f1, #8b5cf6, #06b6d4);
    background-size: 200% 200%;
    animation: gradientShift 4s ease infinite;
}

.intelligence-selector {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 20px;
}

.intelligence-option {
    cursor: pointer;
    display: block;
}

.intelligence-option input[type="radio"] {
    display: none;
}

.intelligence-card {
    cursor: pointer;
    padding: 24px;
    border-radius: 16px;
    border: 2px solid var(--border);
    background: var(--bg-secondary);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

/* Hover state for unselected cards */
.intelligence-card:hover:not(.selected) {
    border-color: rgba(99, 102, 241, 0.3);
    background: rgba(99, 102, 241, 0.02);
    transform: translateY(-1px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

/* Top gradient bar */
.intelligence-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #6366f1, #8b5cf6, #06b6d4);
    opacity: 0;
    transition: all 0.3s ease;
}

/* Selected state - much more prominent */
.intelligence-card.selected {
    border-color: #6366f1;
    background: rgba(99, 102, 241, 0.08);
    transform: translateY(-3px);
    box-shadow: 0 16px 40px rgba(99, 102, 241, 0.25);
}

.intelligence-card.selected::before {
    opacity: 1;
}

/* Selected indicator badge - REMOVED to avoid duplicate indicators */
/* Using only the circle checkmark indicator for cleaner UI */

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

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

.mode-name {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
}

.pro-badge-small {
    background: linear-gradient(45deg, #6366f1, #8b5cf6, #06b6d4);
    background-size: 200% 200%;
    animation: gradientShift 3s ease infinite;
    color: white;
    padding: 3px 6px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

.selection-indicator {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid var(--border);
    background: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    opacity: 0.3;
}

.selection-indicator svg {
    width: 14px;
    height: 14px;
    color: white;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.intelligence-card.selected .selection-indicator {
    background: #6366f1;
    border-color: #6366f1;
    opacity: 1;
}

.intelligence-card.selected .selection-indicator svg {
    opacity: 1;
}

.intelligence-description {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 16px;
}

.intelligence-features {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.feature-pill {
    background: rgba(99, 102, 241, 0.1);
    color: #6366f1;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    border: 1px solid rgba(99, 102, 241, 0.2);
}

.intelligence-card:hover {
    border-color: rgba(99, 102, 241, 0.5);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.1);
}

.intelligence-status {
    text-align: center;
    padding: 16px;
    background: rgba(99, 102, 241, 0.05);
    border-radius: 12px;
    border: 1px solid rgba(99, 102, 241, 0.1);
}

.status-text {
    color: var(--text-secondary);
    font-size: 14px;
}

.status-text strong {
    color: #6366f1;
    font-weight: 600;
}

/* Intelligence Settings */
.intelligence-settings {
    margin-top: 24px;
    padding: 20px;
    background: rgba(99, 102, 241, 0.02);
    border-radius: 12px;
    border: 1px solid rgba(99, 102, 241, 0.1);
}

.settings-header h4 {
    margin: 0 0 16px 0;
    color: var(--text-primary);
    font-size: 16px;
    font-weight: 600;
}

.settings-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    align-items: start;
}

.toggle-settings {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.setting-toggle {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
}

.setting-toggle input[type="checkbox"] {
    display: none;
}

.toggle-slider {
    position: relative;
    width: 44px;
    height: 24px;
    background: var(--border);
    border-radius: 12px;
    transition: all 0.3s ease;
}

.toggle-slider::before {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    transition: transform 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.setting-toggle input[type="checkbox"]:checked + .toggle-slider {
    background: #6366f1;
}

.setting-toggle input[type="checkbox"]:checked + .toggle-slider::before {
    transform: translateX(20px);
}

.toggle-label {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}

.input-settings {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.setting-input {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.input-label-small {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
}

.compact-input, .compact-select {
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--bg);
    color: var(--text-primary);
    font-size: 14px;
    transition: border-color 0.2s ease;
}

.compact-input:focus, .compact-select:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.compact-input {
    max-width: 120px;
}

.compact-select {
    max-width: 140px;
}

/* Setting Descriptions */
.settings-subtitle {
    margin: 4px 0 0 0;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 400;
}

.setting-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.setting-description {
    margin: 0;
    color: var(--text-secondary);
    font-size: 12px;
    line-height: 1.4;
    padding-left: 0;
}

.input-hint {
    display: block;
    margin-top: 4px;
    color: var(--text-secondary);
    font-size: 11px;
    line-height: 1.3;
}

/* Enhanced Settings Header */
.settings-header-enhanced {
    margin-bottom: 28px;
    padding-bottom: 20px;
    border-bottom: 2px solid rgba(99, 102, 241, 0.1);
}

.settings-icon-wrapper {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 12px;
}

.settings-icon {
    width: 28px;
    height: 28px;
    color: #6366f1;
    padding: 6px;
    background: rgba(99, 102, 241, 0.1);
    border-radius: 8px;
}

.settings-title-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

.settings-title {
    margin: 0;
    color: var(--text-primary);
    font-size: 18px;
    font-weight: 600;
}

.settings-badge {
    padding: 4px 12px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: white;
    font-size: 11px;
    font-weight: 600;
    border-radius: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.settings-description-enhanced {
    margin: 0;
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.5;
}

/* Enhanced Settings Content */
.settings-content-enhanced {
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.settings-section {
    background: var(--surface);
    border-radius: 12px;
    padding: 24px;
    border: 1px solid var(--border);
}

.section-divider {
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(226, 232, 240, 0.6);
}

.section-label {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-primary);
    font-weight: 600;
    font-size: 14px;
}

.section-icon {
    width: 18px;
    height: 18px;
    color: #6366f1;
}

/* Enhancement Selector (matching Intelligence Cards) */
.enhancement-selector {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.enhancement-option {
    position: relative;
    cursor: pointer;
}

.enhancement-option input[type="checkbox"] {
    display: none;
}

.enhancement-card {
    background: var(--bg);
    border: 2px solid var(--border);
    border-radius: 16px;
    padding: 24px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.enhancement-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--border), var(--border));
    transition: background 0.3s ease;
}

.enhancement-card:hover {
    border-color: rgba(99, 102, 241, 0.3);
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.1);
    transform: translateY(-2px);
}

.enhancement-option input[type="checkbox"]:checked + .enhancement-card {
    border-color: #6366f1;
    background: rgba(99, 102, 241, 0.02);
}

.enhancement-option input[type="checkbox"]:checked + .enhancement-card::before {
    background: linear-gradient(90deg, #6366f1, #8b5cf6);
}

.enhancement-header {
    display: flex;
    justify-content: between;
    align-items: flex-start;
    margin-bottom: 16px;
}

.enhancement-title {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.feature-name {
    color: var(--text-primary);
    font-weight: 600;
    font-size: 16px;
}

.feature-badge {
    padding: 4px 8px;
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    font-size: 10px;
    font-weight: 700;
    border-radius: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ai-badge {
    background: linear-gradient(135deg, #f59e0b, #d97706);
}

.toggle-indicator {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.toggle-indicator svg {
    width: 16px;
    height: 16px;
    color: transparent;
    transition: all 0.3s ease;
}

.enhancement-option input[type="checkbox"]:checked + .enhancement-card .toggle-indicator {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
}

.enhancement-option input[type="checkbox"]:checked + .enhancement-card .toggle-indicator svg {
    color: white;
}

.enhancement-description {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 16px;
}

.enhancement-features {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.api-warning {
    margin-top: 16px;
    padding: 12px;
    background: rgba(239, 68, 68, 0.05);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: #dc2626;
    font-size: 12px;
    font-weight: 500;
}

.warning-icon {
    width: 16px;
    height: 16px;
    color: #dc2626;
    flex-shrink: 0;
}

/* Enhanced Input Grid */
.enhanced-input-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.input-card {
    background: var(--bg);
    border-radius: 10px;
    padding: 18px;
    border: 1px solid var(--border);
    transition: all 0.2s ease;
}

.input-card:focus-within {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.input-label-enhanced {
    display: block;
    color: var(--text-primary);
    font-weight: 600;
    font-size: 13px;
    margin-bottom: 8px;
}

.input-enhanced, .select-enhanced {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    color: var(--text-primary);
    background: var(--bg);
    transition: all 0.3s ease;
    margin-bottom: 6px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Enhanced dropdown arrow styling */
.select-enhanced {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 8px center;
    background-repeat: no-repeat;
    background-size: 16px;
    padding-right: 40px;
    appearance: none;
    cursor: pointer;
}

/* Dark mode dropdown arrow */
[data-theme="dark"] .select-enhanced {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%9ca3af' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
}

.input-enhanced:focus, .select-enhanced:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1), 0 2px 8px rgba(0, 0, 0, 0.15);
    transform: translateY(-1px);
}

.select-enhanced:hover {
    border-color: rgba(99, 102, 241, 0.3);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
}

/* Dropdown option styling */
.select-enhanced option {
    background: var(--bg);
    color: var(--text-primary);
    padding: 8px 12px;
    border: none;
}

.select-enhanced option:hover,
.select-enhanced option:focus {
    background: var(--primary);
    color: white;
}

.select-enhanced option:checked {
    background: var(--primary);
    color: white;
}

/* Dark mode specific option styling */
[data-theme="dark"] .select-enhanced option {
    background: var(--bg-dark, #1f2937);
    color: var(--text-primary);
}

[data-theme="dark"] .select-enhanced option:hover,
[data-theme="dark"] .select-enhanced option:focus {
    background: var(--primary);
    color: white;
}

[data-theme="dark"] .select-enhanced {
    color-scheme: dark;
}

.input-description {
    color: var(--text-secondary);
    font-size: 11px;
    line-height: 1.3;
    margin: 0;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .enhanced-toggle-grid {
        grid-template-columns: 1fr;
    }

    .enhanced-input-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 768px) {
    .enhanced-input-grid {
        grid-template-columns: 1fr;
    }

    .settings-icon-wrapper {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .settings-title-group {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
}

/* Modal Actions */
.modal-actions {
    padding: 20px 24px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    background: var(--bg);
}

.modern-btn {
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
}

.modern-btn.primary {
    background: var(--primary);
    color: white;
}

.modern-btn.primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15);
}

.modern-btn.ghost {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

.modern-btn.ghost:hover {
    background: var(--border);
    color: var(--text-primary);
}

/* Configuration Section Styles */
.config-modern {
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.config-section {
    padding: 0;
}

.section-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.section-icon {
    width: 24px;
    height: 24px;
    color: var(--primary);
}

.section-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

/* Enhancement Grid */
.enhancement-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.enhancement-card {
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--bg);
    transition: all 0.2s;
}

.enhancement-card:hover {
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

/* Modern Toggle Switch */
.switch-container {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    margin-bottom: 8px;
}

.switch-input {
    display: none;
}

.switch-slider {
    position: relative;
    width: 44px;
    height: 24px;
    background: var(--border);
    border-radius: 12px;
    transition: all 0.3s;
}

.switch-slider::before {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    left: 3px;
    top: 3px;
    background: white;
    border-radius: 50%;
    transition: all 0.3s;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.switch-input:checked + .switch-slider {
    background: var(--primary);
}

.switch-input:checked + .switch-slider::before {
    transform: translateX(20px);
}

.switch-label {
    font-size: 15px;
    font-weight: 500;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

/* AI Indicator */
.ai-indicator {
    position: relative;
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 4px;
    margin-left: 4px;
}

.ai-icon {
    width: 14px;
    height: 14px;
    color: white;
}

.ai-tooltip {
    display: none;
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 6px 12px;
    background: var(--text-primary);
    color: white;
    font-size: 12px;
    border-radius: 6px;
    white-space: nowrap;
    margin-bottom: 4px;
}

.ai-indicator:hover .ai-tooltip {
    display: block;
}

.feature-desc {
    margin: 0;
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* Config Grid Modern */
.config-grid-modern {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.config-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.field-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
}

.field-input,
.field-select {
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--bg);
    color: var(--text-primary);
    font-size: 14px;
    transition: all 0.2s;
}

.field-input:focus,
.field-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Format Selector */
.format-selector {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.format-option {
    cursor: pointer;
}

.format-option input[type="radio"] {
    display: none;
}

.format-card {
    display: flex;
    flex-direction: column;
    padding: 12px;
    border: 2px solid var(--border);
    border-radius: 8px;
    background: var(--bg);
    transition: all 0.2s;
}

.format-option input[type="radio"]:checked + .format-card {
    border-color: var(--primary);
    background: linear-gradient(to bottom, rgba(59, 130, 246, 0.05), transparent);
}

.format-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.format-desc {
    font-size: 12px;
    color: var(--text-secondary);
}

/* Phase Badges */
.phase-badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    background: linear-gradient(135deg, var(--primary), #667eea);
    color: white;
    font-size: 12px;
    font-weight: 600;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.phase-badge.phase-2 {
    background: linear-gradient(135deg, #667eea, #764ba2);
}

/* Modern Card Header with Phase Badge */
.card-header {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

/* Modern Textarea */
.modern-textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--bg);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 14px;
    line-height: 1.6;
    resize: vertical;
    transition: all 0.2s;
}

.modern-textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.modern-textarea.readonly {
    background: var(--card-bg);
    cursor: default;
}

.modern-textarea::placeholder {
    color: var(--text-secondary);
    opacity: 0.7;
}

/* Input Section */
.input-section {
    margin-bottom: 24px;
}

.input-label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.input-hint {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-top: 8px;
    padding: 8px 12px;
    background: rgba(59, 130, 246, 0.05);
    border-left: 3px solid var(--primary);
    border-radius: 6px;
    font-size: 13px;
    color: var(--text-secondary);
}

.hint-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    color: var(--primary);
    margin-top: 2px;
}

/* Action Section */
.action-section {
    display: flex;
    justify-content: center;
    margin: 24px 0;
}

/* Modern Button Enhancements */
.modern-btn.large {
    padding: 14px 28px;
    font-size: 15px;
    font-weight: 600;
}

.btn-icon {
    width: 20px;
    height: 20px;
}

/* Progress Container Modern */
.progress-container.modern {
    margin: 24px 0;
    padding: 20px;
    background: linear-gradient(to bottom, var(--bg), rgba(59, 130, 246, 0.02));
    border: 1px solid var(--border);
    border-radius: 12px;
}

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

.progress-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.progress-percentage-container {
    display: flex;
    justify-content: center;
    margin-bottom: 8px;
}

.progress-percentage {
    font-size: 14px;
    font-weight: 600;
    color: var(--primary);
    background: var(--card-bg);
    padding: 4px 12px;
    border-radius: 20px;
    border: 1px solid var(--border);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.progress-track {
    height: 10px;
    background: var(--border);
    border-radius: 5px;
    overflow: hidden;
    position: relative;
}

.progress-fill.animated {
    background: linear-gradient(90deg, var(--primary), #667eea);
    transition: width 0.3s ease;
    position: relative;
    overflow: hidden;
    height: 100%;
}

.progress-fill.animated::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.progress-status {
    margin-top: 8px;
    font-size: 13px;
    color: var(--text-secondary);
}

/* Results Section Modern */
.results-section.modern {
    margin-top: 24px;
    padding: 20px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 12px;
}

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

.results-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.results-count {
    padding: 4px 12px;
    background: var(--primary);
    color: white;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
}

/* Extraction Options Modern */
.extraction-options.modern {
    margin: 24px 0;
    padding: 16px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 10px;
}

.option-row {
    margin-bottom: 16px;
}

.option-row:last-child {
    margin-bottom: 0;
}

.option-desc {
    margin: 4px 0 0 56px;
    font-size: 12px;
    color: var(--text-secondary);
}

/* Modern Button with Icon */
.modern-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    position: relative;
}

.modern-btn.secondary {
    background: transparent;
    color: var(--primary);
    border: 2px solid var(--primary);
}

.modern-btn.secondary:hover {
    background: var(--primary);
    color: white;
    transform: translateY(-1px);
}

/* Session Badge Enhancement */
.session-badge {
    padding: 6px 12px;
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ============================================
   MODERN NOTIFICATION & DIALOG STYLES
   ============================================ */

/* Notification Overlay */
.notification-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 100px;
    z-index: 10000;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.notification-overlay.show {
    opacity: 1;
}

/* Modern Notification with Glass Effect */
.notification-modern {
    pointer-events: auto;
    transform: translateY(-20px) scale(0.95);
    transition: transform 0.3s ease;
    max-width: 480px;
    width: 90%;
}

.notification-overlay.show .notification-modern {
    transform: translateY(0) scale(1);
}

.notification-glass {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 20px;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 16px;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

/* Success notification - green transparent background */
.notification-modern.success .notification-glass {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.9) 0%, rgba(16, 185, 129, 0.9) 100%);
    box-shadow: 0 20px 60px rgba(34, 197, 94, 0.3),
                0 0 0 1px rgba(255, 255, 255, 0.2) inset;
}

/* Error notification - red transparent background */
.notification-modern.error .notification-glass {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.9) 0%, rgba(220, 38, 38, 0.9) 100%);
    box-shadow: 0 20px 60px rgba(239, 68, 68, 0.3),
                0 0 0 1px rgba(255, 255, 255, 0.2) inset;
}

/* Warning notification - yellow/orange transparent background */
.notification-modern.warning .notification-glass {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.9) 0%, rgba(236, 72, 153, 0.9) 100%);
    box-shadow: 0 20px 60px rgba(245, 158, 11, 0.3),
                0 0 0 1px rgba(255, 255, 255, 0.2) inset;
}

/* Info notification - blue transparent background */
.notification-modern.info .notification-glass {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.9) 0%, rgba(99, 102, 241, 0.9) 100%);
    box-shadow: 0 20px 60px rgba(59, 130, 246, 0.3),
                0 0 0 1px rgba(255, 255, 255, 0.2) inset;
}

/* Dark mode adjustments */
body.dark-mode .notification-modern.success .notification-glass {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.85) 0%, rgba(16, 185, 129, 0.85) 100%);
}

body.dark-mode .notification-modern.error .notification-glass {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.85) 0%, rgba(220, 38, 38, 0.85) 100%);
}

body.dark-mode .notification-modern.warning .notification-glass {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.85) 0%, rgba(236, 72, 153, 0.85) 100%);
}

body.dark-mode .notification-modern.info .notification-glass {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.85) 0%, rgba(99, 102, 241, 0.85) 100%);
}

/* Notification Icon Modern */
.notification-icon-modern {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    flex-shrink: 0;
}

.notification-icon-modern svg {
    width: 24px;
    height: 24px;
}

/* Notification Types with White Icons */
.notification-modern.success .notification-icon-modern {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.notification-modern.error .notification-icon-modern {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.notification-modern.warning .notification-icon-modern {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.notification-modern.info .notification-icon-modern {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

/* Notification Content */
.notification-content-modern {
    flex: 1;
}

.notification-title-modern {
    font-size: 16px;
    font-weight: 600;
    color: white;
    margin-bottom: 4px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.notification-message-modern {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.95);
    line-height: 1.5;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* Close Button Modern */
.notification-close-modern {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    color: white;
    transition: all 0.2s;
}

.notification-close-modern:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.notification-close-modern svg {
    width: 16px;
    height: 16px;
}

/* Dialog Overlay */
.dialog-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    /* backdrop-filter removed - causes severe performance issues */
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.dialog-overlay.show {
    opacity: 1;
}

/* Dialog Modern */
.dialog-modern {
    transform: scale(0.9);
    transition: transform 0.3s ease;
    max-width: 420px;
    width: 90%;
}

.dialog-overlay.show .dialog-modern {
    transform: scale(1);
}

.dialog-glass {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 16px;
    box-shadow: 0 25px 70px rgba(0, 0, 0, 0.2),
                0 0 0 1px rgba(255, 255, 255, 0.5) inset;
    overflow: hidden;
}

body.dark-mode .dialog-glass {
    background: rgba(30, 30, 30, 0.98);
    box-shadow: 0 25px 70px rgba(0, 0, 0, 0.5),
                0 0 0 1px rgba(255, 255, 255, 0.1) inset;
}

.dialog-header {
    padding: 24px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

body.dark-mode .dialog-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.dialog-title {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.dialog-body {
    padding: 24px;
}

.dialog-message {
    margin: 0;
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
}

.dialog-actions {
    display: flex;
    gap: 12px;
    padding: 20px 24px;
    justify-content: flex-end;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
}

body.dark-mode .dialog-actions {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.dialog-btn {
    padding: 10px 20px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
}

.dialog-btn.cancel {
    background: rgba(0, 0, 0, 0.05);
    color: var(--text-secondary);
}

.dialog-btn.cancel:hover {
    background: rgba(0, 0, 0, 0.08);
}

body.dark-mode .dialog-btn.cancel {
    background: rgba(255, 255, 255, 0.05);
}

body.dark-mode .dialog-btn.cancel:hover {
    background: rgba(255, 255, 255, 0.08);
}

.dialog-btn.confirm {
    background: linear-gradient(135deg, var(--primary), #667eea);
    color: white;
}

.dialog-btn.confirm:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

/* Field Error State */
.field-error {
    border-color: #ef4444 !important;
    animation: shake 0.3s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* Invalid input shake animation */
.invalid-shake {
    animation: shake 0.5s ease;
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1) !important;
}

.invalid-shake:focus {
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2) !important;
}

/* API Validation Display */
.api-validation {
    display: flex;
    align-items: center;
    gap: 8px;
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    background: var(--card-bg);
    border-radius: 4px;
    padding: 2px 6px;
}

.api-status-icon {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
}

.api-status-icon.checking {
    background: #f3f4f6;
    color: #6b7280;
}

.api-status-icon.valid {
    background: #10b981;
    color: white;
}

.api-status-icon.invalid {
    background: #ef4444;
    color: white;
}

.api-status-text {
    font-size: 12px;
    font-weight: 500;
}

.api-status-text.checking { color: #6b7280; }
.api-status-text.valid { color: #10b981; }
.api-status-text.invalid { color: #ef4444; }

/* Required Badge */
.required-badge {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-left: 8px;
}

/* Modal Body Modern */
.modal-body-modern {
    padding: 24px;
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.finalize-summary-modern {
    background: var(--bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
}

.warning-header-modern {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.finalize-warning-modern {
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-radius: 12px;
    padding: 16px;
    margin-top: 20px;
}

body.dark-mode .finalize-warning-modern {
    background: rgba(245, 158, 11, 0.05);
    border-color: rgba(245, 158, 11, 0.2);
}

/* Session Info Modern */
.session-info-modern {
    background: var(--bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    margin-top: 20px;
}

.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color);
}

.info-row:last-child {
    border-bottom: none;
}

.info-label {
    color: var(--text-secondary);
    font-weight: 500;
}

.info-value {
    color: var(--text-primary);
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', monospace;
}

.status-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-badge.active {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
}

.btn-icon {
    width: 18px;
    height: 18px;
    margin-right: 8px;
}

/* Fix Dark Mode Select Boxes */
body.dark-mode select,
body.dark-mode .field-select {
    background-color: var(--bg);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3E%3Cpath stroke='%23888' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3E%3C/svg%3E");
    background-position: right 10px center;
    background-repeat: no-repeat;
    background-size: 20px;
    padding-right: 36px;
    color: var(--text-primary);
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

body.dark-mode select option {
    background: var(--bg);
    color: var(--text-primary);
}

/* Light mode select box enhancement */
select,
.field-select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3E%3Cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3E%3C/svg%3E");
    background-position: right 10px center;
    background-repeat: no-repeat;
    background-size: 20px;
    padding-right: 36px;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

/* ============================================
   MODERN EXTRACTION RESULTS STYLES
   ============================================ */

/* Results Header */
.results-header-modern {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 32px;
    padding: 24px;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.02), rgba(147, 197, 253, 0.02));
    border-radius: 16px;
    border: 1px solid rgba(59, 130, 246, 0.1);
}

.results-title-section {
    flex: 1;
}

.results-title {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0 0 8px 0;
    color: var(--text-primary);
    font-size: 24px;
    font-weight: 600;
}

.results-icon {
    width: 28px;
    height: 28px;
    color: var(--primary);
}

.results-subtitle {
    margin: 0;
    color: var(--text-secondary);
    font-size: 14px;
}

.results-stats {
    display: flex;
    gap: 16px;
}

.stat-card {
    background: var(--card-bg);
    padding: 16px 20px;
    border-radius: 12px;
    border: 1px solid var(--border);
    text-align: center;
    min-width: 80px;
}

.stat-number {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary);
    display: block;
}

.stat-label {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 4px;
    display: block;
}

/* Action Toolbar */
.action-toolbar-modern {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 24px;
}

.toolbar-section {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: var(--text-primary);
}

.section-title svg {
    width: 18px;
    height: 18px;
    color: var(--primary);
}

.action-buttons {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.action-btn-modern {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--card-bg);
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.action-btn-modern svg {
    width: 16px;
    height: 16px;
}

.action-btn-modern:hover {
    border-color: var(--primary);
    background: rgba(59, 130, 246, 0.05);
    transform: translateY(-1px);
}

.action-btn-modern.primary {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.action-btn-modern.primary:hover {
    background: rgba(59, 130, 246, 0.9);
}

.action-btn-modern.success {
    background: rgba(34, 197, 94, 0.1);
    border-color: rgba(34, 197, 94, 0.3);
    color: #059669;
}

.action-btn-modern.success:hover {
    background: rgba(34, 197, 94, 0.15);
}

/* Product Table Container */
.product-table-container {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 16px;
    margin-bottom: 24px;
    overflow: hidden;
}

/* Session Actions */
.session-actions-modern {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-top: 32px;
}

.actions-section {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 24px;
}

.section-header h4 {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 8px 0;
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.section-header svg {
    width: 20px;
    height: 20px;
    color: var(--primary);
}

.section-header p {
    margin: 0;
    font-size: 14px;
    color: var(--text-secondary);
}

/* Export Section */
.export-controls {
    margin-top: 16px;
}

.export-filename-input {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    margin-bottom: 16px;
    background: var(--surface);
    color: var(--text-primary);
}

.export-filename-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.export-format-buttons {
    display: flex;
    gap: 12px;
}

.export-btn-modern {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--card-bg);
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    flex: 1;
    justify-content: center;
}

.export-btn-modern svg {
    width: 16px;
    height: 16px;
}

.export-btn-modern:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.export-btn-modern.csv:hover {
    background: rgba(34, 197, 94, 0.1);
    border-color: #22c55e;
    color: #059669;
}

.export-btn-modern.excel:hover {
    background: rgba(34, 197, 94, 0.1);
    border-color: #22c55e;
    color: #059669;
}

.export-btn-modern.json:hover {
    background: rgba(59, 130, 246, 0.1);
    border-color: var(--primary);
    color: var(--primary);
}

/* Finalize Section */
.finalize-content-modern {
    margin-top: 16px;
}

.finalize-checklist {
    margin-bottom: 20px;
}

.checklist-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 16px;
}

.check-icon {
    width: 20px;
    height: 20px;
    color: #22c55e;
    flex-shrink: 0;
    margin-top: 2px;
}

.checklist-text {
    flex: 1;
}

.checklist-text strong {
    display: block;
    color: var(--text-primary);
    font-weight: 600;
    margin-bottom: 2px;
}

.checklist-text span {
    font-size: 13px;
    color: var(--text-secondary);
}

.session-summary-card {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.02), rgba(147, 197, 253, 0.02));
    border: 1px solid rgba(59, 130, 246, 0.1);
    border-radius: 12px;
    padding: 20px;
}

.summary-stats {
    display: flex;
    gap: 24px;
    margin-bottom: 16px;
}

.summary-stat {
    text-align: center;
}

.stat-value {
    display: block;
    font-size: 20px;
    font-weight: 700;
    color: var(--primary);
}

.stat-label {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 4px;
}

.finalize-btn-modern {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 20px;
    background: linear-gradient(135deg, var(--primary), rgba(59, 130, 246, 0.8));
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.finalize-btn-modern:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.3);
}

.finalize-btn-modern svg {
    width: 18px;
    height: 18px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .session-actions-modern {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .results-header-modern {
        flex-direction: column;
        gap: 16px;
    }

    .results-stats {
        justify-content: center;
        flex-wrap: wrap;
    }

    .action-buttons {
        justify-content: center;
    }

    .export-format-buttons {
        flex-direction: column;
    }

    .summary-stats {
        justify-content: center;
    }
}

/* ============================================
   HELP MODAL STYLES
   ============================================ */

/* Help Modal Container */
.help-modal {
    width: 90vw;
    max-width: 1000px;
    min-width: 600px;
    height: 85vh;
    max-height: 700px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border-radius: 16px;
}

/* Help modal content scrolling */
.help-content {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    min-height: 0;
}

/* Responsive help modal */
@media (max-width: 768px) {
    .help-modal {
        width: 95vw;
        height: 90vh;
        min-width: 320px;
        margin: 1vh auto;
        border-radius: 12px;
    }
}

@media (max-width: 480px) {
    .help-modal {
        width: 98vw;
        height: 95vh;
        margin: 0.5vh auto;
        border-radius: 8px;
    }

    .help-content {
        padding: 16px;
    }
}

/* Duplicate help-content rule removed - handled above */

/* Help Section Styling */
.help-section {
    margin-bottom: 32px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
}

.help-section:last-child {
    margin-bottom: 0;
}

.help-section-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    background: linear-gradient(to right, transparent, rgba(59, 130, 246, 0.03));
    border-bottom: 1px solid var(--border);
}

.help-icon {
    width: 24px;
    height: 24px;
    color: var(--primary);
    flex-shrink: 0;
}

.help-section-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.help-section-body {
    padding: 20px;
}

/* Help Steps (Ordered List) */
.help-steps {
    margin: 0;
    padding-left: 20px;
    counter-reset: step-counter;
    list-style: none;
}

.help-steps li {
    position: relative;
    padding-left: 36px;
    margin-bottom: 16px;
    line-height: 1.6;
    color: var(--text-secondary);
}

.help-steps li:before {
    content: counter(step-counter);
    counter-increment: step-counter;
    position: absolute;
    left: 0;
    top: 0;
    width: 24px;
    height: 24px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
}

.help-steps li strong {
    color: var(--text-primary);
    display: block;
    margin-bottom: 4px;
}

/* Help Text */
.help-text {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 16px;
}

/* Help Tips */
.help-tips {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.help-tip {
    display: flex;
    gap: 12px;
    padding: 12px;
    background: var(--surface);
    border-radius: 8px;
    border-left: 3px solid var(--border);
}

.help-tip.info {
    border-left-color: var(--primary);
    background: linear-gradient(to right, rgba(59, 130, 246, 0.05), transparent);
}

.help-tip.success {
    border-left-color: #22c55e;
    background: linear-gradient(to right, rgba(34, 197, 94, 0.05), transparent);
}

.tip-label {
    font-weight: 600;
    color: var(--text-primary);
    min-width: 80px;
    font-size: 13px;
}

.tip-text {
    flex: 1;
    color: var(--text-secondary);
    font-size: 13px;
}

/* Feature Grid */
.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.feature-item {
    padding: 14px;
    background: var(--surface);
    border-radius: 8px;
    border: 1px solid var(--border);
}

.feature-item strong {
    display: block;
    color: var(--text-primary);
    font-size: 14px;
    margin-bottom: 6px;
}

.feature-item span {
    color: var(--text-secondary);
    font-size: 12px;
    line-height: 1.4;
}

/* Pro Tips List */
.pro-tips-list {
    margin: 0;
    padding-left: 20px;
    list-style: none;
}

.pro-tips-list li {
    position: relative;
    padding-left: 20px;
    margin-bottom: 12px;
    color: var(--text-secondary);
    font-size: 14px;
}

.pro-tips-list li:before {
    content: "▸";
    position: absolute;
    left: 0;
    color: var(--primary);
    font-weight: bold;
}

/* Keyboard Key Styling */
kbd {
    padding: 2px 6px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 4px;
    font-family: monospace;
    font-size: 12px;
    color: var(--text-primary);
    box-shadow: 0 1px 0 rgba(0,0,0,0.1);
}

/* Support Options */
.support-options {
    display: flex;
    gap: 16px;
    margin-top: 16px;
}

.support-link {
    padding: 10px 20px;
    background: var(--primary);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
    display: inline-block;
}

.support-link:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2);
}

/* Nav Icon */
.nav-icon {
    width: 16px;
    height: 16px;
    margin-right: 4px;
    vertical-align: middle;
}

.nav-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

/* Scrollbar for help content */
.help-content::-webkit-scrollbar {
    width: 8px;
}

.help-content::-webkit-scrollbar-track {
    background: var(--surface);
    border-radius: 4px;
}

.help-content::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

.help-content::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

.batch-processing-section {
    padding: 20px;
}

.section-desc {
    color: var(--text-secondary);
    margin-bottom: 20px;
}

.batch-options {
    margin-bottom: 25px;
}

.batch-option {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-bottom: 15px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--card-bg);
}

.batch-option label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    cursor: pointer;
}

.option-desc {
    font-size: 13px;
    color: var(--text-secondary);
    margin-left: 24px;
}

.batch-actions {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

.batch-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.batch-btn:hover:not(:disabled) {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

.batch-btn:disabled {
    background: var(--border);
    cursor: not-allowed;
    transform: none;
}

.batch-btn.secondary {
    background: var(--secondary);
}

.batch-btn.secondary:hover:not(:disabled) {
    background: var(--text-secondary);
}

.batch-icon {
    font-size: 14px;
}

.batch-progress {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 20px;
}

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

.progress-header h4 {
    margin: 0;
    color: var(--primary);
}

.progress-bar {
    height: 8px;
    background: var(--border);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--primary);
    transition: width 0.3s ease;
    border-radius: 4px;
}

#batchProgressText {
    font-size: 14px;
    color: var(--text-secondary);
}

/* Setting items with checkboxes */
.setting-item label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.setting-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
}

/* Tab content for batch processing */
.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.sessions-tabs .tab-btn {
    padding: 12px 18px;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-secondary);
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s;
}

.sessions-tabs .tab-btn.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.sessions-tabs .tab-btn:hover {
    color: var(--text-primary);
}

/* ============================================
   ACTION MODALS
   ============================================ */

.action-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    /* backdrop-filter removed - causes severe performance issues */
    z-index: 10000;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.action-modal-content {
    background: var(--card-bg);
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    width: 90%;
    max-width: 480px;
    max-height: 90vh;
    overflow: hidden;
    animation: slideUp 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes slideUp {
    from {
        transform: translateY(40px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

body.dark-mode .action-modal-content {
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
}

.action-modal-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 24px 24px 16px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

body.dark-mode .action-modal-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.action-modal-icon {
    width: 24px;
    height: 24px;
    opacity: 0.8;
}

.action-modal-title {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
}

.action-modal-body {
    padding: 24px;
}

.action-modal-section {
    margin-bottom: 24px;
}

.action-modal-section:last-child {
    margin-bottom: 0;
}

.action-section-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.action-section-subtitle {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 16px;
    line-height: 1.5;
}

.action-input-group {
    position: relative;
}

.action-input {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid rgba(0, 0, 0, 0.08);
    border-radius: 12px;
    font-size: 16px;
    background: var(--input-bg);
    color: var(--text-primary);
    transition: all 0.2s;
    box-sizing: border-box;
}

body.dark-mode .action-input {
    border: 2px solid rgba(255, 255, 255, 0.08);
}

.action-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.action-input-unit {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    pointer-events: none;
}

.action-preview {
    background: rgba(59, 130, 246, 0.05);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: 8px;
    padding: 12px 16px;
    margin-top: 12px;
    font-size: 14px;
    color: var(--primary);
    font-weight: 500;
    transition: all 0.2s;
}

body.dark-mode .action-preview {
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.action-stats {
    background: rgba(0, 0, 0, 0.03);
    border-radius: 8px;
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
}

body.dark-mode .action-stats {
    background: rgba(255, 255, 255, 0.03);
}

.action-stats-icon {
    width: 20px;
    height: 20px;
    opacity: 0.6;
}

.action-stats-text {
    font-size: 14px;
    color: var(--text-secondary);
}

.action-stats-number {
    font-weight: 600;
    color: var(--text-primary);
}

.action-confirmation {
    background: rgba(34, 197, 94, 0.05);
    border: 1px solid rgba(34, 197, 94, 0.2);
    border-radius: 8px;
    padding: 16px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

body.dark-mode .action-confirmation {
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.action-confirmation-icon {
    width: 20px;
    height: 20px;
    color: #22c55e;
    margin-top: 2px;
}

.action-confirmation-content {
    flex: 1;
}

.action-confirmation-title {
    font-size: 14px;
    font-weight: 600;
    color: #22c55e;
    margin-bottom: 4px;
}

.action-confirmation-text {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.4;
}

.action-modal-footer {
    display: flex;
    gap: 12px;
    padding: 20px 24px 24px;
    justify-content: flex-end;
}

.action-btn {
    padding: 12px 24px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    min-width: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.action-btn-secondary {
    background: rgba(0, 0, 0, 0.05);
    color: var(--text-secondary);
}

body.dark-mode .action-btn-secondary {
    background: rgba(255, 255, 255, 0.05);
}

.action-btn-secondary:hover {
    background: rgba(0, 0, 0, 0.08);
    color: var(--text-primary);
}

body.dark-mode .action-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.08);
}

.action-btn-primary {
    background: var(--primary);
    color: white;
}

.action-btn-primary:hover {
    background: #2563eb;
    transform: translateY(-1px);
    box-shadow: 0 8px 16px rgba(59, 130, 246, 0.3);
}

.action-btn-primary:active {
    transform: translateY(0);
}

/* Responsive adjustments */
@media (max-width: 640px) {
    .action-modal-content {
        width: 95%;
        margin: 20px;
    }

    .action-modal-header,
    .action-modal-body,
    .action-modal-footer {
        padding-left: 20px;
        padding-right: 20px;
    }

    .action-modal-footer {
        flex-direction: column;
    }

    .action-btn {
        width: 100%;
    }
}

/* ============================================
   ADVANCED CONFIGURATION SECTION
   ============================================ */

.advanced-config-section {
    margin: 24px 0;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 12px;
    background: var(--card-bg);
    overflow: hidden;
}

body.dark-mode .advanced-config-section {
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.config-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px 24px;
    background: rgba(0, 0, 0, 0.02);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    cursor: pointer;
    transition: all 0.2s;
}

body.dark-mode .config-header {
    background: rgba(255, 255, 255, 0.02);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.config-header:hover {
    background: rgba(0, 0, 0, 0.04);
}

body.dark-mode .config-header:hover {
    background: rgba(255, 255, 255, 0.04);
}

.config-icon {
    width: 20px;
    height: 20px;
    color: var(--primary);
    flex-shrink: 0;
}

.config-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.config-subtitle {
    font-size: 13px;
    color: var(--text-secondary);
    margin: 2px 0 0 0;
}

.config-toggle {
    margin-left: auto;
    background: none;
    border: none;
    width: 24px;
    height: 24px;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.config-toggle:hover {
    background: rgba(0, 0, 0, 0.05);
    color: var(--text-primary);
}

body.dark-mode .config-toggle:hover {
    background: rgba(255, 255, 255, 0.05);
}

.config-toggle svg {
    width: 16px;
    height: 16px;
    transition: transform 0.2s;
}

.config-toggle.expanded svg {
    transform: rotate(180deg);
}

.config-content {
    padding: 24px;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    animation: slideDown 0.3s ease-out;
}

body.dark-mode .config-content {
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.config-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    margin-bottom: 24px;
}

.config-category {
    background: rgba(0, 0, 0, 0.02);
    border-radius: 10px;
    padding: 16px;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

body.dark-mode .config-category {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.category-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

body.dark-mode .category-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.category-icon {
    width: 16px;
    height: 16px;
    color: var(--primary);
}

.category-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.config-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.config-option {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    padding: 8px;
    border-radius: 6px;
    transition: all 0.2s;
}

.config-option:hover:not(.disabled) {
    background: rgba(0, 0, 0, 0.03);
}

body.dark-mode .config-option:hover:not(.disabled) {
    background: rgba(255, 255, 255, 0.03);
}

.config-option input[type="checkbox"] {
    display: none;
}

.config-checkbox {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(0, 0, 0, 0.2);
    border-radius: 4px;
    background: var(--card-bg);
    position: relative;
    transition: all 0.2s;
    flex-shrink: 0;
}

body.dark-mode .config-checkbox {
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.config-option input[type="checkbox"]:checked + .config-checkbox {
    background: var(--primary);
    border-color: var(--primary);
}

.config-option input[type="checkbox"]:checked + .config-checkbox::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 12px;
    font-weight: bold;
}

.config-label {
    font-size: 14px;
    color: var(--text-primary);
    user-select: none;
}

.config-actions {
    display: flex;
    gap: 12px;
    padding-top: 20px;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    flex-wrap: wrap;
}

body.dark-mode .config-actions {
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.config-preset-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

body.dark-mode .config-preset-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.config-preset-btn:hover {
    background: rgba(0, 0, 0, 0.08);
    border-color: rgba(0, 0, 0, 0.15);
    color: var(--text-primary);
}

body.dark-mode .config-preset-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.15);
}

.config-preset-btn svg {
    width: 14px;
    height: 14px;
}

/* Config Quick Actions */
.config-quick-actions {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 20px;
    padding: 0 4px;
}

.quick-select-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: 8px;
    color: var(--primary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

body.dark-mode .quick-select-btn {
    background: rgba(59, 130, 246, 0.15);
    border-color: rgba(59, 130, 246, 0.3);
}

.quick-select-btn:hover {
    background: rgba(59, 130, 246, 0.2);
    border-color: var(--primary);
    transform: translateY(-1px);
}

.quick-select-btn:active {
    transform: translateY(0);
}

.quick-select-btn svg {
    width: 14px;
    height: 14px;
}

/* Config Footer */
.config-footer {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

body.dark-mode .config-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.config-info-text {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--text-secondary);
    background: rgba(59, 130, 246, 0.05);
    padding: 10px 14px;
    border-radius: 8px;
    border: 1px solid rgba(59, 130, 246, 0.1);
}

body.dark-mode .config-info-text {
    background: rgba(59, 130, 246, 0.08);
}

.config-info-text svg {
    width: 16px;
    height: 16px;
    color: var(--primary);
    flex-shrink: 0;
}

.config-option.disabled {
    opacity: 0.6;
    pointer-events: none;
}

.config-option.disabled .config-label {
    font-style: italic;
}

/* Responsive adjustments for config */
@media (max-width: 768px) {
    .config-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .config-header {
        padding: 16px 20px;
    }

    .config-content {
        padding: 20px;
    }

    .config-footer {
        margin-top: 16px;
        padding-top: 16px;
    }

    .config-info-text {
        font-size: 11px;
        padding: 8px 12px;
    }
}

/* Enhanced Global Scrollbar Styling */
/* Main page scrollbar */
body::-webkit-scrollbar {
    width: 12px;
}

body::-webkit-scrollbar-track {
    background: var(--surface);
    border-radius: 6px;
}

body::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.6), rgba(139, 92, 246, 0.8));
    border-radius: 6px;
    border: 2px solid var(--surface);
    transition: all 0.3s ease;
}

body::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.8), rgba(139, 92, 246, 1));
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

/* Dark mode scrollbar adjustments */
[data-theme="dark"] body::-webkit-scrollbar-track {
    background: rgba(31, 41, 55, 0.8);
}

[data-theme="dark"] body::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, rgba(96, 165, 250, 0.6), rgba(129, 140, 248, 0.8));
    border: 2px solid rgba(31, 41, 55, 0.8);
}

[data-theme="dark"] body::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, rgba(96, 165, 250, 0.8), rgba(129, 140, 248, 1));
    box-shadow: 0 2px 8px rgba(96, 165, 250, 0.4);
}

/* Results container scrollbar */
.results-container::-webkit-scrollbar,
.tab-content::-webkit-scrollbar {
    width: 10px;
}

.results-container::-webkit-scrollbar-track,
.tab-content::-webkit-scrollbar-track {
    background: var(--surface);
    border-radius: 5px;
}

.results-container::-webkit-scrollbar-thumb,
.tab-content::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.5), rgba(139, 92, 246, 0.7));
    border-radius: 5px;
    transition: all 0.3s ease;
}

.results-container::-webkit-scrollbar-thumb:hover,
.tab-content::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.7), rgba(139, 92, 246, 0.9));
    box-shadow: 0 2px 6px rgba(99, 102, 241, 0.2);
}

/* Progress Actions Styling */
.progress-actions {
    display: flex !important;
    justify-content: center;
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid var(--border);
    visibility: visible !important;
    opacity: 1 !important;
    z-index: 100;
}

/* Danger Button Styling */
.modern-btn.danger {
    background: linear-gradient(135deg, #ef4444, #dc2626) !important;
    color: white !important;
    border: none !important;
    transition: all 0.3s ease;
    display: inline-flex !important;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    min-width: 140px;
    justify-content: center;
}

.modern-btn.danger:hover {
    background: linear-gradient(135deg, #dc2626, #b91c1c);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.4);
}

.modern-btn.danger:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
}

.modern-btn.danger .btn-icon {
    fill: currentColor;
}

/* Dark mode danger button */
[data-theme="dark"] .modern-btn.danger {
    background: linear-gradient(135deg, #f87171, #ef4444);
}

[data-theme="dark"] .modern-btn.danger:hover {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    box-shadow: 0 4px 15px rgba(248, 113, 113, 0.3);
}

/* Inventory Defaults Improvements */
.inventory-spaced {
    gap: 20px !important;
    margin-bottom: 20px;
}

.section-divider {
    position: relative;
}

.section-toggle {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-secondary);
    transition: all 0.2s ease;
}

.section-toggle:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.section-toggle svg {
    width: 16px;
    height: 16px;
    transition: transform 0.2s ease;
}

.section-toggle.collapsed svg {
    transform: rotate(-90deg);
}

.inventory-defaults-content {
    transition: all 0.3s ease;
    overflow: hidden;
}

/* Better input card spacing */
.inventory-spaced .input-card {
    margin-bottom: 16px;
    padding: 20px !important;
    border-radius: 12px !important;
    background: var(--bg-primary);
    border: 1.5px solid var(--border);
    transition: all 0.2s ease;
}

.inventory-spaced .input-card:hover {
    border-color: var(--primary-color);
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.1);
}

.inventory-spaced .input-description {
    margin-top: 8px !important;
    font-size: 13px !important;
    line-height: 1.4 !important;
}

/* Attention-grabbing pulse for unselected intelligence cards */
.intelligence-selector:not(:has(.intelligence-card.selected)) .intelligence-card {
    animation: subtle-pulse 3s ease-in-out infinite;
}

@keyframes subtle-pulse {
    0%, 100% {
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    }
    50% {
        box-shadow: 0 4px 20px rgba(99, 102, 241, 0.15);
        transform: translateY(-1px);
    }
}

/* Stop animation once selected */
.intelligence-card.selected {
    animation: none !important;
}

/* Make status more prominent when nothing selected */
#selectedMode[style*="color: #ef4444"] {
    animation: text-pulse 2s ease-in-out infinite;
}

@keyframes text-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}
/* ===== DEVELOPER MODE DARK MODE FIXES ===== */

/* Developer Mode Placeholder */
.dev-mode-placeholder {
    text-align: center;
    padding: 3rem;
    border: 2px dashed var(--border);
    border-radius: 12px;
    background: var(--surface);
    color: var(--text-secondary);
}

.dev-mode-placeholder h3 {
    margin: 0 0 0.5rem 0;
    color: var(--text-primary);
}

.dev-mode-placeholder p {
    margin: 0;
    font-size: 0.95rem;
    color: var(--text-secondary);
}

.dev-mode-placeholder .dev-mode-hint {
    margin: 0.5rem 0 0;
    font-size: 0.9rem;
    opacity: 0.8;
}

/* Modern Select/Dropdown Dark Mode */
.modern-input,
.select-enhanced,
select {
    background: var(--card-bg);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.modern-input:focus,
.select-enhanced:focus,
select:focus {
    border-color: var(--primary);
    background: var(--surface);
}

/* Image Download Section Dark Mode */
.image-download-section {
    background: var(--card-bg);
    border: 1px solid var(--border);
}

.brand-checkbox-label {
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text-primary);
}

.brand-checkbox-label:hover {
    background: var(--card-bg);
    border-color: var(--primary);
}

/* Mock Data Section */
#mockDataSection {
    background: var(--card-bg);
    color: var(--text-primary);
}

#mockDataSection .card {
    background: var(--card-bg);
    border-color: var(--border);
}

/* Ensure all cards respect dark mode */
.card,
.settings-card,
.feature-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    color: var(--text-primary);
}

/* Table dark mode */
table {
    background: var(--card-bg);
    color: var(--text-primary);
}

table th {
    background: var(--surface);
    color: var(--text-primary);
}

table tr {
    border-bottom: 1px solid var(--border);
}

table tr:hover {
    background: var(--surface);
}

/* Input fields in dark mode */
input[type="text"],
input[type="password"],
input[type="number"],
input[type="url"],
textarea {
    background: var(--card-bg);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

input[type="text"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
input[type="url"]:focus,
textarea:focus {
    background: var(--surface);
    border-color: var(--primary);
}

/* ===== EDIT TABLE MODAL STYLES ===== */

.edit-table-modal .modal-content {
    max-width: 95vw;
    max-height: 90vh;
    width: 95vw;
    overflow: hidden;
}

.edit-modal-content {
    display: flex;
    flex-direction: column;
}

.edit-modal-body {
    flex: 1;
    overflow: hidden;
    padding: 0;
}

.edit-table-scrollable {
    overflow: auto;
    max-height: calc(90vh - 200px);
    padding: 20px;
}

.modal-editable-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--card-bg);
    border-radius: 8px;
    overflow: hidden;
}

.modal-editable-table thead {
    position: sticky;
    top: 0;
    background: var(--primary);
    color: white;
    z-index: 10;
}

.modal-editable-table thead th {
    padding: 12px;
    text-align: left;
    font-weight: 600;
    font-size: 0.9rem;
    white-space: nowrap;
}

.modal-editable-table tbody tr {
    border-bottom: 1px solid var(--border);
    transition: background 0.2s;
}

.modal-editable-table tbody tr:hover {
    background: var(--surface);
}

.modal-editable-table tbody td {
    padding: 10px 12px;
    font-size: 0.9rem;
}

.editable-cell {
    cursor: pointer;
    position: relative;
    transition: all 0.2s;
}

.editable-cell:hover {
    background: rgba(59, 130, 246, 0.1);
}

.editable-cell.editing {
    padding: 0;
    background: rgba(59, 130, 246, 0.2);
}

.modal-cell-input {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid var(--primary);
    background: var(--card-bg);
    color: var(--text-primary);
    font-size: 0.9rem;
    outline: none;
    font-family: inherit;
}

.delete-row-btn {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    color: white;
    padding: 0;
}

.delete-row-btn:hover {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
}

.delete-row-btn:active {
    transform: scale(0.95);
}

.modal-cell-select {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid var(--primary);
    background: var(--card-bg);
    color: var(--text-primary);
    font-size: 0.9rem;
    outline: none;
    cursor: pointer;
    font-family: inherit;
}

/* Mobile responsiveness for edit modal */
@media (max-width: 768px) {
    .edit-table-modal .modal-content {
        max-width: 100vw;
        max-height: 100vh;
        width: 100vw;
        height: 100vh;
        border-radius: 0;
    }

    .edit-table-scrollable {
        max-height: calc(100vh - 180px);
    }

    .modal-editable-table {
        font-size: 0.8rem;
    }

    .modal-editable-table thead th,
    .modal-editable-table tbody td {
        padding: 8px;
        font-size: 0.8rem;
    }
}

/* ===== END EDIT TABLE MODAL STYLES ===== */


/* Button Styles for Brand Detection UI - Dark Mode Support */
.btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: rgba(0, 0, 0, 0.05);
    color: var(--text-primary);
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

body.dark-mode .btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    border-color: rgba(255, 255, 255, 0.1);
}

.btn-secondary:hover {
    background: rgba(0, 0, 0, 0.08);
    border-color: var(--primary);
    transform: translateY(-1px);
}

body.dark-mode .btn-secondary:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--primary);
}

/* ================================================
   KNOWN BRANDS SECTION STYLES
   ================================================ */

/* Brand Manager Info */
/* Brand Add Section - Top */
.brand-add-section-top {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
}

.brand-input-modern {
    flex: 1;
    padding: 14px 18px;
    background: var(--surface);
    border: 2px solid var(--border);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 14px;
    transition: all 0.3s ease;
    font-family: inherit;
}

.brand-input-modern:focus {
    outline: none;
    border-color: #8b5cf6;
    background: var(--card-bg);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

.brand-input-modern::placeholder {
    color: var(--text-secondary);
    opacity: 0.6;
}

.btn-add-brand-modern {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 24px;
    background: linear-gradient(135deg, #8b5cf6 0%, #6366f1 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.btn-add-brand-modern:hover {
    background: linear-gradient(135deg, #7c3aed 0%, #4f46e5 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
}

.btn-add-brand-modern:active {
    transform: translateY(0);
}

.btn-add-brand-modern svg {
    width: 18px;
    height: 18px;
}

/* Brand Chips Container - Modern */
.brand-chips-container-modern {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    min-height: 80px;
    padding: 20px;
    background: var(--surface);
    border: 2px dashed rgba(139, 92, 246, 0.3);
    border-radius: 12px;
    margin-bottom: 20px;
    transition: all 0.3s ease;
}

.brand-chips-container-modern:empty::before {
    content: "No brands added yet. Use the input above to add your first brand.";
    color: var(--text-secondary);
    font-size: 14px;
    opacity: 0.5;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    text-align: center;
}

.brand-chips-container-modern.has-brands {
    border-style: solid;
    border-color: rgba(139, 92, 246, 0.4);
    background: rgba(139, 92, 246, 0.05);
}

/* Individual Brand Chip */
.brand-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px 8px 16px;
    background: linear-gradient(135deg, #8b5cf6 0%, #6366f1 100%);
    color: #ffffff;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 8px rgba(139, 92, 246, 0.3);
    transition: all 0.2s ease;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.brand-chip:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.4);
}

.brand-chip svg {
    width: 16px;
    height: 16px;
    min-width: 16px;
    margin-right: -2px;
}

.brand-chip .brand-delete-btn {
    background: rgba(255, 255, 255, 0.25);
    border: none;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    min-width: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 0;
}

.brand-chip .brand-delete-btn:hover {
    background: rgba(255, 255, 255, 0.4);
    transform: rotate(90deg) scale(1.1);
}

.brand-chip .brand-delete-btn:active {
    transform: rotate(90deg) scale(0.95);
}

.brand-chip .brand-delete-btn svg {
    width: 11px;
    height: 11px;
    stroke: #ffffff;
    stroke-width: 3;
}

/* Locked state for brand chips */
.brand-chip.locked {
    opacity: 0.6;
    cursor: not-allowed;
}

.brand-chip.locked .brand-delete-btn {
    pointer-events: none;
    opacity: 0.5;
}

/* Brand Tip Section - Bottom */
.brand-tip {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    background: rgba(139, 92, 246, 0.06);
    border-left: 3px solid rgba(139, 92, 246, 0.4);
    border-radius: 8px;
}

.brand-tip .tip-icon {
    width: 20px;
    height: 20px;
    min-width: 20px;
    color: #8b5cf6;
    margin-top: 1px;
    opacity: 0.8;
}

.brand-tip p {
    margin: 0;
    font-size: 13px;
    line-height: 1.6;
    color: var(--text-secondary);
}

.brand-tip p strong {
    color: #8b5cf6;
    font-weight: 600;
}

/* Old styles (kept for backwards compatibility) */
.brand-add-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.brand-input-wrapper {
    display: flex;
    gap: 12px;
    align-items: center;
}

.brand-input {
    flex: 1;
    padding: 12px 16px;
    background: var(--surface);
    border: 2px solid var(--border);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 14px;
    transition: all 0.3s ease;
}

.brand-input:focus {
    outline: none;
    border-color: #8b5cf6;
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

.brand-input::placeholder {
    color: var(--text-secondary);
    opacity: 0.6;
}

.brand-input:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: rgba(var(--surface), 0.5);
}

.btn-add-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: linear-gradient(135deg, #8b5cf6 0%, #6366f1 100%);
    color: #ffffff;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(139, 92, 246, 0.3);
}

.btn-add-brand:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.4);
}

.btn-add-brand:active:not(:disabled) {
    transform: translateY(0);
}

.btn-add-brand:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn-add-brand svg {
    width: 18px;
    height: 18px;
}

/* Brand Input Hint */
.brand-input-hint {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-secondary);
    padding: 0 4px;
}

.brand-count {
    font-weight: 600;
    color: #8b5cf6;
}

/* Locked Section State */
#knownBrandsSection.locked {
    opacity: 0.7;
    pointer-events: none;
}

#knownBrandsSection.locked::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 16px;
    pointer-events: none;
}

/* Responsive Design */
@media (max-width: 768px) {
    .brand-add-section-top {
        flex-direction: column;
    }

    .brand-input-modern {
        width: 100%;
    }

    .btn-add-brand-modern {
        width: 100%;
        justify-content: center;
    }

    .brand-chips-container-modern {
        gap: 8px;
        padding: 16px;
        min-height: 60px;
    }

    .brand-chip {
        font-size: 12px;
        padding: 6px 12px 6px 14px;
    }

    .brand-tip {
        padding: 12px 14px;
    }

    .brand-tip p {
        font-size: 12px;
    }

    /* Old styles kept for compatibility */
    .brand-input-wrapper {
        flex-direction: column;
    }

    .brand-input {
        width: 100%;
    }

    .btn-add-brand {
        width: 100%;
        justify-content: center;
    }

    .brand-chips-container {
        gap: 8px;
    }
}

/* ================================================
   IMAGE DOWNLOADER SECTION STYLES
   ================================================ */

/* Select All Container */
.select-all-container-downloader {
    margin-bottom: 1rem;
    padding: 0.75rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.select-all-checkbox {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.select-all-label {
    cursor: pointer;
    font-weight: 600;
    color: var(--text-primary);
    user-select: none;
}

/* Brand Grid */
.brand-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

/* Brand Card */
.brand-card {
    position: relative;
    cursor: pointer;
    border: 2px solid var(--border);
    border-radius: 12px;
    padding: 1.25rem;
    transition: all 0.3s ease;
    background: var(--card-bg);
}

.brand-card:hover {
    border-color: #4CAF50;
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.15);
    transform: translateY(-2px);
}

.brand-card input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

.brand-card input[type="checkbox"]:checked ~ .brand-card-content {
    border-color: #4CAF50;
    background: rgba(76, 175, 80, 0.08);
}

body.dark-mode .brand-card input[type="checkbox"]:checked ~ .brand-card-content {
    background: rgba(76, 175, 80, 0.12);
    border-color: #4CAF50;
}

.brand-card input[type="checkbox"]:checked ~ .brand-card-content .brand-check {
    opacity: 1;
}

.brand-card-content {
    display: flex;
    align-items: center;
    gap: 1rem;
    position: relative;
}

.brand-icon {
    font-size: 2rem;
}

.brand-info {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.brand-name {
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--text-primary);
}

.brand-count {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

.brand-check {
    width: 24px;
    height: 24px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.brand-check svg {
    width: 100%;
    height: 100%;
    stroke: #4CAF50;
}

/* Empty State */
.empty-state-downloader {
    text-align: center;
    padding: 3rem 2rem;
    color: var(--text-secondary);
}

.empty-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.empty-state-downloader h3 {
    margin: 1rem 0 0.5rem;
    color: var(--text-primary);
}

.empty-state-downloader p {
    margin: 0.5rem 0;
    font-size: 0.95rem;
}

.hint-downloader {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-style: italic;
    opacity: 0.7;
}

/* Responsive */
@media (max-width: 768px) {
    .brand-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .brand-card {
        padding: 1rem;
    }
}

/* ============================================================================
   CSV UPLOAD SECTION
   ============================================================================ */

.csv-upload-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.csv-drop-zone {
    background: #f8f9fa;
    border: 2px dashed #ddd;
    border-radius: 12px;
    padding: 3rem 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.csv-drop-zone:hover {
    border-color: #3b82f6;
    background: #f0f7ff;
    box-shadow: 0 6px 12px rgba(59, 130, 246, 0.15);
}

.csv-drop-zone.drag-over {
    border-color: #10b981;
    background: #f0fdf4;
    transform: scale(1.02);
}

[data-theme="dark"] .csv-drop-zone {
    background: #1e293b;
    border-color: #334155;
}

[data-theme="dark"] .csv-drop-zone:hover {
    border-color: #3b82f6;
    background: #1e3a5f;
}

[data-theme="dark"] .csv-drop-zone.drag-over {
    border-color: #10b981;
    background: #1a3a2a;
}

.csv-drop-content {
    pointer-events: none;
}

.csv-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    user-select: none;
}

.csv-drop-text {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.csv-drop-subtext {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.csv-requirements {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-style: italic;
    opacity: 0.8;
}

.csv-upload-progress {
    padding: 1.5rem;
    background: var(--surface);
    border-radius: 8px;
    border: 1px solid var(--border);
}

.csv-upload-error {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid #ef4444;
    border-radius: 8px;
    color: #ef4444;
    font-weight: 500;
}

.csv-upload-error svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

@media (max-width: 768px) {
    .csv-drop-zone {
        padding: 2rem 1rem;
    }

    .csv-icon {
        font-size: 3rem;
    }

    .csv-drop-text {
        font-size: 1.1rem;
    }
}

/* ============================================================================
   SHOPIFY CSV IMPORT STYLES
   ============================================================================ */

.shopify-step {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color, #e2e8f0);
}

.shopify-step:first-child {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
}

.step-header {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--text-primary, #1e293b);
}

.step-description {
    font-size: 13px;
    color: var(--text-secondary, #64748b);
    margin-bottom: 1rem;
}

/* Brand URL List */
.brand-url-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.brand-url-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem;
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 8px;
    background: var(--bg-card, #fff);
}

.brand-url-info {
    min-width: 180px;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.brand-url-name {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-primary, #1e293b);
}

.brand-url-count {
    font-size: 12px;
    color: var(--text-secondary, #64748b);
}

.brand-url-confidence {
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 4px;
    display: inline-block;
    width: fit-content;
    font-weight: 500;
}

.confidence-saved {
    background: rgba(59, 130, 246, 0.15);
    color: #2563eb;
}

.confidence-high {
    background: rgba(16, 185, 129, 0.15);
    color: #059669;
}

.confidence-medium {
    background: rgba(245, 158, 11, 0.15);
    color: #d97706;
}

.confidence-low {
    background: rgba(239, 68, 68, 0.15);
    color: #dc2626;
}

.brand-url-input {
    flex: 1;
}

/* Shopify Results */
.shopify-results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1rem;
}

.shopify-result-card {
    padding: 1rem;
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 8px;
    background: var(--bg-card, #fff);
}

.shopify-result-card h4 {
    margin: 0 0 0.75rem 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary, #1e293b);
}

.result-stats-mini {
    display: flex;
    gap: 0.75rem;
}

.stat-mini {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
}

.stat-mini .stat-num {
    font-size: 18px;
    font-weight: 700;
    color: var(--primary, #3b82f6);
}

.stat-mini .stat-label {
    font-size: 11px;
    color: var(--text-secondary, #64748b);
    text-align: center;
}

@media (max-width: 768px) {
    .brand-url-row {
        flex-direction: column;
        align-items: stretch;
    }

    .brand-url-info {
        min-width: unset;
    }

    .shopify-results-grid {
        grid-template-columns: 1fr;
    }
}
