:root {
    --neon-green: #0f0;
    --neon-blue: #00f3ff;
    --neon-purple: #bc13fe;
    --neon-gold: #ffd700;
    --dark-bg: #050505;
    --panel-bg: #111;
}

header {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    font-family: 'Rajdhani', sans-serif;
}

[data-theme="light"] {
    --dark-bg: #f3f4f6;
    --panel-bg: #ffffff;
    --text-main: #1f2937;
    --text-muted: #4b5563;
}

body {
    background-color: var(--dark-bg);
    color: #e0e0e0;
    font-family: 'Rajdhani', sans-serif;
    overflow-x: hidden;
    overscroll-behavior-y: none;
}

[data-theme="light"] body {
    color: var(--text-main);
}

[data-theme="light"] .market-btn {
    border: 1px solid #e5e7eb;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

[data-theme="light"] #active-card,
[data-theme="light"] #manual-input-area,
[data-theme="light"] .history-item {
    background-color: var(--panel-bg);
    border-color: #e5e7eb;
    color: var(--text-main);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .history-item span.text-white {
    color: var(--text-main);
}

[data-theme="light"] #scanner-container {
    background: #000;
    /* Keep scanner dark */
}

.tech-font {
    font-family: 'Share Tech Mono', monospace;
}

/* Scanner Viewfinder */
#scanner-container {
    position: relative;
    background: #000;
    border-bottom: 2px solid var(--neon-purple);
    box-shadow: 0 0 20px rgba(188, 19, 254, 0.2);
    /* Reduced height slightly to give more room to content on small screens */
    height: 30vh;
    min-height: 250px;
}

#reader {
    width: 100%;
    height: 100%;
    border: none;
}

#reader video {
    object-fit: cover;
    height: 100%;
}

/* Laser Line Animation */
.laser-line {
    position: absolute;
    top: 50%;
    left: 10%;
    right: 10%;
    height: 2px;
    background: var(--neon-green);
    box-shadow: 0 0 10px var(--neon-green);
    opacity: 0.7;
    animation: scan-move 2s infinite ease-in-out;
    z-index: 10;
    pointer-events: none;
}

@keyframes scan-move {
    0% {
        top: 10%;
        opacity: 0;
    }

    50% {
        opacity: 1;
    }

    100% {
        top: 90%;
        opacity: 0;
    }
}

/* Buttons */
.market-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
    border-radius: 6px;
    font-weight: 700;
    font-size: 1rem;
    text-transform: uppercase;
    transition: all 0.2s;
    text-decoration: none;
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.market-btn:active {
    transform: scale(0.96);
    filter: brightness(0.8);
}

.btn-ebay {
    background: linear-gradient(135deg, #0064d2, #e53238 90%);
    color: white;
    border: none;
}

.btn-mercari {
    background: #6227ff;
    color: white;
}

.btn-amazon {
    background: #232f3e;
    color: #ff9900;
    border-color: #ff9900;
}

.btn-posh {
    background: #82142d;
    color: white;
}

.btn-etsy {
    background: #F16521;
    color: white;
}

.btn-google {
    background: #333;
    color: white;
}

.btn-calc {
    background: #1f2937;
    color: var(--neon-green);
    border: 1px solid var(--neon-green);
}

.share-btn {
    background: #1f2937;
    color: white;
    border: 1px solid #374151;
}

/* Modal / Menu Overlay */
#info-modal {
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: transform 0.3s ease-in-out;
}

/* Accordion Styles */
.accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}

.accordion-open {
    max-height: 500px;
}

/* Scan Pulse Effect */
.scan-pulse {
    animation: pulse-green 0.5s ease-out;
}

@keyframes pulse-green {
    0% {
        box-shadow: 0 0 0 0 rgba(0, 255, 0, 0.7),
            inset 0 0 20px rgba(0, 255, 0, 0.5);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(0, 255, 0, 0),
            inset 0 0 0 rgba(0, 255, 0, 0);
    }
}

/* Status Dot */
.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--neon-green);
    box-shadow: 0 0 5px var(--neon-green);
}

.status-offline {
    background-color: #ff3333;
    box-shadow: 0 0 5px #ff3333;
}

.hidden {
    display: none !important;
}

header {
    padding-top: max(1rem, env(safe-area-inset-top));
}

#ad-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    background: var(--dark-bg);
    border-top: 1px solid var(--neon-purple);
    z-index: 45;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 4px;
    height: 80px;
}

/* Massive padding bottom ensures active card and list are never hidden by ad */
main {
    padding-bottom: 180px;
    /* Increased to safely clear ad + margins */
}



/* Dropdown Navigation - Superior Stability Implementation */
.dropdown {
    position: relative;
    display: inline-block;
    /* Ensure trigger area is solid */
    padding-bottom: 5px;
    margin-bottom: -5px;
}

.dropdown-content {
    display: none;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    background: transparent;
    /* Transparent wrapper for the bridge */
    min-width: 240px;
    z-index: 1000;
    /* Start slightly above the bottom of the trigger to ensure overlap */
    top: 80%;
    padding-top: 15px;
    /* The bridge */
}

.dropdown-inner {
    background-color: #0a0a0a;
    border: 1px solid #333;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.7);
    overflow: hidden;
}

.dropdown-content a {
    color: #ccc;
    padding: 12px 16px;
    text-decoration: none;
    display: block;
    font-size: 0.95rem;
    transition: all 0.2s;
    border-bottom: 1px solid #1a1a1a;
    white-space: nowrap;
    font-family: 'Rajdhani', sans-serif;
}

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

.dropdown-content a:hover {
    background-color: #1a1a1a;
    color: var(--neon-green) !important;
    padding-left: 20px;
}

/* Explicit Hover State - Stable Transition */
.dropdown:hover .dropdown-content {
    display: block;
}

/* The "Bulletproof" Bridge - ensures no gap between trigger and menu */
.dropdown::after {
    content: '';
    position: absolute;
    top: 100%;
    left: -20px;
    right: -20px;
    height: 30px;
    /* Oversized bridge */
    background: transparent;
    z-index: 99;
}

.dropdown-trigger {
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 10px;
    /* Larger hit area */
    font-size: 0.75rem;
    /* Larger font for better visibility */
}

/* Responsive Utilities - Explicit Breakpoints */
@media (max-width: 991px) {
    .nav-desktop {
        display: none !important;
    }

    .nav-mobile {
        display: flex !important;
        align-items: center;
    }
}

@media (min-width: 992px) {
    .nav-desktop {
        display: flex !important;
        align-items: center;
        gap: 40px;
    }

    .nav-mobile {
        display: none !important;
    }
}