/* Header Styles per StChannel */
.stchannel-header {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
    backdrop-filter: blur(10px);
}

.stchannel-header .navbar {
    padding: 1rem 0;
    transition: all 0.3s ease;
}

.stchannel-header .navbar-nav {
    align-items: center;
    text-align: center;
}

.stchannel-header .navbar-nav .nav-item {
    display: flex;
    align-items: center;
    align-self: center;
}

.stchannel-header .navbar-brand {
    font-weight: 700;
    font-size: 1.5rem;
    transition: transform 0.3s ease;
}

.stchannel-header .navbar-brand:hover {
    transform: scale(1.05);
}

.stchannel-header .brand-text {
    background: linear-gradient(45deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 700;
}

.stchannel-header .nav-link {
    font-weight: 500;
    margin: 0 0.5rem;
    padding: 0.75rem 1rem !important;
    border-radius: 8px;
    transition: all 0.3s ease;
    position: relative;
    color: rgba(255, 255, 255, 0.9) !important;
}

.stchannel-header .nav-link:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white !important;
    transform: translateY(-2px);
}

.stchannel-header .nav-link.active {
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white !important;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.stchannel-header .nav-link i {
    margin-right: 0.5rem;
    font-size: 0.9rem;
}

.btn-cta {
    background: linear-gradient(45deg, #667eea, #764ba2);
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 25px;
    font-weight: 600;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.btn-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

.btn-cta::before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.btn-cta:hover::before {
    left: 100%;
}

/* Mobile Responsive */
@media (max-width: 991.98px) {
    .stchannel-header .navbar-nav {
        margin-top: 1rem;
        padding-top: 1rem;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
    }

    .stchannel-header .nav-link {
        margin: 0.25rem 0;
    }

    .stchannel-header .ms-3,.stchannel-header .ms-2 {
        margin-left: 0 !important;
        margin-top: 1rem;
        margin-bottom: 1rem;
        display: flex;
    }

    .stchannel-header .btn, .stchannel-header .ms-2 .sc-auth-login-btn{
        margin: auto;
    }


    .btn-cta {
        width: 100%;
        text-align: center;
    }
}

/* Scrolled State */
.stchannel-header.scrolled {
    background: rgba(26, 26, 46, 0.95);
    backdrop-filter: blur(20px);
}

.stchannel-header.scrolled .navbar {
    padding: 0.5rem 0;
}

/* Hamburger Menu Animato */
.stchannel-header .navbar-toggler {
    width: 50px;
    height: 50px;
    position: relative;
    border: 2px solid #00ff9d;
    border-radius: 12px;
    background: rgba(0, 255, 157, 0.05);
    padding: 0;
    /* La visibilità è gestita da Bootstrap (navbar-expand-lg) + override in coda:
       NON forzare display:block qui, altrimenti l'hamburger appare anche su desktop. */
    transition: all 0.3s ease;
    overflow: visible;
}

.stchannel-header .navbar-toggler:hover {
    background: rgba(0, 255, 157, 0.1);
    border-color: #00cc7d;
    box-shadow: 0 0 20px rgba(0, 255, 157, 0.3);
}

.stchannel-header .navbar-toggler:focus {
    box-shadow: 0 0 0 0.25rem rgba(0, 255, 157, 0.25);
    outline: none;
}

/* Linee dell'hamburger */
.stchannel-header .hamburger-line {
    display: block;
    width: 26px;
    height: 3px;
    background-color: #00ff9d;
    border-radius: 3px;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    pointer-events: none;
}

.stchannel-header .hamburger-line:nth-child(1) {
    top: 11px;
}

/* ============================================================
   Auth Widget
   ============================================================ */

/* Bottone login */
.sc-auth-login-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--st-primary, #00ff9d);
    font-size: .82rem;
    font-weight: 600;
    text-decoration: none;
    padding: 6px 14px;
    border: 1.5px solid var(--st-primary, #00ff9d);
    border-radius: 20px;
    transition: background .2s, color .2s, box-shadow .2s;
    white-space: nowrap;
    line-height: 1;
}
.sc-auth-login-btn:hover {
    background: var(--st-primary, #00ff9d);
    color: #0a0a0a;
    box-shadow: 0 0 12px rgba(0,255,157,.4);
    text-decoration: none;
}
.sc-auth-login-btn i { font-size: .9rem; }

/* Wrapper posizionamento dropdown */
.sc-auth-menu {
    position: relative;
}

/* Avatar circolare - trigger */
.sc-auth-menu__trigger {
    position: relative;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid var(--st-primary, #00ff9d);
    background: #1a1a2e;
    padding: 0;
    cursor: pointer;
    overflow: hidden;
    transition: box-shadow .2s, border-color .2s;
    display: block;
    flex-shrink: 0;
}
.sc-auth-menu__trigger:hover,
.sc-auth-menu__trigger[aria-expanded="true"] {
    box-shadow: 0 0 0 3px rgba(0,255,157,.25);
    border-color: var(--st-primary, #00ff9d);
}
.sc-auth-menu__trigger img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: 50%;
}
.sc-auth-menu__trigger span {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    color: var(--st-primary, #00ff9d);
    font-weight: 700;
    font-size: .9rem;
}

/* Pallino premium */
.sc-auth-menu__premium-dot {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #f59e0b;
    border: 2px solid #0a0a0a;
    pointer-events: none;
}

/* Dropdown panel */
.sc-auth-menu__dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    min-width: 220px;
    background: #111;
    border: 1px solid rgba(0,255,157,.2);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,.6);
    z-index: 9999;
    padding: 6px 0;
    opacity: 0;
    transform: translateY(-6px) scale(.98);
    pointer-events: none;
    transition: opacity .18s ease, transform .18s ease;
}
.sc-auth-menu__dropdown.is-open {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

/* Header utente */
.sc-auth-menu__head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px 8px;
}
.sc-auth-menu__head-pic {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    border: 2px solid rgba(0,255,157,.4);
}
.sc-auth-menu__head > div {
    display: flex;
    flex-direction: column;
    gap: 1px;
    overflow: hidden;
}
.sc-auth-menu__head strong {
    color: #fff;
    font-size: .85rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.sc-auth-menu__head small {
    color: rgba(255,255,255,.4);
    font-size: .72rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.sc-auth-menu__badge {
    margin-top: 2px;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: .68rem;
    color: #f59e0b;
    font-weight: 600;
}

/* Separatore */
.sc-auth-menu__sep {
    height: 1px;
    background: rgba(255,255,255,.07);
    margin: 4px 0;
}

/* Voci menu */
.sc-auth-menu__item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    color: rgba(255,255,255,.75);
    font-size: .83rem;
    text-decoration: none;
    transition: background .15s, color .15s;
}
.sc-auth-menu__item i {
    width: 16px;
    text-align: center;
    color: var(--st-primary, #00ff9d);
    font-size: .82rem;
    flex-shrink: 0;
}
.sc-auth-menu__item:hover {
    background: rgba(0,255,157,.07);
    color: #fff;
    text-decoration: none;
}
.sc-auth-menu__item--upgrade       { color: #f59e0b; }
.sc-auth-menu__item--upgrade i     { color: #f59e0b; }
.sc-auth-menu__item--logout i      { color: #ef4444; }
.sc-auth-menu__item--logout:hover  { background: rgba(239,68,68,.07); }

/* Mobile */
@media (max-width: 767.98px) {
    /*.sc-auth-login-btn span { display: none; }*/
    .sc-auth-menu__dropdown { right: -8px; min-width: 200px; }
}


.stchannel-header .hamburger-line:nth-child(2) {
    top: 22px;
}

.stchannel-header .hamburger-line:nth-child(3) {
    top: 33px;
}

/* Stato attivo - trasforma in X */
.stchannel-header .navbar-toggler[aria-expanded="true"] .hamburger-line:nth-child(1) {
    top: 23.5px;
    transform: translateX(-50%) rotate(45deg);
}

.stchannel-header .navbar-toggler[aria-expanded="true"] .hamburger-line:nth-child(2) {
    opacity: 0;
    transform: translateX(-100%);
}

.stchannel-header .navbar-toggler[aria-expanded="true"] .hamburger-line:nth-child(3) {
    top: 23.5px;
    transform: translateX(-50%) rotate(-45deg);
}

/* Effetto glow al click */
.stchannel-header .navbar-toggler[aria-expanded="true"] {
    background: rgba(0, 255, 157, 0.15);
    box-shadow: 0 0 25px rgba(0, 255, 157, 0.4);
}

/* ════════════════════════════════════════════════════════════════
   OVERRIDE FINALI (ex blocco <style> inline di header.php)
   Stanno in coda così vincono la cascade nel bucket "custom CSS"
   (renderCustomCSS viene emesso a fine body, dopo i CSS asset).
   ════════════════════════════════════════════════════════════════ */

/* ── Hamburger: visibile SOLO sotto lg (fix: appariva anche su desktop) ── */
@media (min-width: 992px) {
    .stchannel-header .navbar-toggler { display: none !important; }
}
@media (max-width: 991.98px) {
    .stchannel-header .navbar-toggler { display: block !important; }
}

/* ── Auth Widget: pulsante login "Entra" (stessa altezza del CTA) ─────── */
.sc-auth-login-btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    height: 46px !important;
    padding: 0 18px !important;
    border-radius: 12px !important;
    border: 2px solid rgba(0,255,157,.55) !important;
    background: rgba(0,255,157,.06) !important;
    color: rgba(0,255,157,.9) !important;
    font-size: .85rem !important;
    font-weight: 700 !important;
    line-height: 1 !important;
    white-space: nowrap !important;
    text-decoration: none !important;
    transition: border-color .2s, color .2s, background .2s, box-shadow .2s !important;
    cursor: pointer !important;
    box-sizing: border-box !important;
}
.sc-auth-login-btn i { font-size: 1rem !important; }
.sc-auth-login-btn:hover {
    border-color: #00ff9d !important;
    color: #00ff9d !important;
    background: rgba(0,255,157,.12) !important;
    box-shadow: 0 0 0 3px rgba(0,255,157,.2) !important;
    text-decoration: none !important;
}

/* Avatar circolare (allineato all'altezza del pill "Entra") */
.sc-auth-menu__trigger {
    width: 44px !important;
    height: 44px !important;
    min-width: 44px !important;
    overflow: visible !important;   /* il badge premium non viene tagliato */
    align-items: center !important;
    justify-content: center !important;
}
.sc-auth-menu__trigger img,
.sc-auth-menu__trigger span { border-radius: 50% !important; }
.sc-auth-menu__trigger span { overflow: hidden !important; }

/* Badge premium: stella dorata in alto a destra */
.sc-auth-menu__premium-dot {
    top: -4px !important;
    right: -4px !important;
    bottom: auto !important;
    width: 18px !important;
    height: 18px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    z-index: 10 !important;
    font-style: normal !important;
    font-size: 8px !important;
    color: #0a0a0a !important;
    font-family: 'Font Awesome 6 Free' !important;
    font-weight: 900 !important;
    line-height: 1 !important;
}

/* ── CTA navbar "Inizia Progetto": testo su due righe, compatto ──────
   Stessa altezza del pulsante "Entra" (46px) così formano una coppia. */
.stchannel-header .nav-cta-btn {
    height: 46px !important;
    padding: 0 16px !important;
    font-size: .8rem !important;
    line-height: 1.05 !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px !important;
    width: auto !important;
    white-space: normal !important;   /* consente le due righe del label */
    text-align: left !important;
    box-sizing: border-box !important;
}
.stchannel-header .nav-cta-btn i { font-size: .95rem !important; margin: 0 !important; flex-shrink: 0; }
.stchannel-header .nav-cta-btn__label { display: inline-block; line-height: 1.05; }

/* ── Voce "Tutorial" evidenziata + animazione neon (header) ─────────
   Colore neon di base così spicca tra le voci bianche + glow pulsante. */
.stchannel-header .nav-link-tutorial {
    color: #00ff9d !important;
    transition: color .25s ease, text-shadow .25s ease !important;
    animation: stTutorialPulse 2.6s ease-in-out infinite !important;
}
.stchannel-header .nav-link-tutorial i {
    color: #00ff9d !important;
    transition: transform .50s ease !important;
}
.stchannel-header .nav-link-tutorial:hover {
    color: #6effc6 !important;
    text-shadow: 0 0 12px rgba(0,255,157,.75) !important;
}
.stchannel-header .nav-link-tutorial:hover i {
    transform: translateY(-2px) scale(1.15) !important;
}
@keyframes stTutorialPulse {
    0%, 100% { text-shadow: 0 0 0 rgba(0,255,157,0); }
    50%      { text-shadow: 0 0 10px rgba(0,255,157,.65); }
}
@media (prefers-reduced-motion: reduce) {
    .stchannel-header .nav-link-tutorial { animation: none !important; }
}
