/* ============================================================
   DomainAnalyzer – Premium Dashboard CSS
   ============================================================ */

/* === CSS Variables === */
:root {
    --bg-primary: #0a0e1a;
    --bg-secondary: #111827;
    --bg-card: rgba(17, 24, 39, 0.7);
    --bg-card-hover: rgba(30, 41, 59, 0.8);
    --glass-bg: rgba(15, 23, 42, 0.6);
    --glass-border: rgba(99, 102, 241, 0.15);
    --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --accent-primary: #6366f1;
    --accent-secondary: #06b6d4;
    --accent-gradient: linear-gradient(135deg, #6366f1, #06b6d4);
    --good: #10b981;
    --good-bg: rgba(16, 185, 129, 0.15);
    --medium: #f59e0b;
    --medium-bg: rgba(245, 158, 11, 0.15);
    --critical: #ef4444;
    --critical-bg: rgba(239, 68, 68, 0.15);
    --border: rgba(148, 163, 184, 0.1);
    --radius: 16px;
    --radius-sm: 10px;
    --radius-xs: 6px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --font-main: 'Inter', -apple-system, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
}

[data-theme="light"] {
    --bg-primary: #f8fafc;
    --bg-secondary: #ffffff;
    --bg-card: rgba(255, 255, 255, 0.8);
    --bg-card-hover: rgba(241, 245, 249, 0.9);
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(99, 102, 241, 0.2);
    --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --border: rgba(15, 23, 42, 0.08);
}

/* === Reset === */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* === Ambient Background === */
.ambient-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.25;
    animation: orbFloat 20s ease-in-out infinite;
}

.orb-1 {
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, #6366f1, transparent 70%);
    top: -200px;
    left: -100px;
    animation-duration: 25s;
}

.orb-2 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, #06b6d4, transparent 70%);
    bottom: -200px;
    right: -100px;
    animation-duration: 30s;
    animation-delay: -10s;
}

.orb-3 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, #8b5cf6, transparent 70%);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation-duration: 35s;
    animation-delay: -5s;
}

@keyframes orbFloat {

    0%,
    100% {
        transform: translate(0, 0) scale(1);
    }

    25% {
        transform: translate(50px, -30px) scale(1.1);
    }

    50% {
        transform: translate(-30px, 50px) scale(0.9);
    }

    75% {
        transform: translate(30px, 30px) scale(1.05);
    }
}

/* === Glass Effect === */
.glass {
    background: var(--glass-bg);


    border: 1px solid var(--glass-border);
    box-shadow: none;
    border-radius: var(--radius);
}

/* === Header === */
.header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: #0a0e1a;

    border-bottom: 1px solid var(--border);
    padding: 0 24px;
}

[data-theme="light"] .header {
    background: rgba(248, 250, 252, 0.85);
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(99, 102, 241, 0.1);
    border-radius: 12px;
    padding: 4px;
}

.logo-text {
    font-size: 22px;
    font-weight: 800;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.5px;
}

.logo-sub {
    display: block;
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 500;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    margin-top: -2px;
}

/* === Buttons === */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius-sm);
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

.btn-primary {
    background: var(--accent-gradient);
    color: #fff;
    box-shadow: none;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: none;
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    padding: 8px;
    border-radius: 10px;
}

.btn-ghost:hover {
    background: rgba(99, 102, 241, 0.1);
    color: var(--accent-primary);
}

.btn-outline {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

.btn-outline:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
    background: rgba(99, 102, 241, 0.05);
}

.btn-sm {
    padding: 6px 14px;
    font-size: 13px;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

/* === Main === */
.main {
    position: relative;
    z-index: 1;
    max-width: 1400px;
    margin: 0 auto;
    padding: 24px;
}

/* === Search Section === */
.search-section {
    margin-bottom: 32px;
}

.search-card {
    padding: 48px;
    text-align: center;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.08), rgba(6, 182, 212, 0.05));
}

.search-title {
    font-size: 32px;
    font-weight: 800;
    margin-bottom: 8px;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.search-subtitle {
    color: var(--text-muted);
    font-size: 15px;
    margin-bottom: 28px;
}

.search-form {
    max-width: 680px;
    margin: 0 auto;
}

.input-group {
    display: flex;
    align-items: center;
    background: var(--bg-secondary);
    border: 2px solid var(--border);
    border-radius: 14px;
    padding: 4px;
    transition: var(--transition);
}

.input-group:focus-within {
    border-color: var(--accent-primary);
    box-shadow: none;
}

.input-icon {
    padding: 0 12px 0 16px;
    color: var(--text-muted);
    display: flex;
}

#domainInput {
    flex: 1;
    background: none;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-size: 16px;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    padding: 12px 0;
}

#domainInput::placeholder {
    color: var(--text-muted);
}

.input-hints {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-top: 16px;
    flex-wrap: wrap;
}

.hint {
    padding: 4px 14px;
    font-size: 12px;
    color: var(--text-muted);
    background: rgba(99, 102, 241, 0.06);
    border: 1px solid var(--border);
    border-radius: 20px;
    cursor: pointer;
    transition: var(--transition);
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.hint:hover {
    color: var(--accent-primary);
    border-color: var(--accent-primary);
    background: rgba(99, 102, 241, 0.12);
}

/* === Loading === */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #0a0e1a;

    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.3s;
}

.loading-card {
    text-align: center;
    padding: 48px 64px;
    max-width: 420px;
}

.loading-spinner {
    position: relative;
    width: 80px;
    height: 80px;
    margin: 0 auto 24px;
}

.spinner-ring {
    position: absolute;
    border: 3px solid transparent;
    border-radius: 50%;
    animation: spin 1.5s linear infinite;
}

.spinner-ring:nth-child(1) {
    width: 80px;
    height: 80px;
    border-top-color: #6366f1;
    animation-duration: 1.5s;
}

.spinner-ring:nth-child(2) {
    width: 60px;
    height: 60px;
    top: 10px;
    left: 10px;
    border-top-color: #06b6d4;
    animation-duration: 1s;
    animation-direction: reverse;
}

.spinner-ring:nth-child(3) {
    width: 40px;
    height: 40px;
    top: 20px;
    left: 20px;
    border-top-color: #8b5cf6;
    animation-duration: 0.8s;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 8px;
}

.loading-status {
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 20px;
}

.progress-bar {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
}

.progress-fill {
    width: 0%;
    height: 100%;
    background: var(--accent-gradient);
    border-radius: 2px;
    transition: width 0.5s ease;
}

/* === Error === */
.error-message {
    text-align: center;
    margin: 32px 0;
}

.error-card {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    padding: 40px 60px;
}

.error-card h3 {
    font-size: 20px;
    color: var(--critical);
}

.error-card p {
    color: var(--text-secondary);
}

/* === Scores === */
.scores-overview {
    margin-bottom: 32px;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 12px;
}

.section-header h2 {
    font-size: 22px;
    font-weight: 700;
}

.export-buttons {
    display: flex;
    gap: 8px;
}

.domain-meta {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 24px;
    font-size: 13px;
    color: var(--text-muted);
}

.domain-meta span {
    display: flex;
    align-items: center;
    gap: 6px;
}

.scores-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr 1fr;
    gap: 16px;
}

.score-card {
    padding: 28px;
    text-align: center;
    transition: var(--transition);
}

.score-card:hover {
    transform: translateY(-4px);
}

.score-overall {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.12), rgba(6, 182, 212, 0.08)) !important;
    border-color: rgba(99, 102, 241, 0.3) !important;
}

.score-ring,
.score-mini-ring {
    position: relative;
    margin: 0 auto 12px;
}

.score-ring {
    width: 120px;
    height: 120px;
}

.score-mini-ring {
    width: 80px;
    height: 80px;
}

.score-ring svg,
.score-mini-ring svg {
    transform: rotate(-90deg);
}

.score-circle {
    stroke: var(--accent-primary);
    stroke-dasharray: 339.292;
    stroke-dashoffset: 339.292;
    transition: stroke-dashoffset 1.5s ease-out, stroke 0.5s ease;
}

.score-mini-ring .score-circle {
    stroke-dasharray: 226.195;
    stroke-dashoffset: 226.195;
}

.score-value,
.score-value-sm {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-weight: 800;
}

.score-value {
    font-size: 32px;
}

.score-value-sm {
    font-size: 22px;
}

.score-label {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 600;
    margin-top: 4px;
}

.score-grade {
    display: inline-block;
    margin-top: 6px;
    padding: 2px 14px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 14px;
}

/* === Tabs === */
.tabs-container {
    margin-bottom: 32px;
}

.tabs-nav {
    display: flex;
    gap: 4px;
    padding: 6px;
    margin-bottom: 20px;
    overflow-x: auto;
    scrollbar-width: none;
}

.tabs-nav::-webkit-scrollbar {
    display: none;
}

.tab-btn {
    padding: 10px 18px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-weight: 600;
    font-size: 13px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

.tab-btn:hover {
    color: var(--text-primary);
    background: rgba(99, 102, 241, 0.08);
}

.tab-btn.active {
    color: #fff;
    background: var(--accent-gradient);
    box-shadow: none;
}

.tab-panel {
    display: none;
    animation: fadeSlideUp 0.4s ease;
}

.tab-panel.active {
    display: block;
}

@keyframes fadeSlideUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* === Panels === */
.panel-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
    gap: 16px;
}

.data-card {
    padding: 24px;
    transition: var(--transition);
}

.data-card:hover {
    border-color: rgba(99, 102, 241, 0.3);
}

.data-card.full-width {
    grid-column: 1 / -1;
}

.data-card h3 {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 8px;
}

/* === Data Table === */
.data-table {
    width: 100%;
}

.data-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
    gap: 12px;
}

.data-row:last-child {
    border-bottom: none;
}

.data-label {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 500;
    min-width: 140px;
    flex-shrink: 0;
}

.data-value {
    font-size: 13px;
    color: var(--text-primary);
    font-weight: 600;
    text-align: right;
    word-break: break-all;
    max-width: 60%;
}

.data-value.mono {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 12px;
}

/* === Badges === */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.badge-good {
    background: var(--good-bg);
    color: var(--good);
}

.badge-medium {
    background: var(--medium-bg);
    color: var(--medium);
}

.badge-critical {
    background: var(--critical-bg);
    color: var(--critical);
}

.badge-info {
    background: rgba(99, 102, 241, 0.15);
    color: var(--accent-primary);
}

/* === Status List === */
.status-list {
    list-style: none;
}

.status-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
}

.status-item:last-child {
    border-bottom: none;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.status-dot.present {
    background: var(--good);
    box-shadow: none;
}

.status-dot.missing {
    background: var(--critical);
    box-shadow: none;
}

/* === NS / MX List === */
.ns-list,
.mx-list,
.san-list {
    list-style: none;
}

.ns-item,
.mx-item,
.san-item {
    padding: 8px 12px;
    margin-bottom: 6px;
    background: rgba(99, 102, 241, 0.06);
    border-radius: var(--radius-xs);
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 12px;
    color: var(--text-secondary);
    border-left: 3px solid var(--accent-primary);
}

/* === Chain Items === */
.chain-item {
    padding: 10px 14px;
    margin-bottom: 8px;
    background: rgba(99, 102, 241, 0.05);
    border-radius: var(--radius-xs);
    border-left: 3px solid var(--accent-secondary);
    font-size: 13px;
}

.chain-item .chain-label {
    color: var(--text-muted);
    font-size: 11px;
    text-transform: uppercase;
}

.chain-item .chain-value {
    color: var(--text-primary);
    font-weight: 600;
    margin-top: 2px;
}

/* === Headings === */
.heading-item {
    padding: 8px 12px;
    margin-bottom: 6px;
    border-radius: var(--radius-xs);
    font-size: 13px;
}

.heading-h1 {
    background: rgba(99, 102, 241, 0.1);
    border-left: 3px solid #6366f1;
}

.heading-h2 {
    background: rgba(6, 182, 212, 0.08);
    border-left: 3px solid #06b6d4;
    margin-left: 16px;
}

.heading-h3 {
    background: rgba(139, 92, 246, 0.06);
    border-left: 3px solid #8b5cf6;
    margin-left: 32px;
}

.heading-tag {
    font-size: 10px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-right: 8px;
}

/* === Keywords === */
.keyword-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.keyword-word {
    min-width: 100px;
    font-size: 13px;
    font-weight: 600;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.keyword-fill-track {
    flex: 1;
    height: 6px;
    background: #111827;
    border-radius: 3px;
    overflow: hidden;
}

.keyword-fill {
    height: 100%;
    background: var(--accent-gradient);
    border-radius: 3px;
    transition: width 1s ease;
}

.keyword-pct {
    font-size: 12px;
    color: var(--text-muted);
    min-width: 50px;
    text-align: right;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* === Links List === */
.link-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
}

.link-item:last-child {
    border-bottom: none;
}

.link-url {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--accent-secondary);
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 12px;
}

.link-status {
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 4px;
}

/* === Charts === */
.charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
    gap: 16px;
}

.chart-card {
    padding: 24px;
}

.chart-card h3 {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 16px;
}

.chart-card canvas {
    max-height: 280px;
}

/* === Details === */
.details-section {
    margin-top: 32px;
}

.details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
    gap: 16px;
}

.detail-card {
    padding: 24px;
}

.detail-card h3 {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
}

.detail-item {
    padding: 8px 0;
    font-size: 13px;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border);
    line-height: 1.5;
}

.detail-item:last-child {
    border-bottom: none;
}

/* === AI Section === */
.ai-item {
    padding: 10px 14px;
    margin-bottom: 8px;
    background: rgba(99, 102, 241, 0.04);
    border-radius: var(--radius-xs);
    border-left: 3px solid var(--accent-primary);
    font-size: 13px;
    line-height: 1.5;
    color: var(--text-secondary);
}

.ai-unavailable {
    text-align: center;
    padding: 40px;
    color: var(--text-muted);
}

.ai-unavailable svg {
    margin-bottom: 16px;
    opacity: 0.5;
}

/* === Recent Reports === */
.recent-section {
    margin-top: 48px;
}

.recent-section h2 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 16px;
}

.recent-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 12px;
}

.recent-card {
    padding: 16px 20px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.recent-card:hover {
    transform: translateY(-2px);
    border-color: var(--accent-primary);
}

.recent-domain {
    font-weight: 600;
    font-size: 14px;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.recent-date {
    font-size: 11px;
    color: var(--text-muted);
}

/* === Footer === */
.footer {
    text-align: center;
    padding: 32px 24px;
    color: var(--text-muted);
    font-size: 13px;
    border-top: 1px solid var(--border);
    margin-top: 48px;
}

/* === Utility === */
.hidden {
    display: none !important;
}

.text-good {
    color: var(--good);
}

.text-medium {
    color: var(--medium);
}

.text-critical {
    color: var(--critical);
}

/* === Scrollbar === */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(99, 102, 241, 0.3);
    border-radius: 3px;
}

/* === Searchable Table === */
.table-search {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.table-search input {
    flex: 1;
    padding: 8px 14px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-xs);
    color: var(--text-primary);
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 13px;
    outline: none;
    transition: var(--transition);
}

.table-search input:focus {
    border-color: var(--accent-primary);
}

/* === Responsive === */
@media (max-width: 1024px) {
    .scores-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 768px) {
    .header-content {
        height: 56px;
    }

    .search-card {
        padding: 28px 20px;
    }

    .search-title {
        font-size: 24px;
    }

    .main {
        padding: 16px;
    }

    .scores-grid {
        grid-template-columns: 1fr 1fr;
    }

    .score-overall {
        grid-column: 1 / -1;
    }

    .panel-grid {
        grid-template-columns: 1fr;
    }

    .charts-grid {
        grid-template-columns: 1fr;
    }

    .details-grid {
        grid-template-columns: 1fr;
    }

    .tabs-nav {
        gap: 2px;
        padding: 4px;
    }

    .tab-btn {
        padding: 8px 12px;
        font-size: 12px;
    }

    .input-group {
        flex-wrap: nowrap;
    }

    #domainInput {
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .scores-grid {
        grid-template-columns: 1fr;
    }

    .search-title {
        font-size: 20px;
    }

    .logo-sub {
        display: none;
    }

    .export-buttons {
        flex-wrap: wrap;
    }
}

/* === Language Switcher === */
.lang-switcher {
    display: flex;
    gap: 4px;
    background: rgba(99, 102, 241, 0.06);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 3px;
}

.lang-btn {
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 700;
    text-decoration: none;
    color: var(--text-muted);
    border-radius: 6px;
    transition: var(--transition);
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.lang-btn:hover {
    color: var(--text-primary);
    background: rgba(99, 102, 241, 0.1);
}

.lang-btn.active {
    color: #fff;
    background: var(--accent-gradient);
    box-shadow: none;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* === RTL Support === */
[dir="rtl"] body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

[dir="rtl"] .data-label {
    text-align: right;
}

[dir="rtl"] .data-value {
    text-align: left;
}

[dir="rtl"] .ns-item,
[dir="rtl"] .mx-item,
[dir="rtl"] .san-item {
    border-left: none;
    border-right: 3px solid var(--accent-primary);
}

[dir="rtl"] .chain-item {
    border-left: none;
    border-right: 3px solid var(--accent-secondary);
}

[dir="rtl"] .ai-item {
    border-left: none;
    border-right: 3px solid var(--accent-primary);
}

[dir="rtl"] .heading-h1 {
    border-left: none;
    border-right: 3px solid #6366f1;
}

[dir="rtl"] .heading-h2 {
    border-left: none;
    border-right: 3px solid #06b6d4;
    margin-left: 0;
    margin-right: 16px;
}

[dir="rtl"] .heading-h3 {
    border-left: none;
    border-right: 3px solid #8b5cf6;
    margin-left: 0;
    margin-right: 32px;
}

[dir="rtl"] .heading-tag {
    margin-right: 0;
    margin-left: 8px;
}

[dir="rtl"] .input-icon {
    padding: 0 16px 0 12px;
}

[dir="rtl"] .keyword-pct {
    text-align: left;
}

[dir="rtl"] .status-item {
    flex-direction: row-reverse;
}

[dir="rtl"] .status-item span:first-child {
    order: 2;
}

[dir="rtl"] .link-item {
    flex-direction: row-reverse;
}

[dir="rtl"] .recent-card {
    flex-direction: row-reverse;
}

[dir="rtl"] .logo {
    flex-direction: row-reverse;
}

[dir="rtl"] .section-header {
    flex-direction: row-reverse;
}

[dir="rtl"] .score-label,
[dir="rtl"] .search-title,
[dir="rtl"] .search-subtitle,
[dir="rtl"] .footer {
    text-align: center;
}

/* Chinese font */
[lang="zh"] body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* === Print === */
@media print {

    .ambient-bg,
    .header,
    .footer,
    .search-section,
    .tabs-nav,
    .loading-overlay,
    .export-buttons,
    .recent-section,
    .lang-switcher {
        display: none !important;
    }

    body {
        background: #fff;
        color: #000;
    }

    .glass {
        background: #fff;
        border: 1px solid #e5e7eb;
        box-shadow: none;

    }

    /* Force all tabs to be visible and stacked in the printed report */
    .tabs-content {
        display: block !important;
    }

    .tab-panel {
        display: block !important;
        opacity: 1 !important;
        visibility: visible !important;
        position: relative !important;
        margin-bottom: 40px !important;
        page-break-inside: avoid;
    }

    .tab-panel::before {
        content: attr(id);
        display: block;
        font-size: 18px;
        font-weight: bold;
        text-transform: uppercase;
        margin-bottom: 16px;
        color: #333;
        border-bottom: 2px solid #eee;
        padding-bottom: 8px;
    }

    .chart-card {
        page-break-inside: avoid;
    }
}

/* ═══════════════════════════════════════
   UNIFIED HEADER & FOOTER
   ═══════════════════════════════════════ */
.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 24px;
    background: #0a0e1a;


    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.top-bar-left,
.top-bar-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.back-btn {
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
    color: #f1f5f9;
    background: #111827;
    padding: 8px 14px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.back-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}

.brand-chip {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    font-size: 0.95rem;
    padding: 6px 12px;
    border-radius: 20px;
    background: rgba(99, 102, 241, 0.1);
    color: #f1f5f9;
    border: 1px solid rgba(99, 102, 241, 0.2);
}

.brand-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #10b981;
    box-shadow: none;

}

@keyframes pulse {
    0% {
        transform: scale(0.95);
        box-shadow: none;
    }

    70% {
        transform: scale(1);
        box-shadow: none;
    }

    100% {
        transform: scale(0.95);
        box-shadow: none;
    }
}

.lang-switcher {
    display: flex;
    gap: 4px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 4px;
}

.lang-btn {
    padding: 6px 12px;
    font-size: 0.8rem;
    font-weight: 600;
    text-decoration: none;
    color: rgba(255, 255, 255, 0.6);
    border-radius: 6px;
    transition: all 0.3s;
    text-transform: uppercase;
}

.lang-btn:hover {
    color: #fff;
    background: #111827;
}

.lang-btn.active {
    color: #fff;
    background: linear-gradient(135deg, #6366f1, #06b6d4);
    box-shadow: none;
}

.unified-footer {
    text-align: center;
    padding: 30px 20px;
    margin-top: 50px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    background: #0a0e1a;
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    font-size: 1.1rem;
    color: #fff;
}

.footer-logo span:last-child {
    font-size: 0.7rem;
    background: linear-gradient(135deg, #6366f1, #06b6d4);
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 800;
    letter-spacing: 1px;
}

.unified-footer p {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.85rem;
    margin: 0;
}

@media (max-width: 768px) {
    .top-bar {
        padding: 10px 14px;
        flex-wrap: nowrap;
    }

    .hidden-mobile {
        display: none !important;
    }

    .back-btn {
        padding: 6px 10px;
        font-size: 0.85rem;
    }

    .lang-btn {
        padding: 6px 8px;
        font-size: 0.75rem;
    }

    /* Fix Analyze Button Position on Mobile */
    .input-group {
        flex-direction: column;
        background: transparent;
        border: none;
        padding: 0;
        gap: 10px;
    }

    #domainInput {
        width: 100%;
        background: var(--bg-secondary);
        border: 2px solid var(--border);
        border-radius: 12px;
        padding: 14px 16px !important;
        text-align: center;
    }

    .input-icon {
        display: none;
    }

    .input-group .btn-primary {
        width: 100%;
        justify-content: center;
        padding: 14px;
        font-size: 16px;
        border-radius: 12px;
    }

    /* FIX MOBILE PADDING EDGES! */
    .container,
    .main,
    .app-container {
        padding-left: 10px !important;
        padding-right: 10px !important;
        padding-bottom: 20px !important;
        overflow-x: hidden !important;
    }

    .main {
        outline: none;
    }

    .glass,
    .glass-card,
    .card,
    .chart-card,
    .search-card,
    .stat-card {
        border-radius: 12px;
    }

    .scores-grid,
    .stats-grid,
    .form-grid {
        gap: 10px !important;
    }
}