/* Weedistillery 90-Day SEO Dashboard - Enhanced with Light/Dark Mode */

:root {
    /* Dark mode (default) */
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --secondary: #10b981;
    --accent: #f59e0b;
    --danger: #ef4444;
    --warning: #fbbf24;
    --success: #10b981;
    --info: #3b82f6;

    --bg-primary: #0a0e27;
    --bg-secondary: #0f1428;
    --bg-tertiary: #1a1f3a;
    --bg-card: #1a1f3a;
    --bg-card-hover: #252b48;
    --bg-overlay: rgba(255, 255, 255, 0.05);

    --text-primary: #f9fafb;
    --text-secondary: #d1d5db;
    --text-tertiary: #9ca3af;
    --text-muted: #6b7280;

    --border: #2a2f4a;
    --border-light: #374151;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 20px rgba(99, 102, 241, 0.3);

    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 20px;

    --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

/* LIGHT MODE */
[data-theme="light"] {
    --bg-primary: #f9fafb;
    --bg-secondary: #f3f4f6;
    --bg-tertiary: #ffffff;
    --bg-card: #ffffff;
    --bg-card-hover: #f9fafb;
    --bg-overlay: rgba(0, 0, 0, 0.02);

    --text-primary: #111827;
    --text-secondary: #4b5563;
    --text-tertiary: #6b7280;
    --text-muted: #9ca3af;

    --border: #e5e7eb;
    --border-light: #d1d5db;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.1);
    --shadow-glow: 0 0 20px rgba(99, 102, 241, 0.15);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 50%, var(--bg-primary) 100%);
    background-attachment: fixed;
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
    transition: background 0.3s ease, color 0.3s ease;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 24px;
}

/* ===== HEADER ===== */
.dashboard-header {
    background: var(--gradient-primary);
    border-radius: var(--radius-xl);
    padding: 40px;
    margin-bottom: 32px;
    box-shadow: var(--shadow-lg), var(--shadow-glow);
    position: relative;
    overflow: hidden;
}

.dashboard-header::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    position: relative;
    z-index: 1;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 16px;
}

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

.theme-toggle,
.export-btn {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 10px 16px;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 600;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.theme-toggle:hover,
.export-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.theme-toggle {
    width: 44px;
    height: 44px;
    padding: 0;
    justify-content: center;
}

.theme-toggle i {
    font-size: 1.1rem;
}

/* Export Dropdown */
.export-menu {
    position: relative;
}

.export-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    min-width: 200px;
    box-shadow: var(--shadow-lg);
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s;
}

.export-dropdown.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.export-dropdown a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    color: var(--text-primary);
    text-decoration: none;
    transition: background 0.2s;
    border-bottom: 1px solid var(--border);
}

.export-dropdown a:last-child {
    border-bottom: none;
}

.export-dropdown a:hover {
    background: var(--bg-card-hover);
}

.export-dropdown a i {
    color: var(--primary);
}

.header-content h1 {
    font-size: 2.8rem;
    font-weight: 800;
    margin-bottom: 8px;
    color: white;
    letter-spacing: -0.5px;
    text-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.subtitle {
    font-size: 1.15rem;
    color: rgba(255, 255, 255, 0.95);
    margin-bottom: 24px;
    font-weight: 400;
}

.status-bar {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    position: relative;
    z-index: 1;
}

.badge {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: white;
    padding: 8px 18px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    border: 1px solid rgba(255, 255, 255, 0.3);
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.badge:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

.badge i {
    font-size: 0.85rem;
}

/* ===== PROGRESS BAR ===== */
.progress-section {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 32px;
    border: 1px solid var(--border);
    transition: all 0.3s;
}

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

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

.progress-title i {
    color: var(--primary);
}

.progress-percentage {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--primary-light);
}

.progress-bar {
    width: 100%;
    height: 12px;
    background: var(--bg-secondary);
    border-radius: 6px;
    overflow: hidden;
    position: relative;
    margin-bottom: 12px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 50%, #f59e0b 100%);
    border-radius: 6px;
    transition: width 1s ease;
    position: relative;
    overflow: hidden;
}

.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: shimmer 2s infinite;
}

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

.progress-milestones {
    display: flex;
    justify-content: space-between;
    margin-top: 12px;
}

.milestone {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 600;
    position: relative;
}

.milestone::before {
    content: '';
    position: absolute;
    top: -16px;
    left: 50%;
    transform: translateX(-50%);
    width: 8px;
    height: 8px;
    background: var(--bg-secondary);
    border: 2px solid var(--border);
    border-radius: 50%;
}

.milestone.active::before {
    background: var(--accent);
    border-color: var(--accent);
    box-shadow: 0 0 8px var(--accent);
}

.milestone.active {
    color: var(--accent);
}

/* ===== KPI CARDS ===== */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

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

.kpi-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--primary-light));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s;
}

.kpi-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary);
}

.kpi-card:hover::before {
    transform: scaleX(1);
}

.kpi-icon {
    font-size: 1.5rem;
    margin-bottom: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary);
    border-radius: var(--radius-md);
    transition: transform 0.3s;
}

[data-theme="light"] .kpi-icon {
    background: rgba(99, 102, 241, 0.08);
}

.kpi-card:hover .kpi-icon {
    transform: scale(1.1) rotate(-5deg);
}

.kpi-label {
    color: var(--text-tertiary);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
    margin-bottom: 10px;
}

.kpi-value {
    font-size: 1.9rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 10px;
    line-height: 1.2;
}

.kpi-value .current {
    color: var(--primary-light);
}

.kpi-value .target {
    color: var(--text-muted);
    font-weight: 500;
    font-size: 1.4rem;
}

.kpi-trend {
    font-size: 0.85rem;
    color: var(--success);
    display: flex;
    align-items: center;
    gap: 4px;
}

.kpi-trend::before {
    content: '↗';
    font-weight: bold;
}

/* Sparklines */
.kpi-spark {
    margin-top: 12px;
    height: 30px;
    width: 100%;
}

/* ===== SECTIONS ===== */
.dashboard-section {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 32px;
    margin-bottom: 32px;
    border: 1px solid var(--border);
    transition: all 0.3s;
}

.dashboard-section:hover {
    border-color: var(--border-light);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 2px solid var(--border);
    flex-wrap: wrap;
    gap: 12px;
}

.dashboard-section h2 {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 12px;
}

.dashboard-section h2 i {
    color: var(--primary);
}

.section-count {
    background: var(--bg-secondary);
    color: var(--text-tertiary);
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
}

/* ===== CHARTS ===== */
.chart-controls {
    display: flex;
    gap: 8px;
}

.chart-btn {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    padding: 6px 16px;
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.chart-btn:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
}

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

.charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 24px;
}

.chart-container {
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    padding: 20px;
    border: 1px solid var(--border);
}

.chart-container.chart-wide {
    grid-column: 1 / -1;
}

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

.chart-container canvas {
    max-height: 300px;
}

/* ===== TASKS ===== */
.tasks-container {
    display: grid;
    gap: 12px;
}

.task-item {
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    padding: 18px;
    border-left: 4px solid var(--primary);
    display: flex;
    align-items: center;
    gap: 16px;
    transition: all 0.2s;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
}

.task-item:hover {
    background: var(--bg-card-hover);
    transform: translateX(4px);
}

.task-item.completed {
    border-left-color: var(--success);
    opacity: 0.6;
}

.task-checkbox {
    width: 24px;
    height: 24px;
    border: 2px solid var(--border-light);
    border-radius: 6px;
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-card);
}

.task-checkbox:hover {
    border-color: var(--primary);
}

.task-checkbox.checked {
    background: var(--success);
    border-color: var(--success);
    color: white;
}

.task-checkbox.checked::after {
    content: '✓';
    font-weight: bold;
    font-size: 14px;
}

.task-text {
    flex: 1;
}

.task-title {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
    font-size: 1rem;
}

.task-meta {
    font-size: 0.85rem;
    color: var(--text-tertiary);
}

.task-badge {
    padding: 6px 12px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.task-badge.priority-high {
    background: rgba(239, 68, 68, 0.15);
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

[data-theme="light"] .task-badge.priority-high {
    background: #fee2e2;
    color: #b91c1c;
    border-color: #fecaca;
}

.task-badge.priority-medium {
    background: rgba(245, 158, 11, 0.15);
    color: #fcd34d;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

[data-theme="light"] .task-badge.priority-medium {
    background: #fef3c7;
    color: #b45309;
    border-color: #fed7aa;
}

.task-badge.priority-low {
    background: rgba(16, 185, 129, 0.15);
    color: #6ee7b7;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

[data-theme="light"] .task-badge.priority-low {
    background: #d1fae5;
    color: #047857;
    border-color: #a7f3d0;
}

/* ===== BUTTONS ===== */
.reset-tasks-btn,
.filter-btn {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    padding: 6px 14px;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.reset-tasks-btn:hover,
.filter-btn:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
}

.search-input {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    min-width: 220px;
}

.search-input::placeholder {
    color: var(--text-muted);
}

.search-input:focus {
    outline: none;
    border-color: var(--primary);
}

/* ===== TABLE ===== */
.table-container {
    overflow-x: auto;
    border-radius: var(--radius-md);
    background: var(--bg-secondary);
    border: 1px solid var(--border);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.data-table thead {
    background: var(--bg-tertiary);
}

.data-table th {
    padding: 16px;
    text-align: left;
    font-weight: 700;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-tertiary);
    border-bottom: 2px solid var(--border);
    white-space: nowrap;
}

.data-table td {
    padding: 16px;
    border-top: 1px solid var(--border);
    color: var(--text-secondary);
    transition: background 0.2s;
}

.data-table tbody tr {
    transition: background 0.2s;
}

.data-table tbody tr:hover {
    background: var(--bg-overlay);
}

.data-table tbody tr:hover td {
    color: var(--text-primary);
}

.data-table code {
    font-family: 'Monaco', 'Menlo', monospace;
    font-size: 0.85rem;
    color: var(--primary-light);
    background: var(--bg-tertiary);
    padding: 4px 8px;
    border-radius: 4px;
    display: inline-block;
    max-width: 280px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: middle;
}

.data-table .keyword {
    color: var(--text-primary);
    font-weight: 500;
}

.data-table .volume {
    color: var(--accent);
    font-weight: 600;
}

.data-table .qa-score {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 0.85rem;
}

.qa-score.high {
    background: rgba(16, 185, 129, 0.15);
    color: #6ee7b7;
}

[data-theme="light"] .qa-score.high {
    background: #d1fae5;
    color: #047857;
}

.qa-score.medium {
    background: rgba(245, 158, 11, 0.15);
    color: #fcd34d;
}

[data-theme="light"] .qa-score.medium {
    background: #fef3c7;
    color: #b45309;
}

.action-icon {
    color: var(--primary);
    cursor: pointer;
    font-size: 1.1rem;
    transition: all 0.2s;
}

.action-icon:hover {
    color: var(--primary-light);
    transform: scale(1.2);
}

/* ===== STATUS BADGES ===== */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 14px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-badge::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

.status-ready {
    background: rgba(251, 191, 36, 0.15);
    color: #fcd34d;
    border: 1px solid rgba(251, 191, 36, 0.3);
}

[data-theme="light"] .status-ready {
    background: #fef3c7;
    color: #b45309;
    border-color: #fed7aa;
}

.status-published {
    background: rgba(16, 185, 129, 0.15);
    color: #6ee7b7;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

[data-theme="light"] .status-published {
    background: #d1fae5;
    color: #047857;
    border-color: #a7f3d0;
}

.status-indexed {
    background: rgba(59, 130, 246, 0.15);
    color: #93c5fd;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

[data-theme="light"] .status-indexed {
    background: #dbeafe;
    color: #1e40af;
    border-color: #bfdbfe;
}

.status-ranking {
    background: rgba(139, 92, 246, 0.15);
    color: #c4b5fd;
    border: 1px solid rgba(139, 92, 246, 0.3);
}

[data-theme="light"] .status-ranking {
    background: #ede9fe;
    color: #5b21b6;
    border-color: #ddd6fe;
}

/* ===== CITATIONS ===== */
.citations-layout {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 24px;
}

.citation-summary {
    display: grid;
    gap: 16px;
}

.summary-card {
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    padding: 24px;
    text-align: center;
    border: 1px solid var(--border);
    transition: transform 0.2s;
}

.summary-card:hover {
    transform: translateY(-2px);
}

.summary-label {
    color: var(--text-tertiary);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.summary-value {
    font-size: 2rem;
    font-weight: 800;
    color: var(--primary-light);
    line-height: 1;
}

/* Citation Progress */
.citation-progress {
    margin-top: 8px;
}

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

.citation-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    width: 0%;
    transition: width 0.5s;
}

.citation-progress-text {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 600;
}

.citations-list {
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    padding: 24px;
}

.citations-list h3 {
    color: var(--text-primary);
    margin-bottom: 20px;
    font-size: 1.1rem;
}

.citation-tier {
    margin-bottom: 20px;
}

.citation-tier h4 {
    color: var(--text-tertiary);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}

.citation-tier ul {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 8px;
}

.citation-tier li {
    padding: 12px 16px;
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    border-left: 3px solid var(--primary);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
    color: var(--text-secondary);
    transition: all 0.2s;
    cursor: pointer;
}

.citation-tier li:hover {
    background: var(--bg-card-hover);
    border-left-color: var(--accent);
    transform: translateX(3px);
}

.da-badge {
    background: var(--primary);
    color: white;
    padding: 3px 10px;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 700;
}

.da-badge.high {
    background: var(--success);
}

.da-badge.medium {
    background: var(--info);
}

.da-badge.low {
    background: var(--text-tertiary);
}

/* ===== KEYWORDS ===== */
.keywords-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
}

.keyword-card {
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    padding: 20px;
    border: 1px solid var(--border);
    transition: all 0.2s;
    position: relative;
    overflow: hidden;
}

.keyword-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--primary);
    transform: scaleY(0);
    transition: transform 0.2s;
}

.keyword-card:hover {
    background: var(--bg-card-hover);
    transform: translateY(-3px);
    border-color: var(--primary);
}

.keyword-card:hover::before {
    transform: scaleY(1);
}

.keyword-text {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 10px;
    font-size: 0.95rem;
    line-height: 1.4;
}

.keyword-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    color: var(--text-tertiary);
}

.keyword-volume {
    color: var(--accent);
    font-weight: 600;
}

.position-badge {
    padding: 4px 10px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.75rem;
}

.position-not-tracked {
    background: rgba(107, 114, 128, 0.2);
    color: #9ca3af;
}

[data-theme="light"] .position-not-tracked {
    background: #e5e7eb;
    color: #6b7280;
}

.position-tracking {
    background: rgba(251, 191, 36, 0.15);
    color: #fcd34d;
    border: 1px solid rgba(251, 191, 36, 0.3);
}

[data-theme="light"] .position-tracking {
    background: #fef3c7;
    color: #b45309;
    border-color: #fed7aa;
}

/* ===== WEEK ROADMAP ===== */
.week-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
}

.week-card {
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    padding: 24px;
    border: 2px solid var(--border);
    transition: all 0.3s;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.week-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--border);
    transition: background 0.3s;
}

.week-card:hover {
    transform: translateY(-4px);
    background: var(--bg-card-hover);
    border-color: var(--primary);
}

.week-card.current {
    border-color: var(--accent);
    background: linear-gradient(135deg, var(--bg-card) 0%, rgba(251, 191, 36, 0.05) 100%);
    box-shadow: 0 0 20px rgba(251, 191, 36, 0.2);
}

[data-theme="light"] .week-card.current {
    background: linear-gradient(135deg, #ffffff 0%, #fef3c7 100%);
}

.week-card.current::after {
    background: var(--accent);
}

.week-card.completed {
    border-color: var(--success);
    opacity: 0.85;
}

.week-card.completed::after {
    background: var(--success);
}

.week-number {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary-light);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.week-card.current .week-number {
    color: var(--accent);
}

.week-card.completed .week-number {
    color: var(--success);
}

.week-card.completed .week-number::after {
    content: '✓';
    font-size: 1.2rem;
}

.week-title {
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
    font-size: 1rem;
}

.week-pages {
    font-size: 0.85rem;
    color: var(--text-tertiary);
    margin-bottom: 12px;
}

.week-status {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-current {
    background: var(--accent);
    color: var(--bg-primary);
}

.status-pending {
    background: rgba(107, 114, 128, 0.2);
    color: var(--text-tertiary);
}

[data-theme="light"] .status-pending {
    background: #e5e7eb;
    color: #6b7280;
}

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

/* ===== BACKLINKS ===== */
.backlink-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.backlink-stats {
    display: grid;
    gap: 16px;
}

.stat-box {
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    padding: 24px;
    text-align: center;
    border: 1px solid var(--border);
    transition: transform 0.2s;
}

.stat-box:hover {
    transform: translateY(-3px);
    border-color: var(--primary);
}

.stat-label {
    color: var(--text-tertiary);
    font-size: 0.85rem;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.stat-value {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.stat-change {
    font-size: 0.8rem;
    color: var(--success);
    font-weight: 600;
}

.backlink-sources {
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    padding: 24px;
}

.backlink-sources h3 {
    color: var(--text-primary);
    margin-bottom: 20px;
    font-size: 1.1rem;
}

.backlink-sources ul {
    list-style: none;
}

.backlink-sources li {
    padding: 14px 18px;
    background: var(--bg-card);
    margin-bottom: 8px;
    border-radius: var(--radius-sm);
    border-left: 3px solid var(--primary);
    color: var(--text-secondary);
    font-size: 0.9rem;
    transition: all 0.2s;
}

.backlink-sources li:hover {
    background: var(--bg-card-hover);
    transform: translateX(3px);
}

.backlink-sources li i {
    color: var(--primary);
    margin-right: 8px;
}

/* ===== ACTION BAR ===== */
.action-bar {
    background: var(--gradient-primary);
    border-radius: var(--radius-lg);
    padding: 24px 32px;
    margin-bottom: 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow-md);
    flex-wrap: wrap;
    gap: 16px;
}

.action-text {
    color: white;
    font-size: 1.1rem;
    font-weight: 600;
}

.action-text small {
    display: block;
    font-weight: 400;
    font-size: 0.9rem;
    opacity: 0.9;
    margin-top: 4px;
}

.action-button {
    background: white;
    color: var(--primary-dark);
    padding: 12px 28px;
    border-radius: var(--radius-md);
    font-weight: 700;
    font-size: 0.95rem;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.action-button:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

/* ===== TOAST NOTIFICATIONS ===== */
.toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-left: 4px solid var(--success);
    padding: 16px 20px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    color: var(--text-primary);
    font-size: 0.9rem;
    opacity: 0;
    transform: translateX(120%);
    transition: all 0.3s;
    z-index: 1000;
    max-width: 350px;
}

.toast.show {
    opacity: 1;
    transform: translateX(0);
}

.toast.error {
    border-left-color: var(--danger);
}

.toast i {
    margin-right: 8px;
    color: var(--success);
}

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

/* ===== FOOTER ===== */
.dashboard-footer {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-tertiary);
    font-size: 0.9rem;
    border-top: 1px solid var(--border);
    margin-top: 40px;
}

.dashboard-footer p {
    margin-bottom: 6px;
}

.dashboard-footer a {
    color: var(--primary-light);
    text-decoration: none;
    transition: color 0.2s;
}

.dashboard-footer a:hover {
    color: var(--primary);
    text-decoration: underline;
}

.dashboard-footer i {
    margin-right: 4px;
}

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

.dashboard-section,
.kpi-card,
.week-card {
    animation: fadeIn 0.4s ease-out;
}

.kpi-card:nth-child(1) { animation-delay: 0.05s; }
.kpi-card:nth-child(2) { animation-delay: 0.1s; }
.kpi-card:nth-child(3) { animation-delay: 0.15s; }
.kpi-card:nth-child(4) { animation-delay: 0.2s; }
.kpi-card:nth-child(5) { animation-delay: 0.25s; }
.kpi-card:nth-child(6) { animation-delay: 0.3s; }

@keyframes spin {
    to { transform: rotate(360deg); }
}

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

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
    .citations-layout,
    .backlink-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 16px;
    }

    .dashboard-header {
        padding: 28px 20px;
    }

    .header-content h1 {
        font-size: 1.8rem;
    }

    .subtitle {
        font-size: 0.95rem;
    }

    .badge {
        font-size: 0.8rem;
        padding: 6px 12px;
    }

    .kpi-grid {
        grid-template-columns: 1fr;
    }

    .charts-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-section {
        padding: 20px;
    }

    .dashboard-section h2 {
        font-size: 1.3rem;
    }

    .week-grid {
        grid-template-columns: 1fr;
    }

    .data-table {
        font-size: 0.8rem;
    }

    .data-table th,
    .data-table td {
        padding: 10px;
    }

    .data-table code {
        max-width: 150px;
    }

    .action-bar {
        flex-direction: column;
        text-align: center;
    }

    .header-top {
        flex-direction: column;
    }

    .header-controls {
        width: 100%;
        justify-content: flex-end;
    }
}

@media (max-width: 480px) {
    .header-content h1 {
        font-size: 1.5rem;
    }

    .keywords-grid {
        grid-template-columns: 1fr;
    }

    .citation-tier ul {
        grid-template-columns: 1fr;
    }

    .export-dropdown {
        right: -50px;
    }
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--border-light);
    border-radius: 5px;
}

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

/* ===== TOOLTIPS ===== */
[data-tooltip] {
    position: relative;
    cursor: help;
}

[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-8px);
    background: var(--bg-primary);
    color: var(--text-primary);
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.8rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
    z-index: 100;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-md);
}

[data-tooltip]:hover::after {
    opacity: 1;
}

/* ===== LOADING STATES ===== */
.loading {
    opacity: 0.5;
    pointer-events: none;
}

.skeleton {
    background: linear-gradient(90deg, var(--bg-secondary) 25%, var(--bg-card) 50%, var(--bg-secondary) 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

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

/* ===== PRINT STYLES ===== */
@media print {
    .dashboard-header,
    .theme-toggle,
    .export-btn,
    .export-menu,
    .action-bar,
    .toast {
        display: none !important;
    }

    .kpi-card,
    .dashboard-section,
    .week-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ddd;
    }

    body {
        background: white;
        color: black;
    }
}
/* ===== GSC SECTIONS ===== */
.gsc-section.loading {
    opacity: 0.6;
    pointer-events: none;
    transition: opacity 0.3s;
}

.gsc-list {
    list-style: none;
    display: grid;
    gap: 10px;
}

.gsc-query-item,
.gsc-page-item {
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    padding: 16px 20px;
    border: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s;
    cursor: pointer;
    gap: 16px;
}

.gsc-query-item:hover,
.gsc-page-item:hover {
    background: var(--bg-card-hover);
    transform: translateX(4px);
    border-color: var(--primary);
}

.gsc-query-main,
.gsc-page-main {
    flex: 1;
    min-width: 0;
}

.gsc-query-text {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.95rem;
    margin-bottom: 8px;
    word-break: break-word;
}

.gsc-page-url {
    font-family: 'Monaco', 'Menlo', monospace;
    font-size: 0.85rem;
    color: var(--primary-light);
    background: var(--bg-tertiary);
    padding: 4px 8px;
    border-radius: 4px;
    margin-bottom: 8px;
    display: inline-block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.gsc-query-meta {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    font-size: 0.85rem;
    color: var(--text-tertiary);
}

.gsc-query-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.gsc-query-meta i {
    color: var(--primary);
    font-size: 0.8rem;
}

.position-badge-large {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    padding: 12px 18px;
    border-radius: var(--radius-md);
    font-weight: 800;
    font-size: 1.2rem;
    min-width: 60px;
    text-align: center;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

#gsc-countries-bars {
    display: grid;
    gap: 8px;
}

.gsc-country-item {
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    padding: 10px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    border: 1px solid var(--border);
    transition: background 0.2s;
}

.gsc-country-item:hover {
    background: var(--bg-card-hover);
}

.country-flag {
    font-size: 1.4rem;
}

.country-code {
    font-weight: 700;
    color: var(--text-primary);
    min-width: 36px;
    font-size: 0.85rem;
    letter-spacing: 1px;
}

.country-bar-track {
    flex: 1;
    height: 8px;
    background: var(--bg-card);
    border-radius: 4px;
    overflow: hidden;
    margin: 0 12px;
}

.country-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    transition: width 0.5s ease;
    border-radius: 4px;
}

.country-clicks {
    font-weight: 700;
    color: var(--accent);
    min-width: 40px;
    text-align: right;
    font-size: 0.9rem;
}

.inspection-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
}

.inspection-card {
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    padding: 18px;
    border: 1px solid var(--border);
}

.inspection-label {
    color: var(--text-tertiary);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.inspection-label i {
    color: var(--primary);
}

.inspection-value {
    color: var(--text-primary);
    font-size: 0.9rem;
    font-weight: 500;
}

.inspection-value code {
    font-family: 'Monaco', 'Menlo', monospace;
    font-size: 0.85rem;
    color: var(--primary-light);
    background: var(--bg-tertiary);
    padding: 4px 8px;
    border-radius: 4px;
    display: inline-block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: middle;
}

[data-theme="light"] .gsc-query-item,
[data-theme="light"] .gsc-page-item,
[data-theme="light"] .gsc-country-item,
[data-theme="light"] .inspection-card {
    background: #ffffff;
    border-color: #e5e7eb;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

[data-theme="light"] .gsc-page-url,
[data-theme="light"] .inspection-value code {
    background: #f3f4f6;
    color: #4f46e5;
}

[data-theme="light"] .country-bar-track {
    background: #e5e7eb;
}
