/* Modern header refinement for the Go frontend */

.app-container {
    max-width: 1600px;
    padding: 0 1.5rem;
}

.main-header {
    min-height: 72px;
    padding: 10px 0;
    gap: 18px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.065);
    background: rgba(8, 8, 12, 0.76);
    backdrop-filter: blur(24px) saturate(145%);
    -webkit-backdrop-filter: blur(24px) saturate(145%);
}

.main-header::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -1px;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 0, 127, 0.22), rgba(127, 0, 255, 0.18), transparent);
    pointer-events: none;
}

.header-left {
    flex: 0 0 auto;
    gap: 14px;
    min-width: 0;
}

.logo {
    gap: 9px;
    flex-shrink: 0;
}

.logo-icon {
    width: 31px;
    height: 31px;
    display: grid;
    place-items: center;
    padding: 5px;
    border-radius: 10px;
    background: linear-gradient(145deg, rgba(255, 0, 127, 0.14), rgba(127, 0, 255, 0.1));
    border: 1px solid rgba(255, 255, 255, 0.075);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.05), 0 8px 24px rgba(255,0,127,.08);
    filter: none;
}

.logo h1 {
    display: flex;
    gap: 5px;
    align-items: baseline;
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: -0.035em;
    white-space: nowrap;
}

.logo h1 span {
    font-weight: 700;
}

.live-counter {
    min-height: 34px;
    gap: 7px;
    padding: 0 11px;
    background: rgba(255, 255, 255, 0.035);
    border-color: rgba(255, 255, 255, 0.075);
    color: #9ca6b7;
    font-size: 0.76rem;
    font-weight: 500;
    white-space: nowrap;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.025);
}

.pulse-dot {
    width: 7px;
    height: 7px;
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.55);
}

.header-right {
    flex: 1;
    min-width: 0;
    justify-content: flex-end;
    gap: 7px;
}

.search-box {
    order: 0;
    flex: 1 1 300px;
    width: auto;
    min-width: 190px;
    max-width: 390px;
    height: 42px;
    padding: 0 13px;
    margin-right: 4px;
    border-radius: 13px;
    background: rgba(255, 255, 255, 0.035);
    border: 1px solid rgba(255, 255, 255, 0.075);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.025);
}

.search-box:hover {
    background: rgba(255, 255, 255, 0.045);
    border-color: rgba(255, 255, 255, 0.11);
}

.search-box:focus-within {
    background: rgba(255, 255, 255, 0.055);
    border-color: rgba(255, 0, 127, 0.42);
    box-shadow: 0 0 0 3px rgba(255, 0, 127, 0.075), inset 0 1px 0 rgba(255,255,255,.035);
}

.search-icon {
    width: 16px;
    height: 16px;
    margin-right: 9px;
    color: #737e91;
    stroke-width: 1.8;
}

.search-box input {
    font-size: 0.82rem;
    font-weight: 450;
    letter-spacing: -0.01em;
}

.search-box input::placeholder {
    color: #626d80;
}

.header-right > .btn,
.header-right > a.btn {
    height: 42px;
    min-width: 0;
    padding: 0 13px;
    gap: 7px;
    border-radius: 12px;
    background: transparent;
    border: 1px solid transparent;
    color: #b6bfce;
    font-size: 0.79rem;
    font-weight: 600;
    white-space: nowrap;
    box-shadow: none;
    transition: color .18s ease, background .18s ease, border-color .18s ease, transform .18s ease;
}

.header-right > .btn:hover,
.header-right > a.btn:hover {
    transform: none;
    color: #fff;
    background: rgba(255, 255, 255, 0.055);
    border-color: rgba(255, 255, 255, 0.085);
}

.header-right > a.btn svg,
.header-right > button.btn svg {
    width: 16px !important;
    height: 16px !important;
    flex: 0 0 16px;
    stroke-width: 1.8;
    color: #8f99aa;
}

.header-right > a.btn:hover svg,
.header-right > button.btn:hover svg {
    color: #f0f3f8;
}

/* Keep the primary destinations readable, but visually quiet. */
.header-right > a[href="/grid"],
.header-right > a[href="/static/videos.html"],
.header-right > a[href="/static/drive.html"] {
    background: rgba(255, 255, 255, 0.025);
    border-color: rgba(255, 255, 255, 0.055);
}

.header-right > a[href="/static/videos.html"] {
    color: #f1edf8;
}

/* Utility actions become compact icon buttons. */
#settings-btn,
#refresh-btn {
    width: 42px;
    padding: 0 !important;
    flex: 0 0 42px;
    border-radius: 12px !important;
    background: rgba(255, 255, 255, 0.025) !important;
    border-color: rgba(255, 255, 255, 0.055) !important;
}

#settings-btn span,
#refresh-btn span {
    display: none;
}

#settings-btn:hover,
#refresh-btn:hover {
    background: rgba(255, 255, 255, 0.07) !important;
    border-color: rgba(255, 255, 255, 0.11) !important;
}

#refresh-btn:hover .refresh-icon {
    transform: rotate(180deg);
}

@media (max-width: 1280px) {
    .app-container {
        padding: 0 1rem;
    }

    .header-left {
        gap: 10px;
    }

    .live-counter {
        padding: 0 9px;
    }

    .header-right > .btn,
    .header-right > a.btn {
        padding: 0 10px;
    }

    .header-right > a[href="/grid"] span {
        font-size: 0;
    }

    .header-right > a[href="/grid"] span::after {
        content: "Multi";
        font-size: .78rem;
    }
}

@media (max-width: 1050px) {
    .main-header {
        flex-wrap: wrap;
        gap: 9px 12px;
        padding: 10px 0 11px;
    }

    .header-left {
        width: 100%;
        justify-content: space-between;
    }

    .header-right {
        width: 100%;
        justify-content: stretch;
    }

    .search-box {
        max-width: none;
    }
}

@media (max-width: 720px) {
    .app-container {
        padding: 0 .75rem;
    }

    .main-header {
        position: sticky;
        min-height: auto;
    }

    .logo h1 {
        font-size: .98rem;
    }

    .live-counter {
        max-width: 48vw;
        overflow: hidden;
    }

    #counter-text {
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .header-right {
        display: grid;
        grid-template-columns: 1fr repeat(2, 42px);
        gap: 7px;
    }

    .search-box {
        grid-column: 1 / -1;
        grid-row: 1;
        width: 100%;
        min-width: 0;
        height: 40px;
        margin: 0;
    }

    .header-right > a[href="/grid"],
    .header-right > a[href="/static/videos.html"],
    .header-right > a[href="/static/drive.html"] {
        grid-row: 2;
        height: 40px;
        justify-content: center;
        padding: 0 10px;
    }

    .header-right > a[href="/grid"] {
        grid-column: 1;
    }

    .header-right > a[href="/static/videos.html"] {
        grid-column: 2 / span 2;
    }

    .header-right > a[href="/static/drive.html"] {
        grid-column: 1;
        grid-row: 3;
    }

    #settings-btn {
        grid-column: 2;
        grid-row: 3;
    }

    #refresh-btn {
        grid-column: 3;
        grid-row: 3;
    }
}
