/* AuraScan Design System: AuraSpace Theme */
:root {
    --bg-primary: #07080d;
    --bg-surface: rgba(15, 18, 36, 0.45);
    --bg-surface-hover: rgba(23, 27, 54, 0.6);
    --border-color: rgba(255, 255, 255, 0.06);
    --border-color-glow: rgba(139, 92, 246, 0.25);
    
    /* Core Gradients & Accents */
    --accent-primary: #8b5cf6;     /* Deep Space Violet */
    --accent-secondary: #06b6d4;   /* Cyber Cyan */
    --accent-glow: radial-gradient(circle, rgba(139,92,246,0.15) 0%, rgba(6,182,212,0.05) 50%, transparent 100%);
    
    /* Semantic Colors */
    --success: #10b981;
    --warning: #f59e0b;
    --critical: #ef4444;
    --info: #3b82f6;
    
    /* Text Colors */
    --text-primary: #f3f4f6;
    --text-secondary: #9ca3af;
    --text-muted: #6b7280;
    
    /* UI Sizing & Animation Defaults */
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 24px;
    --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-smooth: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --font-main: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

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

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: var(--font-main);
    line-height: 1.6;
    overflow-x: hidden;
    background-image: radial-gradient(circle at 10% 20%, rgba(139, 92, 246, 0.08) 0%, transparent 40%),
                      radial-gradient(circle at 90% 80%, rgba(6, 182, 212, 0.08) 0%, transparent 40%);
    background-attachment: fixed;
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(139, 92, 246, 0.4);
}

/* Layout container */
.app-container {
    max-width: 1300px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

/* Glowing background helpers */
.glow-bg {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60vw;
    height: 60vw;
    background: var(--accent-glow);
    z-index: -1;
    pointer-events: none;
    filter: blur(100px);
}

/* Glass card pattern */
.glass-card {
    background: var(--bg-surface);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.75rem;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
    transition: transform var(--transition-smooth), border-color var(--transition-smooth), box-shadow var(--transition-smooth);
}

.glass-card:hover {
    border-color: var(--border-color-glow);
    box-shadow: 0 12px 40px 0 rgba(139, 92, 246, 0.12);
}

/* Header Branding styling */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 3rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo-icon-svg {
    width: 38px;
    height: 38px;
    fill: none;
    stroke: url(#logoGradient);
    stroke-width: 2.5;
    filter: drop-shadow(0 0 8px rgba(139, 92, 246, 0.6));
    animation: pulseGlow 3s infinite alternate;
}

.logo-text h1 {
    font-size: 1.6rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, #fff 30%, var(--accent-secondary) 100%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.logo-text p {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-top: -2px;
}

.theme-toggle-btn {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 0.6rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.theme-toggle-btn:hover {
    background: rgba(139, 92, 246, 0.1);
    color: var(--text-primary);
    border-color: var(--accent-primary);
}

/* Search Card styling */
.audit-search-section {
    margin-bottom: 2.5rem;
}

.search-card {
    background: var(--bg-surface);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-lg);
    padding: 2.25rem;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.4);
}

.search-card h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.35rem;
}

.search-card p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.search-form {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 1.2rem;
    color: var(--text-muted);
    width: 18px;
    height: 18px;
    pointer-events: none;
    transition: color var(--transition-fast);
}

.search-form input {
    width: 100%;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.95rem 1.2rem 0.95rem 2.8rem;
    color: #fff;
    font-family: inherit;
    font-size: 0.92rem;
    outline: none;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.search-form input:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.15);
}

.search-form input:focus + .input-icon {
    color: var(--accent-primary);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    padding: 0.95rem 1.75rem;
    font-family: inherit;
    font-size: 0.92rem;
    font-weight: 600;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    transition: all var(--transition-smooth);
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-primary) 0%, #7c3aed 100%);
    color: #fff;
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(139, 92, 246, 0.45);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.15);
}

.btn-full {
    width: 100%;
}

/* Main Dashboard layout */
.dashboard-grid {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 1.5rem;
    width: 100%;
}

.db-sidebar {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    min-width: 0;
}

.db-main {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    min-width: 0;
}

/* Score radial gauge */
.score-card {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.25rem;
}

.score-card h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.gauge-container {
    position: relative;
    width: 140px;
    height: 140px;
}

.gauge {
    width: 100%;
    height: 100%;
}

.gauge-bg {
    fill: none;
    stroke: rgba(255, 255, 255, 0.03);
    stroke-width: 8;
}

.gauge-val {
    fill: none;
    stroke-width: 8;
    stroke-linecap: round;
    transition: stroke-dashoffset 1.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.gauge-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    align-items: baseline;
    justify-content: center;
}

.gauge-text span:first-child {
    font-size: 3.2rem;
    font-weight: 800;
    line-height: 1;
}

.gauge-text .pct {
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin-left: 2px;
}

.score-label {
    font-size: 1.1rem;
    font-weight: 700;
    padding: 0.35rem 1.2rem;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.04);
}

.score-label.excellent { color: var(--success); background: rgba(16, 185, 129, 0.1); }
.score-label.good { color: var(--info); background: rgba(59, 130, 246, 0.1); }
.score-label.warning { color: var(--warning); background: rgba(245, 158, 11, 0.1); }
.score-label.critical { color: var(--critical); background: rgba(239, 68, 68, 0.1); }

.card-divider {
    width: 100%;
    border: 0;
    height: 1px;
    background: var(--border-color);
}

/* Quick Stats widgets */
.quick-stats {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.q-stat {
    display: flex;
    align-items: center;
    gap: 1rem;
    text-align: left;
}

.q-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
}

.q-icon.ssl-ok { color: var(--success); background: rgba(16, 185, 129, 0.08); border-color: rgba(16, 185, 129, 0.2); }
.q-icon.ssl-bad { color: var(--critical); background: rgba(239, 68, 68, 0.08); border-color: rgba(239, 68, 68, 0.2); }
.q-icon.load-fast { color: var(--success); background: rgba(16, 185, 129, 0.08); }
.q-icon.load-slow { color: var(--warning); background: rgba(245, 158, 11, 0.08); }

.q-info {
    display: flex;
    flex-direction: column;
}

.q-label {
    font-size: 0.78rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.q-val {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* Meta info cards styling */
.meta-info-card {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.meta-info-card h4 {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
}

.target-link {
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--radius-sm);
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border-color);
    word-break: break-all;
}

.url-badge {
    font-size: 0.85rem;
    color: var(--accent-secondary);
    font-weight: 600;
}

.meta-field {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    margin-bottom: 0.75rem;
}

.meta-field label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
}

.meta-field p {
    font-size: 0.88rem;
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.03);
    padding: 0.6rem 0.75rem;
    border-radius: var(--radius-sm);
}

.card-actions {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    margin-top: 1rem;
}

/* Sub-scores metrics grid */
.sub-scores-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
}

.sub-score-card {
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.sub-score-title {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.sub-score-val {
    font-size: 1.6rem;
    font-weight: 800;
}

.sub-score-bar-bg {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 2px;
    overflow: hidden;
}

.sub-score-bar-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
    border-radius: 2px;
    transition: width 1.2s ease-in-out;
}

/* Tabbed controls */
.tab-navigation {
    display: flex;
    flex-wrap: wrap;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    padding: 6px;
    border-radius: var(--radius-md);
    margin-top: 1.5rem;
    gap: 0.35rem;
}
.tab-btn {
    flex: 1 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.8rem 1.25rem;
    border-radius: 10px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 0.86rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: all var(--transition-smooth);
}

.tab-btn:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.03);
}

.tab-btn.active {
    background: var(--accent-primary);
    color: #fff;
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.25);
}

/* Tab panes content layout */
.tab-content-container {
    margin-top: 1.5rem;
}

.tab-pane {
    display: none;
    animation: tabFadeIn 0.35s ease;
}

.tab-pane.active {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

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

.tab-header-info h3 {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.tab-header-info p {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* Filter controls inside tabs */
.filter-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
}

.filter-bar span {
    font-size: 0.82rem;
    color: var(--text-muted);
}

.filter-chips {
    display: flex;
    gap: 0.5rem;
}

.chip {
    padding: 0.35rem 0.8rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 20px;
    border: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.chip.active {
    background: var(--text-primary);
    color: var(--bg-primary);
}

.chip-critical.active { background: var(--critical); color: #fff; }
.chip-warning.active { background: var(--warning); color: #fff; }
.chip-info.active { background: var(--info); color: #fff; }

/* Problem report list styling */
.issues-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.issue-card {
    display: grid;
    grid-template-columns: 48px 1fr;
    gap: 1rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    padding: 1.25rem;
    border-radius: var(--radius-sm);
    transition: transform var(--transition-fast);
}

.issue-card:hover {
    transform: translateX(4px);
}

.issue-card.critical { border-left: 4px solid var(--critical); }
.issue-card.warning { border-left: 4px solid var(--warning); }
.issue-card.info { border-left: 4px solid var(--info); }

.issue-badge {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.issue-card.critical .issue-badge { background: rgba(239, 68, 68, 0.1); color: var(--critical); }
.issue-card.warning .issue-badge { background: rgba(245, 158, 11, 0.1); color: var(--warning); }
.issue-card.info .issue-badge { background: rgba(59, 130, 246, 0.1); color: var(--info); }

.issue-details h5 {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.issue-details p {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.issue-solution {
    margin-top: 0.6rem;
    font-size: 0.8rem;
    padding: 0.5rem 0.75rem;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 4px;
    color: var(--text-primary);
    border-left: 2px solid rgba(255, 255, 255, 0.1);
}

.issue-solution code {
    font-family: monospace;
    background: rgba(0, 0, 0, 0.2);
    padding: 1px 4px;
    border-radius: 3px;
    color: var(--accent-secondary);
}

/* Headings outline hierarchy tree */
.headings-tree-container {
    background: rgba(0, 0, 0, 0.15);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 1.5rem;
}

.headings-tree {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.tree-node {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-family: inherit;
    font-size: 0.88rem;
    padding: 0.4rem 0.75rem;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.01);
    border: 1px solid rgba(255, 255, 255, 0.02);
}

.tree-node .node-level {
    font-size: 0.72rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.08);
}

.tree-node.h1 { margin-left: 0rem; border-left: 3px solid var(--accent-primary); }
.tree-node.h1 .node-level { background: rgba(139, 92, 246, 0.2); color: #c084fc; }
.tree-node.h2 { margin-left: 1.5rem; }
.tree-node.h3 { margin-left: 3rem; }
.tree-node.h4 { margin-left: 4.5rem; }
.tree-node.h5 { margin-left: 6rem; }
.tree-node.h6 { margin-left: 7.5rem; }

/* Content stats styles */
.content-stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.content-metric-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    padding: 1.25rem;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.content-metric-card .metric-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.03);
    color: var(--accent-primary);
    display: flex;
    align-items: center;
    justify-content: center;
}

.content-metric-card .metric-info {
    display: flex;
    flex-direction: column;
}

.content-metric-card .metric-val {
    font-size: 1.35rem;
    font-weight: 700;
}

.content-metric-card .metric-label {
    font-size: 0.78rem;
    color: var(--text-muted);
    text-transform: uppercase;
}

/* Links & Images structures */
.split-cards-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

.mini-status-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.mini-status-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.mini-status-header h4 {
    font-size: 0.95rem;
    font-weight: 600;
}

.badge {
    font-size: 0.72rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 10px;
    text-transform: uppercase;
}

.badge.green { background: rgba(16, 185, 129, 0.1); color: var(--success); }
.badge.orange { background: rgba(245, 158, 11, 0.1); color: var(--warning); }
.badge.red { background: rgba(239, 68, 68, 0.1); color: var(--critical); }

.stat-large {
    font-size: 2.2rem;
    font-weight: 800;
}

.stat-large .stat-small {
    font-size: 0.9rem;
    font-weight: 400;
    color: var(--text-muted);
    margin-left: 6px;
}

.link-scroller-box {
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    overflow-y: auto;
    overflow-x: auto;
    max-width: 100%;
}

.data-table {
    width: 100%;
    min-width: 550px;
    border-collapse: collapse;
    font-size: 0.8rem;
    text-align: left;
}

.data-table th {
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid var(--border-color);
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
}

.data-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    white-space: nowrap;
}

.data-table td:first-child {
    white-space: normal;
    word-break: break-all;
}

.link-ok { color: var(--success); font-weight: 600; }
.link-bad { color: var(--critical); font-weight: 600; }

/* Loading UI state container */
.loader-container {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4rem 1rem;
    width: 100%;
}

.loader-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color-glow);
    border-radius: var(--radius-md);
    padding: 2.5rem;
    max-width: 450px;
    text-align: center;
    box-shadow: 0 10px 40px rgba(139, 92, 246, 0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.25rem;
}

.spinner {
    width: 50px;
    height: 50px;
    position: relative;
}

.double-bounce1, .double-bounce2 {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background-color: var(--accent-primary);
    opacity: 0.6;
    position: absolute;
    top: 0;
    left: 0;
    animation: bounce 2.0s infinite ease-in-out;
}

.double-bounce2 {
    background-color: var(--accent-secondary);
    animation-delay: -1.0s;
}

@keyframes bounce {
    0%, 100% { transform: scale(0.0); }
    50% { transform: scale(1.0); }
}

.loader-progress-bar {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 3px;
    overflow: hidden;
}

.loader-progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
    border-radius: 3px;
    animation: loaderProgress 15s linear forwards;
}

@keyframes loaderProgress {
    0% { width: 0%; }
    90% { width: 95%; }
    100% { width: 95%; }
}

/* Animations and helpers */
.hidden {
    display: none !important;
}

@keyframes pulseGlow {
    from { filter: drop-shadow(0 0 4px rgba(139, 92, 246, 0.4)); }
    to { filter: drop-shadow(0 0 12px rgba(6, 182, 212, 0.7)); }
}

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

@media (max-width: 768px) {
    .sub-scores-grid {
        grid-template-columns: 1fr 1fr;
    }
    .split-cards-row {
        grid-template-columns: 1fr;
    }
    .content-stats-grid {
        grid-template-columns: 1fr;
    }
    .search-form {
        flex-direction: column;
        align-items: stretch;
    }
}

@media (max-width: 480px) {
    .app-container {
        padding: 1rem 0.75rem;
    }
    .glass-card {
        padding: 1rem;
    }
    .gauge-container {
        width: 120px;
        height: 120px;
    }
    .gauge-text span:first-child {
        font-size: 2.5rem;
    }
    .sub-scores-grid {
        grid-template-columns: 1fr;
    }
}

/* Help & FAQ Modal Overlay Styles */
.help-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(7, 8, 13, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-smooth);
}

.help-overlay.show {
    opacity: 1;
    pointer-events: auto;
}

.help-modal {
    background: #0f1224;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 900px;
    height: 80%;
    max-height: 650px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 24px 60px rgba(0,0,0,0.6);
    transform: translateY(20px);
    transition: transform var(--transition-smooth);
}

.help-overlay.show .help-modal {
    transform: translateY(0);
}

.help-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.01);
}

.help-header h2 {
    font-size: 1.25rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-primary);
    margin: 0;
}

.help-close-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.25rem;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color var(--transition-fast), color var(--transition-fast);
}

.help-close-btn:hover {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-primary);
}

.help-body {
    display: flex;
    flex: 1;
    overflow: hidden;
}

.help-sidebar {
    width: 240px;
    border-right: 1px solid var(--border-color);
    padding: 1.25rem;
    background: rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    overflow-y: auto;
}

.help-nav-btn {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 0.88rem;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.help-nav-btn:hover {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-primary);
}

.help-nav-btn.active {
    background: var(--accent-primary);
    color: #fff;
}

.help-content {
    flex: 1;
    padding: 1.75rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.help-section {
    display: none;
}

.help-section.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

.help-section h3 {
    font-size: 1.15rem;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.5rem;
}

.help-section p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 1rem;
    line-height: 1.6;
}

.help-section-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 1rem 1.25rem;
    margin-bottom: 1rem;
}

.help-section-card h4 {
    font-size: 0.92rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.help-step-badge {
    background: var(--accent-secondary);
    color: #07080d;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 10px;
    text-transform: uppercase;
}

/* FAQ Accordions */
.faq-accordion {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 1rem;
}

.faq-item {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.01);
    overflow: hidden;
    transition: border-color var(--transition-fast);
}

.faq-item:hover {
    border-color: rgba(255, 255, 255, 0.12);
}

.faq-question {
    width: 100%;
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: rgba(0, 0, 0, 0.15);
}

.faq-answer-inner {
    padding: 1rem;
    color: var(--text-secondary);
    font-size: 0.86rem;
    line-height: 1.5;
    border-top: 1px solid var(--border-color);
}

.faq-chevron {
    transition: transform 0.3s ease;
    color: var(--text-muted);
}

.faq-item.active .faq-chevron {
    transform: rotate(180deg);
    color: var(--accent-secondary);
}

.faq-item.active {
    border-color: var(--accent-secondary);
}

@media (max-width: 768px) {
    .help-body {
        flex-direction: column;
    }
    .help-sidebar {
        width: 100%;
        height: auto;
        flex-direction: row;
        overflow-x: auto;
    }
}

/* Light Theme Variables & Overrides */
[data-theme="light"] {
    --bg-primary: #f0f4f8;
    --bg-surface: rgba(255, 255, 255, 0.85);
    --bg-surface-hover: rgba(255, 255, 255, 1);
    --border-color: rgba(0, 0, 0, 0.1);
    --border-color-glow: rgba(139, 92, 246, 0.3);
    --accent-primary: #7c3aed;
    --accent-secondary: #0891b2;
    --accent-glow: radial-gradient(circle, rgba(139,92,246,0.1) 0%, rgba(6,182,212,0.05) 50%, transparent 100%);
    --success: #059669;
    --warning: #d97706;
    --critical: #dc2626;
    --info: #2563eb;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #64748b;
}

[data-theme="light"] body {
    background-image: radial-gradient(circle at 10% 20%, rgba(139, 92, 246, 0.05) 0%, transparent 40%),
                      radial-gradient(circle at 90% 80%, rgba(6, 182, 212, 0.05) 0%, transparent 40%);
}

[data-theme="light"] .logo-text h1 {
    background: linear-gradient(135deg, #000000 30%, var(--accent-secondary) 100%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

[data-theme="light"] .glass-card {
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.05);
}
[data-theme="light"] .search-form input {
    background: rgba(255, 255, 255, 0.9);
    color: var(--text-primary);
}
[data-theme="light"] .theme-toggle-btn,
[data-theme="light"] .btn-secondary,
[data-theme="light"] .q-icon,
[data-theme="light"] .chip,
[data-theme="light"] .issue-card,
[data-theme="light"] .tree-node,
[data-theme="light"] .content-metric-card,
[data-theme="light"] .mini-status-card,
[data-theme="light"] .help-nav-btn {
    background: rgba(0, 0, 0, 0.03);
}
[data-theme="light"] .theme-toggle-btn:hover,
[data-theme="light"] .btn-secondary:hover,
[data-theme="light"] .chip:hover,
[data-theme="light"] .help-nav-btn:hover {
    background: rgba(0, 0, 0, 0.08);
}
[data-theme="light"] .score-label {
    background: rgba(0, 0, 0, 0.04);
}
[data-theme="light"] .target-link,
[data-theme="light"] .filter-bar,
[data-theme="light"] .headings-tree-container,
[data-theme="light"] .help-section-card,
[data-theme="light"] .faq-answer {
    background: rgba(0, 0, 0, 0.05);
}
[data-theme="light"] .meta-field p,
[data-theme="light"] .issue-solution {
    background: rgba(255, 255, 255, 0.5);
    border-color: rgba(0, 0, 0, 0.05);
}
[data-theme="light"] .tab-navigation {
    background: rgba(0, 0, 0, 0.03);
}
[data-theme="light"] .tab-btn:hover {
    background: rgba(0, 0, 0, 0.05);
}
[data-theme="light"] .tab-btn.active {
    background: var(--accent-primary);
    color: #fff;
}
[data-theme="light"] .issue-solution code {
    background: rgba(0, 0, 0, 0.06);
    color: var(--accent-primary);
}
[data-theme="light"] .sub-score-bar-bg,
[data-theme="light"] .loader-progress-bar,
[data-theme="light"] .cwv-card {
    background: rgba(0, 0, 0, 0.04);
}
[data-theme="light"] .gauge-bg {
    stroke: rgba(0, 0, 0, 0.05);
}
[data-theme="light"] ::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
}
[data-theme="light"] ::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.15);
}
[data-theme="light"] ::-webkit-scrollbar-thumb:hover {
    background: rgba(139, 92, 246, 0.6);
}

@media print {
    body {
        background: #ffffff !important;
        color: #000000 !important;
    }
    .glow-bg,
    .header,
    .audit-search-section,
    .tab-navigation,
    .filter-bar,
    .card-actions,
    #loadMoreWrapper,
    .loader-container,
    .help-overlay {
        display: none !important;
    }
    .app-container {
        max-width: 100% !important;
        padding: 0 !important;
    }
    .dashboard-grid {
        display: block !important;
    }
    .db-sidebar, .db-main {
        width: 100% !important;
        display: block !important;
    }
    .glass-card {
        background: #ffffff !important;
        border: 1px solid #dddddd !important;
        box-shadow: none !important;
        color: #000000 !important;
        page-break-inside: avoid;
        margin-bottom: 2rem;
        padding: 1.5rem !important;
    }
    .tab-pane {
        display: block !important;
        opacity: 1 !important;
        transform: none !important;
        page-break-inside: avoid;
        margin-bottom: 2rem;
    }
    .tab-content-container {
        margin-top: 0 !important;
    }
    .sub-scores-grid {
        grid-template-columns: repeat(5, 1fr) !important;
    }
    .data-table th {
        background: #f5f5f5 !important;
        color: #333333 !important;
    }
    .data-table td {
        border-bottom: 1px solid #dddddd !important;
        color: #111111 !important;
    }
    h1, h2, h3, h4, h5, h6 {
        color: #000000 !important;
    }
}

/* Recent Audits styles */
.recent-audits-container {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 1.25rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border-color);
    flex-wrap: wrap;
}
.recent-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.recent-chips {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    flex: 1;
}
.recent-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    padding: 0.35rem 0.75rem;
    border-radius: 20px;
    font-size: 0.78rem;
    cursor: pointer;
    color: var(--text-secondary);
    transition: all var(--transition-fast);
}
.recent-chip:hover {
    background: rgba(139, 92, 246, 0.1);
    color: var(--text-primary);
    border-color: var(--accent-primary);
}
.recent-chip .score-badge {
    font-weight: 700;
    padding: 1px 5px;
    border-radius: 10px;
    font-size: 0.7rem;
}
.recent-chip .score-badge.critical { background: rgba(239, 68, 68, 0.15); color: var(--critical); }
.recent-chip .score-badge.warning { background: rgba(245, 158, 11, 0.15); color: var(--warning); }
.recent-chip .score-badge.good { background: rgba(59, 130, 246, 0.15); color: var(--info); }
.recent-chip .score-badge.excellent { background: rgba(16, 185, 129, 0.15); color: var(--success); }

.clear-history-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all var(--transition-fast);
}
.clear-history-btn:hover {
    color: var(--critical);
    background: rgba(239, 68, 68, 0.1);
}
