/* ========================================
   Biblioteca de Ejercicios — Stylesheet
   ======================================== */

/* ── NAV OVERRIDES ── */
.nav-links {
    display: flex;
    align-items: center;
}
.nav-back {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--bc-cyan);
    padding: 8px 20px;
    border-radius: 50px;
    border: 1.5px solid var(--bc-cyan);
    transition: all 0.3s;
}
.nav-back:hover {
    background: var(--bc-cyan);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(0, 123, 189, 0.3);
}

/* ── HERO BIBLIOTECA ── */
.biblio-hero {
    min-height: 85vh;
    background: var(--bc-blue);
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}
.biblio-hero-bg {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 90% 70% at 60% 40%, rgba(0, 123, 189, 0.35), transparent),
        radial-gradient(ellipse 60% 90% at 10% 80%, rgba(0, 55, 128, 0.5), transparent),
        radial-gradient(ellipse 40% 40% at 90% 20%, rgba(0, 145, 219, 0.2), transparent);
    pointer-events: none;
    z-index: 1;
}
.biblio-hero-particles {
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none;
    overflow: hidden;
}
.particle {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.06);
    animation: floatParticle linear infinite;
}
@keyframes floatParticle {
    0% { transform: translateY(0) scale(1); opacity: 0; }
    10% { opacity: 1; }
    90% { opacity: 1; }
    100% { transform: translateY(-100vh) scale(0.5); opacity: 0; }
}

.biblio-hero-content {
    position: relative;
    z-index: 3;
    text-align: center;
    color: var(--white);
    padding: 120px 40px 80px;
    max-width: 800px;
}
.biblio-badge {
    display: inline-block;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 8px 24px;
    border-radius: 50px;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 2px;
    margin-bottom: 28px;
    backdrop-filter: blur(4px);
    animation: fadeSlideDown 0.8s ease both;
}
.biblio-title {
    font-size: clamp(2.8rem, 6vw, 4.5rem);
    font-weight: 800;
    line-height: 1.05;
    margin-bottom: 24px;
    animation: fadeSlideDown 0.8s 0.15s ease both;
    background: linear-gradient(135deg, #ffffff, #a8d8ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.biblio-subtitle {
    font-size: 1.2rem;
    opacity: 0.85;
    max-width: 600px;
    margin: 0 auto 50px;
    line-height: 1.6;
    font-weight: 300;
    animation: fadeSlideDown 0.8s 0.3s ease both;
}
@keyframes fadeSlideDown {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

.biblio-scroll-hint {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    animation: fadeSlideDown 0.8s 0.5s ease both;
}
.biblio-scroll-hint span {
    font-size: 0.82rem;
    font-weight: 500;
    letter-spacing: 1px;
    opacity: 0.6;
    text-transform: uppercase;
}
.scroll-arrow {
    width: 24px;
    height: 24px;
    border-right: 2px solid rgba(255, 255, 255, 0.5);
    border-bottom: 2px solid rgba(255, 255, 255, 0.5);
    transform: rotate(45deg);
    animation: bounceArrow 2s infinite;
}
@keyframes bounceArrow {
    0%, 100% { transform: rotate(45deg) translateY(0); }
    50% { transform: rotate(45deg) translateY(8px); }
}

/* ── LEVELS SECTION ── */
.levels-section {
    background: var(--bg-light);
    position: relative;
}
.levels-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 200px;
    background: linear-gradient(180deg, rgba(0, 53, 128, 0.03), transparent);
    pointer-events: none;
}
.levels-desc {
    text-align: center;
    color: var(--gray-text);
    font-size: 1.05rem;
    max-width: 650px;
    margin: -16px auto 48px;
    line-height: 1.6;
}

.levels-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 28px;
}

/* ── LEVEL CARD ── */
.level-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 36px;
    border: 1px solid var(--border);
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}
.level-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--bc-blue), var(--bc-cyan));
    opacity: 0;
    transition: opacity 0.3s;
}
.level-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 20px 50px rgba(0, 53, 128, 0.12);
    border-color: transparent;
}
.level-card:hover::before {
    opacity: 1;
}
.level-card.active {
    border-color: var(--bc-cyan);
    box-shadow: 0 20px 50px rgba(0, 123, 189, 0.15);
}
.level-card.active::before {
    opacity: 1;
}
.level-card.wide {
    grid-column: 1 / -1;
}

.level-card-glow {
    position: absolute;
    width: 250px;
    height: 250px;
    border-radius: 50%;
    top: -100px;
    right: -80px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.4s;
}
.level-card:hover .level-card-glow {
    opacity: 1;
}

/* Level badges */
.level-header {
    display: flex;
    align-items: center;
    gap: 18px;
    margin-bottom: 16px;
}
.level-badge {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    font-weight: 800;
    color: white;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
}
.level-badge::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.2), transparent);
    pointer-events: none;
}
.level-badge.a1 {
    background: linear-gradient(135deg, #10b981, #059669);
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}
.level-badge.a2 {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
}
.level-badge.b1 {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.3);
}
.level-badge.b2 {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.3);
}
.level-badge.c {
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.3);
    font-size: 1rem;
}

/* Glow colors per level */
[data-level="A1"] .level-card-glow { background: radial-gradient(circle, rgba(16, 185, 129, 0.08), transparent 70%); }
[data-level="A2"] .level-card-glow { background: radial-gradient(circle, rgba(59, 130, 246, 0.08), transparent 70%); }
[data-level="B1"] .level-card-glow { background: radial-gradient(circle, rgba(245, 158, 11, 0.08), transparent 70%); }
[data-level="B2"] .level-card-glow { background: radial-gradient(circle, rgba(239, 68, 68, 0.08), transparent 70%); }
[data-level="C1-C2"] .level-card-glow { background: radial-gradient(circle, rgba(139, 92, 246, 0.08), transparent 70%); }

.level-info h3 {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--bc-blue);
    line-height: 1.2;
}
.level-tag {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--gray-text);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.level-desc {
    font-size: 0.92rem;
    color: var(--gray-text);
    line-height: 1.6;
    margin-bottom: 20px;
}

/* ── SKILL CHIPS ── */
.level-skills {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                opacity 0.4s ease,
                margin 0.4s ease;
    margin-bottom: 0;
}
.level-card.active .level-skills {
    max-height: 200px;
    opacity: 1;
    margin-bottom: 20px;
}

.skill-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 22px;
    border-radius: 12px;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text);
    background: var(--bg-light);
    border: 1.5px solid var(--border);
    transition: all 0.3s;
    cursor: pointer;
    text-decoration: none;
}
.skill-chip:hover {
    border-color: var(--bc-cyan);
    background: rgba(0, 123, 189, 0.06);
    color: var(--bc-cyan);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 123, 189, 0.12);
}
.skill-icon {
    font-size: 1.15rem;
    line-height: 1;
}

/* Skill-specific hover colors */
.skill-chip[data-skill="listening"]:hover {
    border-color: #8b5cf6;
    background: rgba(139, 92, 246, 0.06);
    color: #7c3aed;
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.12);
}
.skill-chip[data-skill="speaking"]:hover {
    border-color: #ef4444;
    background: rgba(239, 68, 68, 0.06);
    color: #dc2626;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.12);
}
.skill-chip[data-skill="reading"]:hover {
    border-color: #10b981;
    background: rgba(16, 185, 129, 0.06);
    color: #059669;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.12);
}
.skill-chip[data-skill="writing"]:hover {
    border-color: #f59e0b;
    background: rgba(245, 158, 11, 0.06);
    color: #d97706;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.12);
}
.skill-chip[data-skill="vocabulary"]:hover {
    border-color: var(--bc-cyan);
    background: rgba(0, 123, 189, 0.06);
    color: var(--bc-cyan);
    box-shadow: 0 4px 12px rgba(0, 123, 189, 0.12);
}

/* ── LEVEL FOOTER ── */
.level-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}
.exercise-count {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--gray-text);
}
.level-arrow {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--bg-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: var(--gray-text);
    transition: all 0.3s;
    font-weight: 300;
}
.level-card:hover .level-arrow {
    background: var(--bc-cyan);
    color: white;
}
.level-card.active .level-arrow {
    background: var(--bc-cyan);
    color: white;
    transform: rotate(90deg);
}

/* ── RESPONSIVE ── */
@media (max-width: 960px) {
    .biblio-hero {
        min-height: 70vh;
    }
    .biblio-hero-content {
        padding: 100px 24px 60px;
    }
    .levels-grid {
        grid-template-columns: 1fr;
    }
    .level-card.wide {
        grid-column: auto;
    }
}

@media (max-width: 600px) {
    .biblio-title {
        font-size: 2.4rem;
    }
    .biblio-subtitle {
        font-size: 1rem;
    }
    .level-card {
        padding: 28px 22px;
    }
    .level-badge {
        width: 52px;
        height: 52px;
        font-size: 1.1rem;
    }
    .level-badge.c {
        font-size: 0.85rem;
    }
    .level-info h3 {
        font-size: 1.15rem;
    }
    .skill-chip {
        padding: 10px 16px;
        font-size: 0.82rem;
    }
    .nav-back {
        font-size: 0.8rem;
        padding: 6px 14px;
    }
}