/* ========================================================================
   Google Maps Business Scraper — Premium Dark Glassmorphism Design System
   ======================================================================== */

/* ---------- Google Fonts ---------- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500&display=swap');

/* ---------- CSS Custom Properties ---------- */
:root {
    /* Color Palette */
    --bg-primary: #0a0e1a;
    --bg-secondary: #111827;
    --bg-tertiary: #1a2035;
    --bg-glass: rgba(17, 24, 39, 0.75);
    --bg-glass-hover: rgba(26, 32, 53, 0.85);
    --bg-glass-active: rgba(30, 38, 62, 0.9);

    --surface-1: #1e2640;
    --surface-2: #252d45;
    --surface-3: #2d3756;

    --border-subtle: rgba(255, 255, 255, 0.06);
    --border-medium: rgba(255, 255, 255, 0.1);
    --border-bright: rgba(255, 255, 255, 0.15);
    --border-accent: rgba(99, 102, 241, 0.4);

    /* Accent Colors */
    --accent-primary: #6366f1;
    --accent-primary-light: #818cf8;
    --accent-primary-dark: #4f46e5;
    --accent-secondary: #06b6d4;
    --accent-secondary-light: #22d3ee;
    --accent-success: #10b981;
    --accent-success-light: #34d399;
    --accent-warning: #f59e0b;
    --accent-danger: #ef4444;
    --accent-danger-light: #f87171;

    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #6366f1, #8b5cf6, #06b6d4);
    --gradient-accent: linear-gradient(135deg, #6366f1, #818cf8);
    --gradient-success: linear-gradient(135deg, #10b981, #06b6d4);
    --gradient-danger: linear-gradient(135deg, #ef4444, #f97316);
    --gradient-surface: linear-gradient(180deg, rgba(99, 102, 241, 0.05), transparent);
    --gradient-glow: radial-gradient(600px circle at var(--mouse-x, 50%) var(--mouse-y, 50%), rgba(99, 102, 241, 0.06), transparent 40%);

    /* Text Colors */
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-tertiary: #64748b;
    --text-accent: #818cf8;
    --text-on-accent: #ffffff;

    /* Typography */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

    /* Spacing */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 12px;
    --space-lg: 16px;
    --space-xl: 24px;
    --space-2xl: 32px;
    --space-3xl: 48px;

    /* Border Radius */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 20px;
    --radius-full: 9999px;

    /* Shadows */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.5);
    --shadow-xl: 0 16px 50px rgba(0, 0, 0, 0.6);
    --shadow-glow: 0 0 30px rgba(99, 102, 241, 0.15);
    --shadow-glow-strong: 0 0 50px rgba(99, 102, 241, 0.25);

    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 400ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-spring: 500ms cubic-bezier(0.34, 1.56, 0.64, 1);

    /* Layout */
    --header-height: 64px;
    --sidebar-width: 340px;
    --status-bar-height: 44px;
}

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

html {
    font-size: 14px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-sans);
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow: hidden;
    position: relative;
}

/* Animated background mesh */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background: 
        radial-gradient(ellipse 80% 50% at 20% 10%, rgba(99, 102, 241, 0.08), transparent),
        radial-gradient(ellipse 60% 40% at 80% 80%, rgba(6, 182, 212, 0.06), transparent),
        radial-gradient(ellipse 40% 60% at 50% 50%, rgba(139, 92, 246, 0.04), transparent);
    pointer-events: none;
    z-index: 0;
}

a {
    color: var(--accent-primary-light);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--accent-secondary-light);
}

/* ---------- Scrollbar ---------- */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--surface-3);
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-primary);
}

/* ---------- Layout ---------- */
.app-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    position: relative;
    z-index: 1;
}

/* ---------- Header ---------- */
.app-header {
    height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--space-xl);
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-subtle);
    z-index: 100;
    flex-shrink: 0;
}

.header-brand {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.header-logo {
    width: 36px;
    height: 36px;
    background: var(--gradient-primary);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    box-shadow: var(--shadow-glow);
}

.header-title {
    font-size: 1.25rem;
    font-weight: 700;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.02em;
}

.header-subtitle {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    font-weight: 400;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

/* ---------- Main Layout ---------- */
.app-main {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* ---------- Sidebar (Search Panel) ---------- */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-right: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    flex-shrink: 0;
    transition: width var(--transition-base);
}

.sidebar-section {
    padding: var(--space-xl);
    border-bottom: 1px solid var(--border-subtle);
}

.sidebar-section:last-child {
    border-bottom: none;
}

.section-title {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: var(--space-lg);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.section-title svg {
    width: 14px;
    height: 14px;
    opacity: 0.6;
}

/* ---------- Form Elements ---------- */
.form-group {
    margin-bottom: var(--space-lg);
}

.form-group:last-child {
    margin-bottom: 0;
}

.form-label {
    display: block;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: var(--space-sm);
}

.form-input,
.form-textarea,
.form-select {
    width: 100%;
    padding: var(--space-md) var(--space-lg);
    background: var(--surface-1);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 0.85rem;
    transition: all var(--transition-fast);
    outline: none;
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15), var(--shadow-sm);
    background: var(--surface-2);
}

.form-input::placeholder,
.form-textarea::placeholder {
    color: var(--text-tertiary);
}

.form-textarea {
    resize: vertical;
    min-height: 100px;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    line-height: 1.6;
}

.form-select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%2394a3b8' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

.form-select option {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

/* Range Slider */
.range-container {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.form-range {
    flex: 1;
    -webkit-appearance: none;
    appearance: none;
    height: 4px;
    background: var(--surface-3);
    border-radius: var(--radius-full);
    outline: none;
    cursor: pointer;
}

.form-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    background: var(--gradient-accent);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: var(--shadow-glow);
    transition: transform var(--transition-fast);
}

.form-range::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

.range-value {
    min-width: 36px;
    padding: var(--space-xs) var(--space-sm);
    background: var(--surface-1);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-sm);
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--accent-primary-light);
    text-align: center;
    font-weight: 600;
}

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: var(--space-md) var(--space-xl);
    border: none;
    border-radius: var(--radius-md);
    font-family: var(--font-sans);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    outline: none;
    position: relative;
    overflow: hidden;
    white-space: nowrap;
}

.btn::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(255,255,255,0.1), transparent);
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.btn:hover::after {
    opacity: 1;
}

.btn:active {
    transform: scale(0.97);
}

.btn-primary {
    background: var(--gradient-accent);
    color: var(--text-on-accent);
    box-shadow: var(--shadow-glow);
}

.btn-primary:hover {
    box-shadow: var(--shadow-glow-strong);
    transform: translateY(-1px);
}

.btn-primary:active {
    transform: translateY(0) scale(0.97);
}

.btn-success {
    background: var(--gradient-success);
    color: var(--text-on-accent);
}

.btn-danger {
    background: var(--gradient-danger);
    color: var(--text-on-accent);
}

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

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

.btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: var(--radius-md);
}

.btn-lg {
    width: 100%;
    padding: var(--space-lg) var(--space-xl);
    font-size: 0.9rem;
    border-radius: var(--radius-lg);
}

.btn-sm {
    padding: var(--space-sm) var(--space-md);
    font-size: 0.75rem;
    border-radius: var(--radius-sm);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

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

/* ---------- Content Area ---------- */
.content-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
}

/* Tabs */
.content-tabs {
    display: flex;
    align-items: center;
    gap: 0;
    padding: 0 var(--space-xl);
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-subtle);
    height: 44px;
    flex-shrink: 0;
}

.content-tab {
    padding: var(--space-md) var(--space-xl);
    color: var(--text-tertiary);
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all var(--transition-fast);
    height: 100%;
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    user-select: none;
}

.content-tab:hover {
    color: var(--text-secondary);
    background: rgba(255,255,255,0.02);
}

.content-tab.active {
    color: var(--accent-primary-light);
    border-bottom-color: var(--accent-primary);
}

.content-tab .tab-count {
    padding: 2px 8px;
    background: var(--surface-2);
    border-radius: var(--radius-full);
    font-size: 0.7rem;
    font-family: var(--font-mono);
    color: var(--text-tertiary);
}

.content-tab.active .tab-count {
    background: rgba(99, 102, 241, 0.2);
    color: var(--accent-primary-light);
}

.tab-actions {
    margin-left: auto;
    display: flex;
    gap: var(--space-sm);
}

/* Tab Panels */
.tab-panel {
    display: none;
    flex: 1;
    overflow: hidden;
}

.tab-panel.active {
    display: flex;
    flex-direction: column;
}

/* ---------- Results Table ---------- */
.table-container {
    flex: 1;
    overflow: auto;
    padding: var(--space-lg);
}

.results-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.82rem;
}

.results-table thead {
    position: sticky;
    top: 0;
    z-index: 10;
}

.results-table th {
    padding: var(--space-md) var(--space-lg);
    background: var(--surface-1);
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    text-align: left;
    white-space: nowrap;
    border-bottom: 1px solid var(--border-medium);
    user-select: none;
}

.results-table th:first-child {
    border-radius: var(--radius-sm) 0 0 0;
}

.results-table th:last-child {
    border-radius: 0 var(--radius-sm) 0 0;
}

.results-table td {
    padding: var(--space-md) var(--space-lg);
    border-bottom: 1px solid var(--border-subtle);
    color: var(--text-primary);
    vertical-align: middle;
    transition: background var(--transition-fast);
}

.results-table tbody tr {
    transition: all var(--transition-fast);
}

.results-table tbody tr:hover {
    background: var(--bg-glass-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.results-table tbody tr:hover td {
    border-bottom-color: transparent;
}

.results-table tbody tr.highlighted {
    background: rgba(99, 102, 241, 0.08);
    box-shadow: inset 3px 0 0 var(--accent-primary);
}

/* Table cell types */
.cell-image {
    width: 50px;
}

.cell-image img {
    width: 42px;
    height: 42px;
    object-fit: cover;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-subtle);
    background: var(--surface-2);
}

.cell-image .no-image {
    width: 42px;
    height: 42px;
    background: var(--surface-2);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-tertiary);
    font-size: 16px;
    border: 1px solid var(--border-subtle);
}

.cell-name {
    font-weight: 600;
    color: var(--text-primary);
    max-width: 200px;
}

.cell-name a {
    color: var(--text-primary);
}

.cell-name a:hover {
    color: var(--accent-primary-light);
}

.cell-phone {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    color: var(--accent-secondary-light);
    white-space: nowrap;
}

.cell-address {
    color: var(--text-secondary);
    max-width: 250px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cell-pluscode {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-tertiary);
}

.cell-rating {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    white-space: nowrap;
}

.cell-rating .stars {
    color: var(--accent-warning);
    font-size: 0.85rem;
}

.cell-rating .rating-value {
    font-weight: 600;
    color: var(--text-primary);
}

.cell-rating .review-count {
    color: var(--text-tertiary);
    font-size: 0.72rem;
}

.cell-status {
    display: inline-flex;
    padding: 2px 10px;
    border-radius: var(--radius-full);
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.status-open {
    background: rgba(16, 185, 129, 0.15);
    color: var(--accent-success-light);
}

.status-closed {
    background: rgba(239, 68, 68, 0.15);
    color: var(--accent-danger-light);
}

.status-unknown {
    background: rgba(148, 163, 184, 0.1);
    color: var(--text-tertiary);
}

/* Checkbox */
.custom-checkbox {
    width: 16px;
    height: 16px;
    appearance: none;
    background: var(--surface-1);
    border: 1.5px solid var(--border-bright);
    border-radius: 4px;
    cursor: pointer;
    transition: all var(--transition-fast);
    position: relative;
}

.custom-checkbox:hover {
    border-color: var(--accent-primary-light);
    transform: scale(1.1);
}

.custom-checkbox:checked {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    transform: scale(1.05);
}

.custom-checkbox:checked::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 11px;
    color: white;
    font-weight: 700;
}

/* ---------- Map Panel ---------- */
.map-container {
    flex: 1;
    position: relative;
}

#googleMap {
    width: 100%;
    height: 100%;
    border-radius: 0;
}

.map-overlay {
    position: absolute;
    top: var(--space-lg);
    right: var(--space-lg);
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    z-index: 10;
}

/* Map Drawing Toolbar */
.map-toolbar {
    position: absolute;
    top: var(--space-lg);
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    background: var(--bg-glass);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    z-index: 10;
}

.map-tool-btn {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    font-size: 0.78rem;
}

.map-tool-btn.active-tool {
    background: rgba(99, 102, 241, 0.2);
    border-color: var(--accent-primary);
    color: var(--accent-primary-light);
}

.polygon-filter-badge {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    padding: 4px 12px;
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: var(--radius-full);
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--accent-success-light);
    animation: fade-in 0.3s ease-out;
}

.filter-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent-success);
    animation: pulse-dot 2s ease-in-out infinite;
}

/* ---------- Status Bar ---------- */
.status-bar {
    height: var(--status-bar-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--space-xl);
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    border-top: 1px solid var(--border-subtle);
    font-size: 0.72rem;
    color: var(--text-tertiary);
    flex-shrink: 0;
    z-index: 100;
}

.status-bar-left,
.status-bar-right {
    display: flex;
    align-items: center;
    gap: var(--space-xl);
}

.status-item {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
}

.status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent-success);
    animation: pulse-dot 2s ease-in-out infinite;
}

.status-dot.idle {
    background: var(--text-tertiary);
    animation: none;
}

.status-dot.error {
    background: var(--accent-danger);
    animation: none;
}

/* ---------- Progress Bar ---------- */
.progress-container {
    display: none;
    padding: var(--space-lg) var(--space-xl);
    border-bottom: 1px solid var(--border-subtle);
    background: var(--bg-glass);
}

.progress-container.active {
    display: block;
}

.progress-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-sm);
    font-size: 0.78rem;
}

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

.progress-value {
    color: var(--accent-primary-light);
    font-family: var(--font-mono);
    font-weight: 600;
}

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

.progress-fill {
    height: 100%;
    background: var(--gradient-primary);
    border-radius: var(--radius-full);
    transition: width var(--transition-base);
    position: relative;
}

.progress-fill::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: progress-shimmer 1.5s ease-in-out infinite;
}

/* ---------- Modal ---------- */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-base);
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal {
    background: var(--bg-secondary);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    width: 90%;
    max-width: 500px;
    transform: scale(0.9) translateY(20px);
    transition: transform var(--transition-spring);
    overflow: hidden;
}

.modal-overlay.active .modal {
    transform: scale(1) translateY(0);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-xl);
    border-bottom: 1px solid var(--border-subtle);
}

.modal-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
}

.modal-body {
    padding: var(--space-xl);
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: var(--space-sm);
    padding: var(--space-lg) var(--space-xl);
    border-top: 1px solid var(--border-subtle);
    background: rgba(0,0,0,0.1);
}

/* ---------- Empty State ---------- */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: var(--space-3xl);
    text-align: center;
}

.empty-state-icon {
    font-size: 64px;
    margin-bottom: var(--space-xl);
    opacity: 0.3;
}

.empty-state-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: var(--space-sm);
}

.empty-state-desc {
    color: var(--text-tertiary);
    font-size: 0.85rem;
    max-width: 360px;
    line-height: 1.6;
}

/* ---------- Toast Notifications ---------- */
.toast-container {
    position: fixed;
    top: calc(var(--header-height) + var(--space-lg));
    right: var(--space-xl);
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    z-index: 2000;
}

.toast {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md) var(--space-xl);
    background: var(--bg-secondary);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    font-size: 0.82rem;
    color: var(--text-primary);
    animation: toast-in 0.4s var(--transition-spring) forwards;
    min-width: 280px;
    max-width: 420px;
}

.toast.toast-out {
    animation: toast-out 0.3s ease-in forwards;
}

.toast-icon {
    font-size: 16px;
    flex-shrink: 0;
}

.toast-success {
    border-left: 3px solid var(--accent-success);
}

.toast-error {
    border-left: 3px solid var(--accent-danger);
}

.toast-info {
    border-left: 3px solid var(--accent-primary);
}

/* ---------- Keyword Tags ---------- */
.keyword-list {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-xs);
    margin-top: var(--space-sm);
}

.keyword-tag {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    padding: 2px 10px;
    background: rgba(99, 102, 241, 0.12);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: var(--radius-full);
    font-size: 0.72rem;
    color: var(--accent-primary-light);
    font-weight: 500;
}

.keyword-tag.done {
    background: rgba(16, 185, 129, 0.12);
    border-color: rgba(16, 185, 129, 0.2);
    color: var(--accent-success-light);
}

.keyword-tag.active {
    background: rgba(99, 102, 241, 0.25);
    border-color: var(--accent-primary);
    animation: pulse 1.5s ease-in-out infinite;
}

.keyword-tag.error {
    background: rgba(239, 68, 68, 0.12);
    border-color: rgba(239, 68, 68, 0.2);
    color: var(--accent-danger-light);
}

/* ---------- Animations ---------- */
@keyframes spin {
    to { transform: rotate(360deg); }
}

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

@keyframes pulse-dot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.8); }
}

@keyframes toast-in {
    from { opacity: 0; transform: translateX(100px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes toast-out {
    from { opacity: 1; transform: translateX(0); }
    to { opacity: 0; transform: translateX(100px); }
}

@keyframes progress-shimmer {
    from { transform: translateX(-100%); }
    to { transform: translateX(200%); }
}

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

.fade-in {
    animation: fade-in 0.4s ease-out forwards;
}

/* ---------- Responsive ---------- */
@media (max-width: 1200px) {
    :root {
        --sidebar-width: 300px;
    }
}

@media (max-width: 900px) {
    .sidebar {
        width: 100%;
        max-height: 40vh;
        border-right: none;
        border-bottom: 1px solid var(--border-subtle);
    }

    .app-main {
        flex-direction: column;
    }
}

/* ---------- Utility ---------- */
.hidden { display: none !important; }
.text-accent { color: var(--accent-primary-light); }
.text-success { color: var(--accent-success-light); }
.text-danger { color: var(--accent-danger-light); }
.text-muted { color: var(--text-tertiary); }
.font-mono { font-family: var(--font-mono); }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
