/* =====================================================
   HEADER DEL DASHBOARD
===================================================== */

.dashboard-header {
    position: relative;
    width: 100%;
    min-height: 155px;
    padding-top: 26px;
    padding-bottom: 25px;
    color: #fff;
    z-index: 20;
}

.dashboard-header__content {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    width: 100%;
    gap: 30px;
}


/* =====================================================
   BIENVENIDA
===================================================== */

.dashboard-header__welcome {
    padding-top: 18px;
}

.dashboard-header__welcome h1 {
    margin: 0;
    color: #fff;
    font-size: clamp(1.4rem, 1.6vw, 2rem);
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -0.035em;
}

.dashboard-header__welcome h1 strong {
    color: #ffd000;
    font-weight: 800;
}

.dashboard-header__welcome p {
    margin: 12px 0 0;
    color: rgba(255, 255, 255, 0.92);
    font-size: clamp(1rem, 1.2vw, 1.35rem);
    font-weight: 400;
    line-height: 1.4;
}


/* =====================================================
   INFORMACIÓN DE CUENTA
===================================================== */

.dashboard-header__account {
    position: relative;
    flex-shrink: 0;
}

.dashboard-header__account-info {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 14px;
}


/* =====================================================
   TARJETAS DEL HEADER
===================================================== */

.header-stat-card {
    display: flex;
    align-items: center;
    min-width: 205px;
    min-height: 90px;
    padding: 13px 15px;
    border: 2px solid #4420d4;
    border-radius: 17px;
    background:
        linear-gradient(
            145deg,
            rgba(17, 12, 48, 0.78),
            rgba(0, 0, 0, 0.92)
        );
    box-shadow:
        0 0 20px rgba(63, 32, 208, 0.08),
        inset 0 0 18px rgba(74, 43, 219, 0.05);
}

.header-stat-card__content {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.header-stat-card__content span {
    color: rgba(255, 255, 255, 0.92);
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.1;
    white-space: nowrap;
}

.header-stat-card__content strong,
.header-stat-card__content time {
    display: block;
    margin-top: 3px;
    color: #fff;
    font-size: 1.45rem;
    font-weight: 800;
    line-height: 1;
    white-space: nowrap;
}


/* =====================================================
   ICONO DE MONEDA
===================================================== */

.header-stat-card__icon {
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    width: 37px;
    height: 37px;
    margin-right: 11px;
    border-radius: 50%;
    font-size: 1.3rem;
    font-weight: 900;
}

.header-stat-card__icon--coin {
    color: #fff5a2;
    border: 3px solid #ffae00;
    background:
        radial-gradient(
            circle at 35% 30%,
            #fff58b 0,
            #ffd600 25%,
            #f6a900 72%,
            #bd6e00 100%
        );
    box-shadow:
        0 0 10px rgba(255, 200, 0, 0.4);
}


/* =====================================================
   BOTÓN PARA AGREGAR CRÉDITOS
===================================================== */

.header-stat-card__add {
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    width: 34px;
    height: 34px;
    margin-left: auto;
    border: 0;
    border-radius: 6px;
    background:
        linear-gradient(
            180deg,
            #675ff7 0%,
            #3424c8 100%
        );
    color: #fff;
    font-size: 1.9rem;
    font-weight: 800;
    line-height: 1;
    cursor: pointer;
    box-shadow:
        0 4px 10px rgba(30, 13, 148, 0.45),
        inset 0 1px 1px rgba(255, 255, 255, 0.3);
    transition:
        transform 0.2s ease,
        filter 0.2s ease;
}

.header-stat-card__add:hover {
    filter: brightness(1.15);
    transform: translateY(-2px);
}

.header-stat-card__add:active {
    transform: translateY(0);
}


/* =====================================================
   ICONO DEL RELOJ
===================================================== */

.header-stat-card__clock {
    flex: 0 0 auto;
    width: 35px;
    height: 35px;
    margin-right: 11px;
}

.header-stat-card__clock svg {
    width: 100%;
    height: 100%;
    fill: none;
    stroke: #fff;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}


/* =====================================================
   NOTIFICACIONES
===================================================== */

.dashboard-header__notifications {
    position: relative;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    width: 58px;
    height: 72px;
    padding: 0;
    border: 0;
    background: transparent;
    color: #fff;
    cursor: pointer;
}

.dashboard-header__notifications svg {
    width: 42px;
    height: 42px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.dashboard-header__notifications > span {
    position: absolute;
    top: 8px;
    right: 5px;
    display: grid;
    place-items: center;
    width: 17px;
    height: 17px;
    border: 2px solid #000;
    border-radius: 50%;
    background: #f13648;
    color: #fff;
    font-size: 0.62rem;
    font-weight: 800;
}


/* =====================================================
   BOTÓN DEL USUARIO
   Oculto en escritorio
===================================================== */

.dashboard-header__account-toggle {
    display: none;
}


/* =====================================================
   CABECERA MÓVIL
===================================================== */

.dashboard-header__mobile-top {
    display: none;
}

.dashboard-header__mobile-logo img {
    display: block;
    width: 80%;
    height: auto;
    margin: 0 auto;
}

.dashboard-header__hamburger {
    display: none;
}


/* =====================================================
   TABLET
===================================================== */

@media (max-width: 1199px) and (min-width: 769px) {

    .header-stat-card {
        min-width: 180px;
    }

    .header-stat-card__content strong,
    .header-stat-card__content time {
        font-size: 1.2rem;
    }

}


/* =====================================================
   MÓVIL
===================================================== */

@media (max-width: 768px) {

    .dashboard-header {
        min-height: 335px;
        padding: 0 0 35px;
        overflow: visible;
    }


    /* Logo y hamburguesa */

    .dashboard-header__mobile-top {
        display: flex;
        align-items: flex-start;
        justify-content: center;
        position: relative;
        min-height: 205px;
        padding: 35px 75px 10px;
    }

    .dashboard-header__mobile-logo {
        display: block;
        width: min(370px, 72vw);
    }

    .dashboard-header__hamburger {
        position: absolute;
        top: 49px;
        right: 5.5%;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        width: 48px;
        height: 38px;
        padding: 0;
        border: 0;
        border-radius: 0;
        background: transparent;
        cursor: pointer;
        z-index: 10;
    }

    .dashboard-header__hamburger span {
        display: block;
        width: 100%;
        height: 6px;
        border-radius: 1px;
        background: #fff;
        transition:
            transform 0.3s ease,
            opacity 0.3s ease;
    }


    /* Bienvenida */

    .dashboard-header__content {
        display: block;
        position: relative;
        text-align: start;
    }

    .dashboard-header__welcome {
        padding: 3px 5.2% 0;
    }

    .dashboard-header__welcome h1 {
        font-size: clamp(1.5rem, 5.4vw, 2rem);
    }

    .dashboard-header__welcome p {
        margin-top: 16px;
        font-size: clamp(1.05rem, 4.5vw, 1.45rem);
    }


    /* Panel lateral del usuario */

    .dashboard-header__account {
        position: absolute;
        top: -19px;
        right: 0;
        width: min(650px, 78vw);
        min-height: 112px;
        border: 2px solid #451eff;
        border-right: 0;
        border-radius: 28px 0 0 28px;
        background: rgba(3, 1, 21, 0.96);
        transform: translateX(calc(100% - 76px));
        transition:
            transform 0.45s cubic-bezier(0.22, 1, 0.36, 1),
            box-shadow 0.35s ease;
        z-index: 30;
    }

    .dashboard-header__account.is-open {
        transform: translateX(0);
        box-shadow: -15px 12px 30px rgba(0, 0, 0, 0.45);
    }


    /* Botón visible cuando el panel está cerrado */

    .dashboard-header__account-toggle {
        position: absolute;
        top: 0;
        left: 0;
        display: grid;
        place-items: center;
        width: 74px;
        height: 108px;
        padding: 0;
        border: 0;
        background: transparent;
        color: #f6c325;
        cursor: pointer;
        z-index: 5;
    }

    .dashboard-header__account-toggle svg {
        width: 35px;
        height: 35px;
        fill: none;
        stroke: currentColor;
        stroke-width: 1.6;
        stroke-linecap: round;
        stroke-linejoin: round;
    }


    /* Información interna */

    .dashboard-header__account-info {
        display: flex;
        align-items: center;
        min-height: 108px;
        padding: 13px 13px 13px 76px;
        gap: 11px;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.2s ease;
    }

    .dashboard-header__account.is-open
    .dashboard-header__account-info {
        opacity: 1;
        pointer-events: auto;
        transition-delay: 0.15s;
    }

    .header-stat-card {
        flex: 1 1 0;
        min-width: 0;
        min-height: 82px;
        padding: 10px 11px;
        border-radius: 15px;
    }

    .header-stat-card__content span {
        font-size: clamp(0.75rem, 2.8vw, 1rem);
    }

    .header-stat-card__content strong,
    .header-stat-card__content time {
        font-size: clamp(1rem, 4vw, 1.4rem);
    }

    .header-stat-card__icon,
    .header-stat-card__clock {
        width: 31px;
        height: 31px;
        margin-right: 7px;
    }

    .header-stat-card__add {
        width: 28px;
        height: 28px;
        margin-left: 6px;
        font-size: 1.6rem;
    }

    .dashboard-header__notifications {
        width: 52px;
        height: 65px;
    }

    .dashboard-header__notifications svg {
        width: 38px;
        height: 38px;
    }

}


/* =====================================================
   MÓVILES PEQUEÑOS
===================================================== */

@media (max-width: 520px) {

    .dashboard-header {
        min-height: 280px;
    }

    .dashboard-header__mobile-top {
        min-height: 180px;
        padding-top: 30px;
    }

    .dashboard-header__hamburger {
        top: 42px;
        width: 39px;
        height: 31px;
    }

    .dashboard-header__hamburger span {
        height: 5px;
    }

    .dashboard-header__account {
        width: 94vw;
    }

    .dashboard-header__account-info {
        gap: 7px;
        padding-right: 8px;
    }

    .header-stat-card {
        padding: 8px;
    }

    .header-stat-card__content span {
        font-size: 0.7rem;
    }

    .header-stat-card__content strong,
    .header-stat-card__content time {
        font-size: 0.96rem;
    }

    .header-stat-card__icon,
    .header-stat-card__clock {
        display: none;
    }

    .dashboard-header__notifications {
        width: 42px;
    }

    .dashboard-header__notifications svg {
        width: 33px;
        height: 33px;
    }

}


/* =====================================================
   ACCESIBILIDAD
===================================================== */

.dashboard-header button:focus-visible,
.dashboard-header a:focus-visible {
    outline: 3px solid #ffd000;
    outline-offset: 4px;
}

@media (prefers-reduced-motion: reduce) {

    .dashboard-header__account,
    .dashboard-header__account-info,
    .dashboard-header__hamburger span,
    .header-stat-card__add {
        transition: none;
    }

}