/* ═══════════════════════════════════════════════════════════
   StudyPilot Hub — CSS (misma calidad que dashboard.css)
   ═══════════════════════════════════════════════════════════ */

body {
    background-color: #F8FAFC;
    color: #1e293b;
}

/* Bento cards — misma clase que el dashboard principal */
.sp-bento {
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 1.5rem;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1),
                box-shadow 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.sp-bento.hover-lift:hover {
    border-color: #CBD5E1;
    transform: translateY(-4px);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1),
                0 8px 10px -6px rgba(0, 0, 0, 0.1);
}

/* Entrada animada — misma que el dashboard */
.sp-enter {
    animation: spEnter 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    opacity: 0;
    transform: translateY(10px);
}
@keyframes spEnter {
    to { opacity: 1; transform: translateY(0); }
}

/* Hero header — similar al hero_section del dashboard */
.sp-hero {
    position: relative;
    overflow: hidden;
    border-radius: 1.5rem;
    background: #0f172a;
    border: 1px solid #1e293b;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    isolation: isolate;
}
.sp-hero::before {
    content: '';
    position: absolute;
    top: -40%; right: -30%;
    width: 30rem; height: 30rem;
    background: rgba(99,102,241,0.3);
    border-radius: 50%;
    filter: blur(100px);
    pointer-events: none;
    mix-blend-mode: screen;
}
.sp-hero::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0;
    width: 20rem; height: 20rem;
    background: rgba(34,211,238,0.2);
    border-radius: 50%;
    filter: blur(80px);
    pointer-events: none;
    mix-blend-mode: screen;
}

/* Accent pill — (PENDIENTES / DOMINADAS) */
.sp-stat-pill {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1rem 0.75rem;
    border-radius: 0.75rem;
    text-align: center;
}

/* Flip card 3D */
.sp-flip-wrapper {
    perspective: 1200px;
    min-height: 280px;
}
.sp-flip-card {
    width: 100%;
    height: 100%;
    min-height: 280px;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
}
.sp-flip-card.flipped {
    transform: rotateY(180deg);
}
.sp-flip-face {
    position: absolute;
    inset: 0;
    backface-visibility: hidden;
    border-radius: 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 2rem;
}
.sp-flip-back {
    transform: rotateY(180deg);
}

/* Upload zone */
.sp-dropzone {
    border: 2px dashed #CBD5E1;
    border-radius: 1.5rem;
    padding: 3rem 2rem;
    text-align: center;
    transition: all 0.3s;
    cursor: pointer;
    position: relative;
}
.sp-dropzone:hover, .sp-dropzone.dragover {
    border-color: #6366f1;
    background: rgba(99,102,241,0.04);
    transform: translateY(-2px);
}
.sp-dropzone input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

/* Spinner */
.sp-spinner {
    width: 40px; height: 40px;
    border: 3px solid #E2E8F0;
    border-top-color: #6366f1;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Quiz option buttons */
.sp-option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    text-align: left;
    background: #F8FAFC;
    border: 1px solid #E2E8F0;
    border-radius: 0.75rem;
    padding: 0.85rem 1rem;
    font-weight: 600;
    font-size: 0.9rem;
    color: #334155;
    cursor: pointer;
    transition: all 0.2s;
}
.sp-option:hover:not(:disabled) {
    border-color: #6366f1;
    background: rgba(99,102,241,0.04);
}
.sp-option:disabled { cursor: default; }
.sp-option.correct {
    border-color: #22c55e;
    background: rgba(34,197,94,0.08);
}
.sp-option.wrong {
    border-color: #ef4444;
    background: rgba(239,68,68,0.08);
}

/* Bottom nav for StudyPilot */
.sp-bottom-nav {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    background: rgba(255,255,255,0.97);
    backdrop-filter: blur(16px);
    border-top: 1px solid #E2E8F0;
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 0.4rem 0 calc(0.4rem + env(safe-area-inset-bottom, 0px));
    z-index: 90;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.04);
}
.sp-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.1rem;
    text-decoration: none;
    padding: 0.35rem 0.75rem;
    border-radius: 0.625rem;
    transition: all 0.2s;
    color: #94a3b8;
}
.sp-nav-item:hover, .sp-nav-item.active {
    color: #6366f1;
    background: rgba(99,102,241,0.06);
}
.sp-nav-icon { font-size: 1.25rem; line-height: 1; }
.sp-nav-label {
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.sp-nav-fab {
    width: 48px; height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.25rem;
    color: white;
    box-shadow: 0 4px 15px rgba(99,102,241,0.35);
    margin-top: -0.75rem;
    text-decoration: none;
}

/* Alpine cloak */
[x-cloak] { display: none !important; }
