/* =====================================================
   Game Scouter - styles.css
   ===================================================== */

   :root {
    --theme-color: #3b0764;
}

/* ---------- Reset ---------- */

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

/* ---------- Body ---------- */

body {
    min-height: 100vh;
    font-family: "Blinker", sans-serif;
    color: white;
    background: var(--bg-color);
    overflow-x: hidden;
    transition: background 0.5s ease;
}

/* Default black mode */
body.black-mode {
    --bg-color: #050505;
}

/* Gradient mode */
body.gradient-mode {
    --bg-color:
        radial-gradient(
            circle at top,
            var(--theme-color),
            #120018 70%,
            #050505 100%
        );
}

/* ---------- Layout ---------- */

.container {
    max-width: 760px;
    margin: 0 auto;
    padding: 0 30px 60px;
    display: flex;
    flex-direction: column;
    gap: 28px;
}

/* =========================================
   Header & Corner Toggle Switch
========================================= */

.header {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    margin-top: 45px;
    margin-bottom: 25px;
    width: 100%;
}

.logo-title {
    display: flex;
    justify-content: center;
    align-items: center;
    font-family: "Blinker", sans-serif;
    text-transform: uppercase;
    /* Responsive font sizing so logo scales down gracefully on small screens */
    font-size: clamp(0.95rem, 4.5vw, 1.4rem);
    font-weight: 800;
    letter-spacing: clamp(1px, 1vw, 4px);
    line-height: 1;
    white-space: nowrap;
}

.logo-text {
    display: inline-block;
    white-space: nowrap;
}

/* Green characters */
.logo-green {
    color: #74ff7a;
    text-shadow:
        0 0 1px #74ff7a,
        0 0 14px #74ff7a,
        0 0 28px rgba(116, 255, 122, .6);
}

/* White characters */
.logo-white {
    color: white;
    text-shadow:
        0 0 1px white,
        0 0 18px rgba(255, 255, 255, .9),
        0 0 30px rgba(195, 150, 255, .45);
}

/* Top Right Toggle Wrapper - Locked to top-right on ALL screens */
.toggle-wrapper {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    gap: 6px;
}

.toggle-label {
    font-size: clamp(0.65rem, 2vw, 0.75rem);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #94a3b8;
}

/* Switch Container */
.switch {
    position: relative;
    display: inline-block;
    width: 38px;
    height: 20px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

/* Slider Track (Unchecked = Black Mode Default) */
.slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background-color: #1e293b;
    transition: 0.3s ease;
    border-radius: 34px;
    border: 1px solid #334155;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.6);
}

/* Slider Knob (Unchecked = Off/Dim) */
.slider:before {
    position: absolute;
    content: "";
    height: 14px;
    width: 14px;
    left: 2px;
    bottom: 2px;
    background-color: #64748b;
    transition: 0.3s ease;
    border-radius: 50%;
}

/* Active State (Checked = Gradient Mode ON) */
input:checked + .slider {
    background-color: #5938b5;
    border-color: #822ac6;
    box-shadow: 0 0 10px #9400fe, inset 0 0 8px #00f2fe;
}

input:checked + .slider:before {
    transform: translateX(18px);
    background-color: #74ff7a;
    box-shadow: 0 0 8px #74ff7a;
}

/* ---------- Cards ---------- */

.card {
    background: #0f172a;
    border: 2px solid #00f2fe;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    box-shadow: 0 0 15px rgba(0, 242, 254, 0.3);
    padding: 20px;
}

.camera-view {
    width: 100%;
    aspect-ratio: 16/9;
    margin: 0;
    position: relative;
    overflow: hidden;
    background: #000;
    border-radius: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    border: 2px solid rgba(116, 255, 122, .25);
    box-shadow: 0 0 25px rgba(116, 255, 122, .15);
}

.card:has(.camera-view) {
    padding: 0;
    gap: 0;
    border: none;
}

#videoFeed {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.scanner-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    border: 2px dashed rgba(16, 185, 129, .5);
    pointer-events: none;
}

.scanner-overlay span {
    background: rgba(15, 23, 42, .85);
    color: #6ee7b7;
    padding: .35rem .75rem;
    border-radius: 8px;
    font-size: .75rem;
}

/* ---------- Search ---------- */

.card:has(.search-row) {
    padding: 0;
    overflow: hidden;
}

.search-row {
    display: flex;
    width: 100%;
    gap: 0;
}

.search-row input {
    flex: 1;
    width: 100%;
    border-radius: 0;
    background: #0f172a;
    color: #ffffff;
    padding: 12px 16px;
    border: none;
    font-size: 0.9rem;
}

.search-row input:focus {
    outline: none;
    background: #1e293b;
}

.search-row button {
    width: 120px;
    border-radius: 0;
}

/* ---------- Buttons ---------- */

.btn {
    border: 1px solid #822ac6;
    box-shadow: 0 0 8px #9400fe, inset 0 0 8px #00f2fe;
    border-radius: 12px;
    padding: .75rem 1rem;
    cursor: pointer;
    font-weight: bold;
    transition: all .2s ease;
}

.btn-green {
    background: #5938b5;
    color: white;
}

.btn-green:hover {
    background: #250b57;
}

.btn-red {
    background: #dc2626;
    color: white;
}

.btn-red:hover {
    background: #ef4444;
}

/* ---------- Results ---------- */

#resultsContainer {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* ---------- Tables ---------- */

table {
    width: 100%;
    border-collapse: collapse;
    font-size: .8rem;
}

thead {
    border-bottom: 1px solid #334155;
    color: #94a3b8;
}

tbody tr {
    border-bottom: 1px solid rgba(51, 65, 85, .5);
}

th {
    padding: .6rem;
    text-align: left;
    font-weight: 600;
}

td {
    padding: .65rem;
    vertical-align: top;
}

/* ---------- Utility ---------- */

.text-center { text-align: center; }
.text-green { color: #34d399; }
.text-red { color: #f87171; }
.text-yellow { color: #fbbf24; }
.small { font-size: .8rem; }
.mono { font-family: Consolas, Monaco, monospace; }

/* ---------- Responsive Adjustments ---------- */

@media (max-width: 640px) {
    .container {
        padding: 0 16px 40px;
    }

    .header {
        margin-top: 25px;
        margin-bottom: 20px;
    }

    .search-row {
        flex-direction: column;
    }
    
    .search-row button {
        width: 100%;
    }
    
    table {
        font-size: .72rem;
    }
    
    th, td {
        padding: .45rem;
    }
}