/* Scanner UI - Cyber Theme */
.scanner-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #0f172a;
    /* Dark Blue/Black */
    /* Dark Blue/Black */
    z-index: 9999;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    /* Changed from center to allow scrolling from top */
    color: #0ea5e9;
    font-family: 'Courier New', Courier, monospace;
    overflow-y: auto;
    /* Enable Vertical Scroll */
    padding: 20px 0;
    /* Add top/bottom padding */
}

/* Global Overflow Fix */
html,
body {
    overflow-x: hidden;
    max-width: 100%;
}

.radar-container {
    width: 200px;
    height: 200px;
    position: relative;
    border: 2px solid rgba(14, 165, 233, 0.3);
    border-radius: 50%;
    background: radial-gradient(circle, rgba(14, 165, 233, 0.1) 0%, rgba(0, 0, 0, 0) 70%);
    box-shadow: 0 0 20px rgba(14, 165, 233, 0.2);
    margin-bottom: 40px;
}

.radar-sweep {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: conic-gradient(from 0deg, transparent 0deg, rgba(14, 165, 233, 0.6) 360deg);
    animation: radar-spin 2s linear infinite;
    mask-image: radial-gradient(circle, transparent 40%, black 100%);
    -webkit-mask-image: radial-gradient(circle, transparent 40%, black 100%);
}

.radar-dot {
    position: absolute;
    width: 6px;
    height: 6px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 0 8px #fff;
    animation: blink 1s infinite alternate;
}

@keyframes radar-spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

@keyframes blink {
    from {
        opacity: 0.3;
    }

    to {
        opacity: 1;
    }
}

.scan-message {
    font-size: 1.5rem;
    color: #fff;
    margin-bottom: 30px;
    text-shadow: 0 0 10px rgba(14, 165, 233, 0.5);
    font-weight: bold;
    letter-spacing: 1px;
}

.modules-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    max-width: 600px;
    width: 90%;
}

.module-item {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(14, 165, 233, 0.2);
    padding: 15px;
    border-radius: 8px;
    text-align: center;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: #64748b;
}

.module-item svg {
    opacity: 0.5;
    transition: 0.3s;
}

.module-item.active {
    border-color: #0ea5e9;
    background: rgba(14, 165, 233, 0.1);
    color: #fff;
    box-shadow: 0 0 15px rgba(14, 165, 233, 0.2);
}

.module-item.active svg {
    opacity: 1;
    color: #0ea5e9;
    animation: bounce 1s infinite;
}

.module-item.done {
    border-color: #10b981;
    /* Green */
    color: #10b981;
    background: rgba(16, 185, 129, 0.1);
}

.module-item.done svg {
    color: #10b981;
    opacity: 1;
    animation: none;
}

@keyframes bounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-5px);
    }
}

/* Progress Bar */
.progress-container {
    width: 80%;
    max-width: 400px;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    margin-top: 30px;
    border-radius: 2px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    width: 0%;
    background: #0ea5e9;
    box-shadow: 0 0 10px #0ea5e9;
    transition: width 0.4s ease;
}

/* Device Toggle (PSI Style) */
.device-btn {
    background: transparent;
    border: none;
    color: #94a3b8;
    padding: 8px 16px;
    border-radius: 20px;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.device-btn:hover {
    color: #e2e8f0;
    background: rgba(255, 255, 255, 0.05);
}

.device-btn.active {
    background: #0ea5e9;
    /* PSI Blue-ish */
    color: #fff;
    box-shadow: 0 4px 6px -1px rgba(14, 165, 233, 0.2), 0 2px 4px -1px rgba(14, 165, 233, 0.1);
}

/* --- Mobile Menu Integration (Theme Overrides Only) --- */
/* Layout handled by style.css - We only apply Cyber Theme colors here */

.mobile-menu-overlay {
    background: rgba(0, 0, 0, 0.9) !important;
    /* Darker for Scanner */
    z-index: 100005 !important;
    /* Force on top of everything including Scanner Overlay (9999) */
}

.mobile-menu-content {
    background: #0f172a !important;
    /* Cyber Dark */
    border-left: 1px solid rgba(14, 165, 233, 0.2);
    box-shadow: -5px 0 20px rgba(14, 165, 233, 0.1);
}

html[dir="rtl"] .mobile-menu-content {
    border-left: none;
    border-right: 1px solid rgba(14, 165, 233, 0.2);
}

.close-menu-btn {
    color: #fff !important;
}

.mobile-nav-list a {
    color: #94a3b8 !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05) !important;
}

.mobile-nav-list a.active,
.mobile-nav-list a:hover {
    color: #0ea5e9 !important;
    background: rgba(14, 165, 233, 0.05) !important;
}

.mobile-menu-actions {
    margin-top: auto;
    padding-top: 20px;
}

/* Mobile Menu Button styles removed to defer to style.css */

/* The following properties are now handled by the global style.css for structural layout */
/*
.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    display: flex;
    justify-content: flex-start;
}

html[dir="rtl"] .mobile-menu-overlay {
    justify-content: flex-start;
}

.mobile-menu-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.mobile-menu-content {
    width: 280px;
    height: 100%;
    padding: 20px;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
}

html[dir="rtl"] .mobile-menu-content {
    transform: translateX(-100%);
}

.mobile-menu-overlay.active .mobile-menu-content {
    transform: translateX(0);
}

.close-menu-btn {
    align-self: flex-end;
    margin-bottom: 20px;
}

html[dir="rtl"] .close-menu-btn {
    align-self: flex-start;
}

.mobile-nav-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.mobile-nav-list a {
    font-size: 1.1rem;
    font-weight: 600;
    display: block;
    padding: 10px;
    text-decoration: none;
}

*/

@media (max-width: 768px) {
    .radar-container {
        width: 150px;
        height: 150px;
        margin-bottom: 20px;
    }

    .scan-message {
        font-size: 1.2rem;
        text-align: center;
        padding: 0 10px;
    }

    .modules-grid {
        grid-template-columns: repeat(2, 1fr);
        /* 2 cols on tablet/large phone */
        gap: 10px;
    }

    .analysis-grid {
        grid-template-columns: 1fr !important;
        /* Force single column stack */
    }

    .glass-card {
        margin-bottom: 20px;
    }

    /* Force Table Card Layout for Mobile */
    .spider-table thead {
        display: none;
    }

    .spider-table tbody tr {
        display: block;
        background: rgba(255, 255, 255, 0.05);
        border: 1px solid rgba(255, 255, 255, 0.1);
        border-radius: 12px;
        margin-bottom: 15px;
        padding: 15px;
    }

    .spider-table td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 10px 0;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
        text-align: left;
    }

    .spider-table td:last-child {
        border-bottom: none;
    }

    .spider-table td::before {
        content: attr(data-label);
        font-weight: bold;
        color: var(--text-dim);
        margin-right: 10px;
    }

    /* RTL Support for Card Layout */
    html[dir="rtl"] .spider-table td {
        text-align: right;
    }

    html[dir="rtl"] .spider-table td::before {
        margin-right: 0;
        margin-left: 10px;
    }
}

@media (max-width: 480px) {
    .radar-container {
        width: 120px;
        height: 120px;
    }

    .modules-grid {
        grid-template-columns: 1fr;
        /* Stack on small mobile */
    }

    .device-btn {
        padding: 6px 12px;
        font-size: 0.8rem;
    }

    /* Force Table Scrolling */
    /* Force Table Scrolling */
    .table-container,
    .spider-table-wrapper {
        overflow-x: auto !important;
        display: block;
        width: 100%;
        -webkit-overflow-scrolling: touch;
        margin-bottom: 20px;
        border: 1px solid rgba(255, 255, 255, 0.1);
        border-radius: 8px;
    }

    .data-table,
    .spider-table {
        min-width: 600px;
        /* Force scroll trigger */
    }

    /* Adjust Status Bar */
    .status-badge {
        font-size: 0.75rem;
        padding: 4px 8px;
    }

    /* Fix Stats Grid Mobile */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        /* 2 cols instead of squashed 6 */
        gap: 10px !important;
    }

    .stat-card {
        padding: 15px !important;
    }

    .stat-val {
        font-size: 1.5rem !important;
    }
}

/* Ensure Analysis Grid Fits Small Screens globally */
.analysis-grid {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    /* Reduced from 350px */
}


.full-width {
    width: 100%;
    justify-content: center;
    border-color: rgba(255, 255, 255, 0.2);
    color: white;
}

/* Mobile Header Response - Handled by style.css */
/* Removed conflicting overrides */