/* assets/css/onboarding.css */

#onboarding-container {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: #000000;
    display: none;
    align-items: center;
    justify-content: center;
    overflow-y: auto;
    /* Permite scroll si el contenido es muy alto */
    overflow-x: hidden;
    padding: 1rem 0;
    /* Espacio para que no pegue el card arriba/abajo en laptops pequeñas */
}

#onboarding-container.active {
    display: flex;
    animation: fadeInOnboarding 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes fadeInOnboarding {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.onboarding-card {
    width: 100%;
    max-width: 850px;
    min-height: 500px;
    padding: 3rem;
    margin: auto;
    /* Centrado si el contenedor permite scroll */
    position: relative;
    background: #000000;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 2.5rem;
    box-shadow: 0 40px 100px -20px rgba(0, 0, 0, 1);
    display: flex;
    flex-direction: column;
    gap: 2rem;
    z-index: 10;
    overflow: visible !important;
    /* SEGURIDAD: Permite menús flotantes */
}

/* Background Blobs for extra premium feel */
.onboarding-blobs {
    position: absolute;
    inset: 0;
    z-index: -1;
    overflow: hidden;
}

.onboarding-blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.25;
    background: var(--primary);
    /* Ambos blobs usarán el color primario */
    animation: floatBlob 15s infinite ease-in-out;
}

@keyframes floatBlob {

    0%,
    100% {
        transform: translate(0, 0) scale(1);
    }

    33% {
        transform: translate(30px, -50px) scale(1.1);
    }

    66% {
        transform: translate(-20px, 20px) scale(0.9);
    }
}

/* STEP TRANSITIONS */
.onboarding-step {
    display: none;
    flex-direction: column;
    gap: 1.5rem;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.onboarding-step.active {
    display: flex;
    opacity: 1;
    transform: translateY(0);
}

/* TYPOGRAPHY */
.onboarding-step h1 {
    font-family: 'Playfair Display', serif;
    font-size: 2.5rem;
    color: #fff;
    line-height: 1.2;
}

@media (max-width: 640px) {
    .onboarding-step h1 {
        font-size: 1.75rem;
    }
}

.onboarding-step p {
    font-size: 1.1rem;
    color: #94a3b8;
    max-width: 500px;
}

/* CATEGORY CARDS */
.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.category-card {
    background: rgba(255, 255, 255, 0.03);
    border: 2px solid rgba(255, 255, 255, 0.05);
    padding: 1.5rem;
    border-radius: 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.category-card:hover {
    background: rgba(255, 255, 255, 0.07);
    border-color: var(--primary);
    transform: translateY(-5px);
}

.category-card.active {
    background: rgba(197, 160, 43, 0.1);
    border-color: var(--primary);
    box-shadow: 0 0 20px rgba(197, 160, 43, 0.2);
}

.category-icon {
    font-size: 2.5rem;
    color: var(--primary);
}

.category-card span {
    font-weight: 600;
    color: #fff;
}

/* INPUTS */
.onboarding-input-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.onboarding-input-group label {
    font-size: 0.9rem;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.onboarding-input {
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 1rem;
    padding: 1.25rem;
    color: #fff;
    font-size: 1.1rem;
    transition: all 0.3s ease;
}

.onboarding-input:focus {
    outline: none;
    border-color: var(--primary);
    background: rgba(15, 23, 42, 0.8);
    box-shadow: 0 0 0 4px rgba(197, 160, 43, 0.1);
}

/* BRANDING PREVIEW */
.branding-layout {
    display: grid;
    grid-template-columns: 2fr 1.5fr;
    gap: 2rem;
}

@media (max-width: 768px) {
    .branding-layout {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
}

/* PROGRESS BAR & STEPS COUNT */
.onboarding-progress-container {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.onboarding-steps-count {
    font-size: 0.75rem;
    font-weight: 800;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

#onboarding-current-step {
    color: var(--primary);
}

.onboarding-progress-bar {
    height: 6px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 10px;
    overflow: hidden;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.onboarding-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--primary-light));
    width: 16.66%;
    transition: width 0.8s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 0 20px var(--primary);
    position: relative;
}

.onboarding-progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 30px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3));
    animation: progressGlow 2s infinite linear;
}

@keyframes progressGlow {
    from {
        transform: translateX(-100%);
    }

    to {
        transform: translateX(200%);
    }
}

/* AVATAR UPLOAD */
.onboarding-avatar-upload {
    width: 140px;
    height: 140px;
    border-radius: 2rem;
    background: rgba(15, 23, 42, 0.5);
    border: 2px dashed rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.onboarding-avatar-upload:hover {
    border-color: var(--primary);
    background: rgba(15, 23, 42, 0.8);
}

.onboarding-avatar-upload img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.onboarding-avatar-upload .overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.onboarding-avatar-upload:hover .overlay {
    opacity: 1;
}

/* NAVIGATION BUTTONS */
.onboarding-footer {
    margin-top: auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.btn-onboarding-next {
    background: var(--primary);
    color: #fff;
    padding: 1rem 2.5rem;
    border-radius: 1.25rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    box-shadow: 0 10px 20px -5px rgba(197, 160, 43, 0.3);
}

.btn-onboarding-next:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 30px -5px rgba(197, 160, 43, 0.4);
    filter: brightness(1.1);
}

.btn-onboarding-prev {
    color: #64748b;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-onboarding-prev:hover {
    color: #fff;
}

/* ONBOARDING DAY SELECTOR */
.onboarding-day-selector {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1rem;
}

.onboarding-day-btn {
    width: 45px;
    height: 45px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #94a3b8;
    font-weight: 700;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.onboarding-day-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.onboarding-day-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
    box-shadow: 0 0 15px rgba(197, 160, 43, 0.3);
}

.onboarding-time-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-top: 1rem;
}

/* RESPONSIVE */
@media (max-width: 768px) {
    #onboarding-container {
        padding: 0;
        align-items: flex-start;
        /* Empezamos desde arriba */
    }

    .onboarding-card {
        padding: 1.5rem;
        border-radius: 0;
        min-height: 100vh;
        gap: 1.5rem;
    }

    .onboarding-step h1 {
        font-size: 1.5rem;
    }

    .category-grid {
        grid-template-columns: repeat(2, 1fr);
        /* 2 columnas en mobile para ahorrar espacio */
        gap: 0.75rem;
    }

    .category-card {
        padding: 1rem;
        gap: 0.5rem;
    }

    .category-icon {
        font-size: 1.75rem;
    }

    .branding-layout,
    .onboarding-time-grid {
        grid-template-columns: 1fr;
    }

    .onboarding-footer {
        flex-direction: row;
        justify-content: space-between;
        padding-top: 1rem;
        padding-bottom: 2rem;
    }
}

/* CUSTOM SELECT FOR ONBOARDING */
.onboarding-card .custom-options {
    background: #1e293b;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8);
    z-index: 9999 !important;
    /* Por encima de todo */
    position: absolute;
}

.onboarding-card .custom-options div {
    padding: 1rem;
    color: #cbd5e1;
    transition: all 0.2s ease;
}

.onboarding-card .custom-options div:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--primary);
}

.onboarding-input-group .relative {
    width: 100%;
}