/* ═══════════════════════════════════════════
   KeySEO Crawler v3.0 — Premium Neon Dark Theme
   ═══════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=JetBrains+Mono:wght@400;500;700&display=swap');

:root {
    --bg-primary: #0A0A0A;
    --bg-secondary: #111111;
    --bg-card: rgba(20, 20, 20, 0.85);
    --bg-card-hover: rgba(30, 30, 30, 0.95);
    --bg-card-solid: #141414;
    --bg-surface: rgba(35, 35, 35, 0.7);
    --bg-input: rgba(12, 12, 12, 0.9);
    --bg-glass: rgba(20, 20, 20, 0.6);

    --border: rgba(60, 55, 40, 0.35);
    --border-hover: rgba(245, 166, 35, 0.4);
    --border-glow: rgba(245, 166, 35, 0.3);

    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --text-dim: #475569;

    --accent-blue: #F5A623;
    --accent-indigo: #E09500;
    --accent-purple: #F5A623;
    --accent-green: #22c55e;
    --accent-emerald: #10b981;
    --accent-red: #ef4444;
    --accent-orange: #f59e0b;
    --accent-cyan: #F5A623;
    --accent-pink: #FFD175;
    --accent-teal: #E09500;

    --gradient-hero: linear-gradient(135deg, #F5A623, #E09500, #FFD175);
    --gradient-primary: linear-gradient(135deg, #F5A623 0%, #E09500 50%, #D4880A 100%);
    --gradient-success: linear-gradient(135deg, #22c55e, #10b981);
    --gradient-danger: linear-gradient(135deg, #ef4444, #f97316);
    --gradient-purple: linear-gradient(135deg, #F5A623, #FFD175);
    --gradient-card: linear-gradient(145deg, rgba(20, 20, 20, 0.9), rgba(30, 30, 30, 0.6));
    --gradient-ai: linear-gradient(135deg, #F5A623, #E09500, #FFD175);

    --radius: 16px;
    --radius-md: 12px;
    --radius-sm: 8px;
    --radius-xs: 6px;
    --radius-full: 9999px;

    --shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.4);
    --shadow-glow-blue: 0 0 30px rgba(245, 166, 35, 0.15);
    --shadow-glow-purple: 0 0 30px rgba(245, 166, 35, 0.15);
    --shadow-glow-ai: 0 0 40px rgba(245, 166, 35, 0.2);

    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    background-image:
        radial-gradient(at 20% 20%, rgba(245, 166, 35, 0.04) 0px, transparent 50%),
        radial-gradient(at 80% 80%, rgba(245, 166, 35, 0.03) 0px, transparent 50%),
        radial-gradient(at 50% 50%, rgba(245, 166, 35, 0.02) 0px, transparent 50%);
    background-attachment: fixed;
}

/* ═══ SCROLLBAR ═══ */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(100, 116, 139, 0.3);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(100, 116, 139, 0.5);
}

/* ═══ ANIMATIONS ═══ */
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }

    100% {
        background-position: 200% 0;
    }
}

@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

@keyframes glowPulse {

    0%,
    100% {
        box-shadow: 0 0 20px rgba(245, 166, 35, 0.2);
    }

    50% {
        box-shadow: 0 0 40px rgba(245, 166, 35, 0.4);
    }
}

@keyframes typewriter {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.fade-in {
    animation: fadeInUp 0.5s ease-out;
}

.slide-down {
    animation: slideDown 0.3s ease-out;
}

/* ═══ LAYOUT ═══ */
.app-container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 24px 40px;
}

/* ═══ HEADER ═══ */
.app-header {
    padding: 24px 0;
    border-bottom: 1px solid var(--border);
    margin-bottom: 28px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}

.app-header::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--gradient-hero);
    opacity: 0.4;
}

.logo {
    display: flex;
    align-items: center;
    gap: 14px;
}

.logo-icon {
    width: 48px;
    height: 48px;
    background: var(--gradient-hero);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    box-shadow: var(--shadow-glow-blue);
    position: relative;
    overflow: hidden;
}

.logo-icon::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.15), transparent);
    border-radius: inherit;
}

.logo h1 {
    font-size: 24px;
    font-weight: 900;
    background: var(--gradient-hero);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientShift 4s ease infinite;
    letter-spacing: -0.5px;
}

.logo-subtitle {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 500;
    letter-spacing: 0.3px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.header-stats {
    display: flex;
    gap: 12px;
}

.header-stat {
    text-align: right;
    padding: 10px 18px;
    background: var(--bg-card);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    backdrop-filter: blur(10px);
    transition: var(--transition);
}

.header-stat:hover {
    border-color: var(--border-hover);
    transform: translateY(-1px);
}

.header-stat-value {
    font-size: 20px;
    font-weight: 800;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.header-stat-label {
    font-size: 10px;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.5px;
    font-weight: 600;
}

.btn-settings {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text-muted);
    font-size: 18px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
}

.btn-settings:hover {
    border-color: var(--accent-purple);
    color: var(--accent-purple);
    box-shadow: var(--shadow-glow-purple);
}

/* ═══ TABS ═══ */
.tabs {
    display: flex;
    gap: 4px;
    background: var(--bg-card);
    padding: 5px;
    border-radius: var(--radius);
    margin-bottom: 28px;
    border: 1px solid var(--border);
    overflow-x: auto;
    backdrop-filter: blur(10px);
}

.tab {
    padding: 11px 22px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    border-radius: var(--radius-sm);
    white-space: nowrap;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 7px;
    position: relative;
}

.tab:hover {
    color: var(--text-primary);
    background: var(--bg-surface);
}

.tab.active {
    background: var(--gradient-primary);
    color: white;
    box-shadow: var(--shadow-glow-blue);
}

.tab.tab-report {
    background: transparent;
}

.tab.tab-report.active {
    background: var(--gradient-success);
    box-shadow: 0 0 30px rgba(34, 197, 94, 0.2);
}

.tab.tab-schema {
    background: transparent;
}

.tab.tab-schema.active {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    box-shadow: 0 0 30px rgba(245, 158, 11, 0.2);
}

.tab.tab-ai {
    background: transparent;
}

.tab.tab-ai.active {
    background: var(--gradient-ai);
    box-shadow: var(--shadow-glow-ai);
}

.tab-badge {
    font-size: 10px;
    padding: 2px 7px;
    background: rgba(255, 255, 255, 0.12);
    border-radius: var(--radius-full);
    min-width: 22px;
    text-align: center;
    font-weight: 700;
}

.tab.active .tab-badge {
    background: rgba(255, 255, 255, 0.25);
}

/* ═══ PANELS ═══ */
.panel {
    display: none;
}

.panel.active {
    display: block;
    animation: fadeIn 0.3s ease-out;
}

/* ═══ CARDS ═══ */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 22px;
    box-shadow: var(--shadow);
    transition: var(--transition);
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.06), transparent);
}

.card:hover {
    border-color: var(--border-hover);
    box-shadow: var(--shadow-lg);
}

.card-title {
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 18px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-primary);
}

/* ═══ CONTROL PANEL ═══ */
.control-panel {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px;
    margin-bottom: 28px;
    display: flex;
    gap: 14px;
    align-items: flex-end;
    flex-wrap: wrap;
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
}

.control-panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-hero);
    opacity: 0.6;
}

.control-field {
    flex: 1;
    min-width: 300px;
}

.control-field label,
.control-panel>div>label {
    display: block;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.control-input {
    width: 100%;
    padding: 13px 18px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 14px;
    font-family: inherit;
    transition: var(--transition);
}

.control-input:focus {
    outline: none;
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15), var(--shadow-glow-blue);
}

.control-input::placeholder {
    color: var(--text-dim);
}

.control-select {
    padding: 13px 18px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 13px;
    font-family: inherit;
    cursor: pointer;
    min-width: 150px;
    transition: var(--transition);
}

.control-select:focus {
    outline: none;
    border-color: var(--accent-blue);
}

/* ═══ BUTTONS ═══ */
.btn {
    padding: 13px 28px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    position: relative;
    overflow: hidden;
}

.btn::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), transparent);
    opacity: 0;
    transition: var(--transition);
}

.btn:hover::after {
    opacity: 1;
}

.btn-primary {
    background: var(--gradient-primary);
    color: white;
    box-shadow: var(--shadow-glow-blue);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(59, 130, 246, 0.3);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn-danger {
    background: var(--gradient-danger);
    color: white;
}

.btn-ai {
    background: var(--gradient-ai);
    color: white;
    box-shadow: var(--shadow-glow-ai);
}

.btn-ai:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(99, 102, 241, 0.4);
}

.btn-ai:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    background: var(--bg-surface);
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
    border-color: var(--border-hover);
}

.btn-sm {
    padding: 7px 14px;
    font-size: 11px;
}

.btn-export-excel {
    padding: 7px 14px;
    font-size: 11px;
    border: none;
    border-radius: var(--radius-sm);
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    background: linear-gradient(135deg, #16a34a, #15803d);
    color: #fff;
    box-shadow: 0 2px 10px rgba(22, 163, 74, 0.3);
    position: relative;
    overflow: hidden;
}

.btn-export-excel::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.12), transparent);
    opacity: 0;
    transition: var(--transition);
}

.btn-export-excel:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(22, 163, 74, 0.4);
}

.btn-export-excel:hover::after {
    opacity: 1;
}

/* ═══ PROGRESS ═══ */
.progress-bar {
    width: 100%;
    height: 5px;
    background: var(--bg-surface);
    border-radius: 3px;
    overflow: hidden;
    margin: 14px 0;
}

.progress-fill {
    height: 100%;
    background: var(--gradient-primary);
    border-radius: 3px;
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.5);
    position: relative;
}

.progress-fill::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: shimmer 1.5s infinite;
    background-size: 200% 100%;
}

.crawl-status {
    font-size: 12px;
    color: var(--text-muted);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 500;
}

/* ═══ GRID LAYOUTS ═══ */
.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
}

.grid-5 {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 14px;
}

@media (max-width: 1200px) {
    .grid-5 {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .grid-5 {
        grid-template-columns: repeat(2, 1fr);
    }

    .grid-3 {
        grid-template-columns: repeat(2, 1fr);
    }

    .grid-2 {
        grid-template-columns: 1fr;
    }
}

.grid-auto {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
}

/* ═══ SCORE WIDGET ═══ */
.score-widget {
    text-align: center;
    padding: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.score-circle {
    width: 110px;
    height: 110px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 10px;
    position: relative;
}

.score-circle::before {
    content: '';
    position: absolute;
    inset: 5px;
    border-radius: 50%;
    background: var(--bg-card-solid);
}

.score-value {
    font-size: 36px;
    font-weight: 900;
    position: relative;
    z-index: 1;
    letter-spacing: -1px;
    font-family: 'JetBrains Mono', monospace;
}

.score-label {
    font-size: 10px;
    text-transform: uppercase;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 1.5px;
}

.score-good .score-circle {
    background: var(--gradient-success);
    box-shadow: 0 0 30px rgba(34, 197, 94, 0.2);
}

.score-good .score-value {
    color: var(--accent-green);
}

.score-mid .score-circle {
    background: linear-gradient(135deg, var(--accent-orange), #ea580c);
    box-shadow: 0 0 30px rgba(245, 158, 11, 0.2);
}

.score-mid .score-value {
    color: var(--accent-orange);
}

.score-bad .score-circle {
    background: var(--gradient-danger);
    box-shadow: 0 0 30px rgba(239, 68, 68, 0.2);
}

.score-bad .score-value {
    color: var(--accent-red);
}

/* ═══ STAT CARDS ═══ */
.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px 18px;
    text-align: center;
    transition: var(--transition);
    backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100px;
}

.stat-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.stat-value {
    font-size: 32px;
    font-weight: 900;
    line-height: 1.1;
    letter-spacing: -0.5px;
    font-family: 'JetBrains Mono', monospace;
}

.stat-label {
    font-size: 10px;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-top: 8px;
    letter-spacing: 0.8px;
    font-weight: 700;
}

/* ═══ TABLE ═══ */
.table-wrapper {
    overflow-x: auto;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.data-table th {
    background: var(--bg-surface);
    padding: 12px 14px;
    text-align: left;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 10px;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
    cursor: pointer;
    user-select: none;
    transition: var(--transition);
}

.data-table th:hover {
    color: var(--accent-blue);
}

.data-table td {
    padding: 10px 14px;
    border-bottom: 1px solid rgba(56, 78, 112, 0.2);
    color: var(--text-secondary);
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    transition: var(--transition);
}

.data-table tr:hover td {
    background: var(--bg-card-hover);
    color: var(--text-primary);
}

.inbound-row:hover td {
    background: rgba(0, 210, 255, 0.04) !important;
}

.inbound-row:hover td:first-child {
    border-left: 3px solid var(--accent-cyan);
}

.inbound-row td:first-child {
    transition: border-left 0.2s;
    border-left: 3px solid transparent;
}

.inbound-row-active td {
    background: rgba(0, 210, 255, 0.08) !important;
}

.inbound-row-active td:first-child {
    border-left: 3px solid var(--accent-cyan) !important;
}

#right-panel-detail {
    animation: fadeSlideIn 0.3s ease-out;
    border-top: 3px solid var(--accent-cyan) !important;
}

@keyframes fadeSlideIn {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.anchor-bar-row:hover {
    background: rgba(255, 255, 255, 0.03);
}

.url-cell {
    color: var(--accent-blue) !important;
    text-decoration: none;
    max-width: 350px;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: var(--transition);
}

.url-cell:hover {
    text-decoration: underline;
    color: var(--accent-indigo) !important;
}

/* ═══ STATUS BADGES ═══ */
.status-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.3px;
}

.status-200 {
    background: rgba(34, 197, 94, 0.12);
    color: var(--accent-green);
    border: 1px solid rgba(34, 197, 94, 0.2);
}

.status-301,
.status-302 {
    background: rgba(245, 158, 11, 0.12);
    color: var(--accent-orange);
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.status-404 {
    background: rgba(239, 68, 68, 0.12);
    color: var(--accent-red);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.status-500 {
    background: rgba(239, 68, 68, 0.15);
    color: var(--accent-red);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.status-0 {
    background: rgba(100, 116, 139, 0.12);
    color: var(--text-muted);
    border: 1px solid rgba(100, 116, 139, 0.2);
}

/* ═══ ISSUE CARDS ═══ */
.issue-card {
    padding: 14px 18px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    cursor: pointer;
    transition: var(--transition);
}

.issue-card:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-hover);
    transform: translateX(3px);
}

.issue-label {
    font-size: 13px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
}

.issue-count {
    font-size: 12px;
    font-weight: 700;
    padding: 3px 12px;
    border-radius: var(--radius-full);
    min-width: 30px;
    text-align: center;
}

.issue-critical .issue-count {
    background: rgba(239, 68, 68, 0.12);
    color: var(--accent-red);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.issue-warning .issue-count {
    background: rgba(245, 158, 11, 0.12);
    color: var(--accent-orange);
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.issue-info .issue-count {
    background: rgba(59, 130, 246, 0.12);
    color: var(--accent-blue);
    border: 1px solid rgba(59, 130, 246, 0.2);
}

/* ═══ FILTER BAR ═══ */
.filter-bar {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 18px;
    flex-wrap: wrap;
}

.filter-input {
    padding: 9px 16px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 12px;
    font-family: inherit;
    min-width: 220px;
    transition: var(--transition);
}

.filter-input:focus {
    outline: none;
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.filter-pill {
    padding: 7px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    background: transparent;
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: var(--transition);
}

.filter-pill:hover {
    border-color: var(--accent-blue);
    color: var(--text-primary);
}

.filter-pill.active {
    background: var(--accent-blue);
    border-color: var(--accent-blue);
    color: white;
}

/* ═══ DOMAIN TAG ═══ */
.domain-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 12px;
    margin: 3px;
    cursor: pointer;
    transition: var(--transition);
}

.domain-tag:hover {
    border-color: var(--accent-blue);
    background: var(--bg-card-hover);
}

.domain-tag.selected {
    border-color: var(--accent-purple);
    background: rgba(168, 85, 247, 0.12);
    color: var(--accent-purple);
}

.domain-count {
    font-weight: 700;
    color: var(--accent-blue);
}

/* ═══ KEYWORD PILL ═══ */
.keyword-pill {
    display: inline-block;
    padding: 5px 12px;
    background: rgba(168, 85, 247, 0.1);
    border: 1px solid rgba(168, 85, 247, 0.25);
    border-radius: var(--radius-full);
    font-size: 11px;
    color: var(--accent-purple);
    font-weight: 600;
    transition: var(--transition);
}

.keyword-pill:hover {
    background: rgba(168, 85, 247, 0.2);
}

/* ═══ SPINNER ═══ */
.spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid var(--border);
    border-top-color: var(--accent-blue);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

.spinner-lg {
    width: 28px;
    height: 28px;
    border-width: 3px;
}

/* ═══ EMPTY STATE ═══ */
.empty-state {
    text-align: center;
    padding: 80px 20px;
    color: var(--text-muted);
}

.empty-state-icon {
    font-size: 56px;
    margin-bottom: 20px;
    opacity: 0.25;
}

.empty-state-text {
    font-size: 14px;
    max-width: 420px;
    margin: 0 auto;
    line-height: 1.8;
}

/* ═══ NOFOLLOW BADGE ═══ */
.nofollow-badge {
    font-size: 9px;
    padding: 2px 6px;
    background: rgba(239, 68, 68, 0.12);
    color: var(--accent-red);
    border-radius: 4px;
    font-weight: 700;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

/* ═══ EXPORT BAR ═══ */
.export-bar {
    margin-bottom: 14px;
    display: flex;
    gap: 8px;
}

/* ═══ AI ANALYSIS SECTION ═══ */
.ai-card {
    background: var(--bg-card);
    border: 1px solid rgba(99, 102, 241, 0.25);
    border-radius: var(--radius);
    padding: 0;
    overflow: hidden;
    position: relative;
}

.ai-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-ai);
}

.ai-header {
    padding: 22px 28px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border);
}

.ai-title {
    font-size: 16px;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 10px;
}

.ai-title-icon {
    width: 36px;
    height: 36px;
    background: var(--gradient-ai);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.ai-badge {
    font-size: 10px;
    padding: 3px 10px;
    background: var(--gradient-ai);
    border-radius: var(--radius-full);
    color: white;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.ai-content {
    padding: 28px;
    font-size: 14px;
    line-height: 1.8;
    color: var(--text-secondary);
}

.ai-content h1,
.ai-content h2,
.ai-content h3 {
    color: var(--text-primary);
    margin: 28px 0 14px 0;
    font-weight: 700;
}

.ai-content h1 {
    font-size: 22px;
}

.ai-content h2 {
    font-size: 18px;
}

.ai-content h3 {
    font-size: 15px;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.ai-content h3:first-child {
    margin-top: 0;
}

.ai-content ul,
.ai-content ol {
    padding-left: 24px;
    margin: 12px 0;
}

.ai-content li {
    margin: 8px 0;
    line-height: 1.7;
}

.ai-content strong {
    color: var(--text-primary);
    font-weight: 700;
}

.ai-content code {
    background: rgba(99, 102, 241, 0.12);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    color: var(--accent-indigo);
    border: 1px solid rgba(99, 102, 241, 0.2);
}

.ai-content blockquote {
    border-left: 3px solid var(--accent-indigo);
    padding: 12px 18px;
    margin: 16px 0;
    background: rgba(99, 102, 241, 0.06);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    color: var(--text-secondary);
}

.ai-content hr {
    border: none;
    height: 1px;
    background: var(--border);
    margin: 24px 0;
}

.ai-content p {
    margin: 12px 0;
}

.ai-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    gap: 20px;
}

.ai-loading-text {
    font-size: 14px;
    color: var(--text-muted);
    font-weight: 500;
}

.ai-loading-dots {
    display: flex;
    gap: 6px;
}

.ai-loading-dots span {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--accent-indigo);
    animation: pulse 1.4s ease-in-out infinite;
}

.ai-loading-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.ai-loading-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

.ai-meta {
    padding: 14px 28px;
    border-top: 1px solid var(--border);
    font-size: 11px;
    color: var(--text-dim);
    display: flex;
    justify-content: space-between;
}

/* ═══ SETTINGS MODAL ═══ */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease-out;
}

.modal {
    background: var(--bg-card-solid);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    width: 500px;
    max-width: 90vw;
    box-shadow: var(--shadow-lg);
    animation: fadeInUp 0.3s ease-out;
}

.modal-header {
    padding: 22px 28px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-title {
    font-size: 16px;
    font-weight: 700;
}

.modal-close {
    width: 32px;
    height: 32px;
    border: 1px solid var(--border);
    border-radius: var(--radius-xs);
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.modal-close:hover {
    background: rgba(239, 68, 68, 0.1);
    color: var(--accent-red);
    border-color: var(--accent-red);
}

.modal-body {
    padding: 28px;
}

.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.form-hint {
    font-size: 11px;
    color: var(--text-dim);
    margin-top: 6px;
    line-height: 1.5;
}

.form-input {
    width: 100%;
    padding: 11px 16px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 13px;
    font-family: 'JetBrains Mono', monospace;
    transition: var(--transition);
}

.form-input:focus {
    outline: none;
    border-color: var(--accent-indigo);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.form-select {
    width: 100%;
    padding: 11px 16px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 13px;
    font-family: inherit;
    cursor: pointer;
}

.modal-footer {
    padding: 18px 28px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* ═══ FOOTER ═══ */
.app-footer {
    border-top: 1px solid var(--border);
    padding: 24px;
    text-align: center;
    margin-top: 40px;
    position: relative;
}

.app-footer::before {
    content: '';
    position: absolute;
    top: -1px;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--gradient-hero);
    opacity: 0.3;
}

/* ═══ RESPONSIVE ═══ */
@media (max-width: 1200px) {
    .grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }

    .grid-5 {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {

    .grid-2,
    .grid-3,
    .grid-4,
    .grid-5 {
        grid-template-columns: 1fr;
    }

    .control-panel {
        flex-direction: column;
    }

    .control-field {
        min-width: 100%;
    }

    .header-stats {
        display: none;
    }

    .app-container {
        padding: 0 12px 30px;
    }

    .tabs {
        padding: 3px;
    }

    .tab {
        padding: 9px 14px;
        font-size: 12px;
    }
}

/* ═══ TABLE PAGINATION ═══ */
.table-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 0;
    margin-top: 8px;
}

.pagination-btn {
    padding: 6px 12px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: var(--transition);
    font-family: inherit;
}

.pagination-btn:hover:not(:disabled) {
    border-color: var(--border-hover);
    color: var(--text-primary);
    background: var(--bg-card-hover);
}

.pagination-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.pagination-info {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
    padding: 0 8px;
}