/* ==========================================================================
   PORTAL EDUCATIVO "EL MUNDO DE TECLITA" • NODO ANDINO
   Estilos modernos, lúdicos, responsivos y de alta accesibilidad infantil
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Fredoka:wght@400;500;600;700;800;900&family=Plus+Jakarta+Sans:wght@400;600;700;800&family=Press+Start+2P&display=swap');

:root {
    --font-heading: 'Fredoka', 'Plus Jakarta Sans', system-ui, sans-serif;
    --font-body: 'Plus Jakarta Sans', system-ui, sans-serif;
    
    /* Colores Principales del Portal */
    --bg-page: #F0F4F8;
    --bg-card: #FFFFFF;
    --text-main: #1E293B;
    --text-muted: #64748B;
    
    /* Grados Educativos */
    --color-s4: #10B981;
    --color-s4-light: #D1FAE5;
    --color-s5: #0EA5E9;
    --color-s5-light: #E0F2FE;
    --color-1g: #6366F1;
    --color-1g-light: #EEF2FF;
    --color-2g: #EC4899;
    --color-2g-light: #FCE7F3;
    --color-3g: #F59E0B;
    --color-3g-light: #FEF3C7;
    
    --shadow-soft: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.03);
    --shadow-hover: 0 20px 30px -10px rgba(99, 102, 241, 0.2);
    --border-radius-xl: 24px;
    --border-radius-lg: 18px;
    --border-radius-md: 12px;
}

body.teclita-theme {
    font-family: var(--font-body);
    background-color: var(--bg-page);
    color: var(--text-main);
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

/* ==========================================================================
   1. HERO SECTION DE TECLITA
   ========================================================================== */
.teclita-hero {
    background: linear-gradient(135deg, #1E1B4B 0%, #312E81 50%, #4338CA 100%);
    color: #FFFFFF;
    padding: 40px 20px 60px 20px;
    position: relative;
    overflow: hidden;
    border-bottom: 5px solid #6366F1;
}

.teclita-hero::before {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background-image: 
        radial-gradient(circle at 10% 20%, rgba(245, 158, 11, 0.15) 0%, transparent 20%),
        radial-gradient(circle at 90% 80%, rgba(14, 165, 233, 0.2) 0%, transparent 25%),
        radial-gradient(circle at 50% 50%, rgba(236, 72, 153, 0.15) 0%, transparent 30%);
    pointer-events: none;
}

.teclita-hero-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 2;
}

@media (min-width: 850px) {
    .teclita-hero-container {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        gap: 40px;
        text-align: left;
    }
}

.teclita-avatar-wrapper {
    position: relative;
    flex-shrink: 0;
    animation: floatAnimation 4s ease-in-out infinite;
}

.teclita-avatar-img {
    width: 200px;
    height: 200px;
    object-fit: cover;
    border-radius: 36px;
    border: 5px solid #FFFFFF;
    box-shadow: 0 15px 35px rgba(0,0,0,0.35), 0 0 25px rgba(99, 102, 241, 0.6);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.teclita-avatar-img:hover {
    transform: scale(1.05) rotate(-2deg);
}

.teclita-badge-online {
    position: absolute;
    bottom: -10px;
    right: 15px;
    background: #10B981;
    color: white;
    font-size: 0.8rem;
    font-weight: 800;
    padding: 6px 14px;
    border-radius: 99px;
    border: 3px solid white;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    display: flex;
    align-items: center;
    gap: 6px;
}

.teclita-badge-online .dot {
    width: 8px;
    height: 8px;
    background: #FFFFFF;
    border-radius: 50%;
    animation: pulse 1.5s infinite;
}

.teclita-hero-text {
    flex: 1;
    margin-top: 20px;
}

@media (min-width: 850px) {
    .teclita-hero-text {
        margin-top: 0;
    }
}

.teclita-tag {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.25);
    padding: 6px 16px;
    border-radius: 99px;
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: #FDE047;
    margin-bottom: 12px;
}

.teclita-title {
    font-family: var(--font-heading);
    font-size: 2.6rem;
    font-weight: 900;
    line-height: 1.1;
    margin: 0 0 12px 0;
    text-shadow: 0 3px 6px rgba(0,0,0,0.3);
}

.teclita-title span {
    color: #38BDF8;
}

/* Burbuja de diálogo de Teclita */
.teclita-speech-bubble {
    background: #FFFFFF;
    color: #1E293B;
    border-radius: 20px;
    padding: 14px 20px;
    position: relative;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    margin-top: 15px;
    max-width: 600px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

@media (min-width: 600px) {
    .teclita-speech-bubble {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }
}

.teclita-speech-text {
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.4;
    margin: 0;
}

.btn-speak-teclita {
    background: #4F46E5;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 99px;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    transition: all 0.2s ease;
    box-shadow: 0 4px 10px rgba(79, 70, 229, 0.3);
}

.btn-speak-teclita:hover {
    background: #4338CA;
    transform: translateY(-2px);
}

/* ==========================================================================
   2. GRAN ESTRENO & SPOTLIGHT: SUPER TECLITA BROS
   ========================================================================== */
.spotlight-section {
    max-width: 1200px;
    margin: -35px auto 25px auto;
    padding: 0 15px;
    position: relative;
    z-index: 15;
}

.spotlight-card {
    background: linear-gradient(135deg, #0F172A 0%, #1E1B4B 60%, #312E81 100%);
    border: 4px solid #F59E0B;
    border-radius: var(--border-radius-xl);
    box-shadow: 0 20px 40px -10px rgba(245, 158, 11, 0.3), 0 0 25px rgba(99, 102, 241, 0.4);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    position: relative;
    transition: transform 0.3s ease;
}

@media (min-width: 850px) {
    .spotlight-card {
        flex-direction: row;
        align-items: stretch;
    }
}

.spotlight-card:hover {
    transform: translateY(-4px);
}

.spotlight-media {
    flex: 1.1;
    position: relative;
    overflow: hidden;
    min-height: 260px;
    background: #000000;
}

.spotlight-banner-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.spotlight-card:hover .spotlight-banner-img {
    transform: scale(1.04);
}

.spotlight-badge-pulse {
    position: absolute;
    top: 15px;
    left: 15px;
    background: #EF4444;
    color: #FFFFFF;
    font-family: 'Fredoka', sans-serif;
    font-weight: 800;
    font-size: 0.85rem;
    padding: 6px 14px;
    border-radius: 99px;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.5);
    display: flex;
    align-items: center;
    gap: 6px;
    animation: bounce 2s infinite;
}

.spotlight-content {
    flex: 1.3;
    padding: 28px 32px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    color: #FFFFFF;
}

.spotlight-tag-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.spotlight-tag {
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #FDE047;
    font-size: 0.75rem;
    font-weight: 800;
    padding: 4px 10px;
    border-radius: 99px;
    text-transform: uppercase;
}

.spotlight-title {
    font-family: 'Press Start 2P', monospace;
    font-size: 1.4rem;
    color: #F8FAFC;
    text-shadow: 0 3px 0 #312E81, 0 0 15px rgba(56, 189, 248, 0.7);
    margin: 0 0 8px 0;
    line-height: 1.3;
}

.spotlight-subtitle {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 800;
    color: #38BDF8;
    margin: 0 0 12px 0;
}

.spotlight-desc {
    color: #C7D2FE;
    font-size: 0.95rem;
    line-height: 1.5;
    margin: 0 0 20px 0;
}

.spotlight-btn-play {
    background: linear-gradient(180deg, #10B981 0%, #059669 100%);
    color: #FFFFFF;
    font-family: 'Press Start 2P', monospace;
    font-size: 0.95rem;
    padding: 14px 24px;
    border: 3px solid #34D399;
    border-radius: 14px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 6px 0 #064E3B, 0 10px 20px rgba(16, 185, 129, 0.4);
    transition: all 0.15s ease;
    align-self: flex-start;
}

.spotlight-btn-play:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 0 #064E3B, 0 14px 25px rgba(16, 185, 129, 0.6);
}

.spotlight-btn-play:active {
    transform: translateY(4px);
    box-shadow: 0 2px 0 #064E3B;
}

/* ==========================================================================
   3. MENÚ DE NAVEGACIÓN POR GRADOS (TABS)
   ========================================================================== */
.grade-nav-section {
    max-width: 1200px;
    margin: 20px auto 30px auto;
    padding: 0 15px;
    position: relative;
    z-index: 10;
}

.grade-tabs-container {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding: 8px 4px 14px 4px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}

.grade-tabs-container::-webkit-scrollbar {
    display: none;
}

.grade-tab-btn {
    flex: 1;
    min-width: 170px;
    background: #FFFFFF;
    border: 3px solid #E2E8F0;
    border-radius: var(--border-radius-lg);
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 4px 12px rgba(0,0,0,0.06);
    outline: none;
}

.grade-tab-btn:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.08);
}

.grade-tab-icon {
    font-size: 1.8rem;
    margin-bottom: 4px;
    transition: transform 0.2s;
}

.grade-tab-btn:hover .grade-tab-icon {
    transform: scale(1.15);
}

.grade-tab-name {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    font-weight: 800;
    color: #1E293B;
    margin: 0;
    text-align: center;
    line-height: 1.2;
}

.grade-tab-count {
    font-size: 0.75rem;
    font-weight: 700;
    color: #64748B;
    background: #F1F5F9;
    padding: 2px 8px;
    border-radius: 99px;
    margin-top: 5px;
}

/* Estados Activos por Grado */
.grade-tab-btn[data-grade="s4"].active {
    background: var(--color-s4-light);
    border-color: var(--color-s4);
    box-shadow: 0 8px 20px rgba(16, 185, 129, 0.25);
}
.grade-tab-btn[data-grade="s4"].active .grade-tab-name { color: #065F46; }

.grade-tab-btn[data-grade="s5"].active {
    background: var(--color-s5-light);
    border-color: var(--color-s5);
    box-shadow: 0 8px 20px rgba(14, 165, 233, 0.25);
}
.grade-tab-btn[data-grade="s5"].active .grade-tab-name { color: #0369A1; }

.grade-tab-btn[data-grade="1g"].active {
    background: var(--color-1g-light);
    border-color: var(--color-1g);
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.25);
}
.grade-tab-btn[data-grade="1g"].active .grade-tab-name { color: #3730A3; }

.grade-tab-btn[data-grade="2g"].active {
    background: var(--color-2g-light);
    border-color: var(--color-2g);
    box-shadow: 0 8px 20px rgba(236, 72, 153, 0.25);
}
.grade-tab-btn[data-grade="2g"].active .grade-tab-name { color: #9D174D; }

.grade-tab-btn[data-grade="3g"].active {
    background: var(--color-3g-light);
    border-color: var(--color-3g);
    box-shadow: 0 8px 20px rgba(245, 158, 11, 0.25);
}
.grade-tab-btn[data-grade="3g"].active .grade-tab-name { color: #92400E; }

/* ==========================================================================
   4. FILTROS POR HABILIDAD
   ========================================================================== */
.skills-filter-row {
    max-width: 1200px;
    margin: 0 auto 25px auto;
    padding: 0 15px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.filter-label {
    font-size: 0.85rem;
    font-weight: 700;
    color: #64748B;
    margin-right: 5px;
}

.skill-pill-btn {
    background: #FFFFFF;
    border: 1.5px solid #CBD5E1;
    color: #475569;
    padding: 6px 14px;
    border-radius: 99px;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.skill-pill-btn:hover {
    background: #F8FAFC;
    border-color: #94A3B8;
    color: #1E293B;
}

.skill-pill-btn.active {
    background: #1E293B;
    border-color: #1E293B;
    color: #FFFFFF;
}

/* ==========================================================================
   5. GRILLA DE JUEGOS Y TARJETAS LÚDICAS
   ========================================================================== */
.games-container {
    max-width: 1200px;
    margin: 0 auto 60px auto;
    padding: 0 15px;
}

.grade-panel {
    display: none;
    animation: fadeIn 0.3s ease-in-out;
}

.grade-panel.active {
    display: block;
}

.grade-panel-header {
    background: #FFFFFF;
    border-radius: var(--border-radius-lg);
    padding: 20px 25px;
    margin-bottom: 25px;
    border: 2px solid #E2E8F0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

@media (min-width: 700px) {
    .grade-panel-header {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
}

.grade-header-info h2 {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    font-weight: 800;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.grade-header-info p {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin: 4px 0 0 0;
}

.teclita-tip-box {
    background: #FEF3C7;
    border-left: 4px solid #F59E0B;
    padding: 10px 16px;
    border-radius: 0 12px 12px 0;
    font-size: 0.9rem;
    font-weight: 600;
    color: #92400E;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Grid de Tarjetas */
.teclita-games-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
}

@media (min-width: 600px) {
    .teclita-games-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 950px) {
    .teclita-games-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.teclita-card {
    background: #FFFFFF;
    border-radius: var(--border-radius-xl);
    border: 3px solid #E2E8F0;
    box-shadow: var(--shadow-soft);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    text-decoration: none;
    color: inherit;
}

.teclita-card:hover {
    transform: translateY(-8px);
    border-color: #6366F1;
    box-shadow: var(--shadow-hover);
}

.card-banner {
    height: 150px;
    background: #1E293B;
    background-size: cover;
    background-position: center;
    position: relative;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 12px;
}

.card-banner::after {
    content: "";
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 60px;
    background: linear-gradient(to top, rgba(0,0,0,0.6), transparent);
}

.card-tag-badge {
    background: #FFFFFF;
    color: #1E293B;
    font-family: var(--font-heading);
    font-size: 0.75rem;
    font-weight: 800;
    padding: 4px 10px;
    border-radius: 99px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
    z-index: 2;
}

.card-skill-badge {
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(4px);
    color: #FFFFFF;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 99px;
    border: 1px solid rgba(255,255,255,0.3);
    z-index: 2;
}

.card-body {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.card-title {
    font-family: var(--font-heading);
    font-size: 1.3rem;
    font-weight: 800;
    color: #0F172A;
    margin: 0 0 8px 0;
    line-height: 1.25;
}

.card-desc {
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.5;
    margin: 0 0 18px 0;
    flex: 1;
}

.card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 14px;
    border-top: 2px dashed #E2E8F0;
}

.card-meta {
    font-size: 0.8rem;
    font-weight: 700;
    color: #64748B;
    display: flex;
    align-items: center;
    gap: 5px;
}

.btn-play-game {
    background: #4F46E5;
    color: #FFFFFF;
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 0.95rem;
    padding: 8px 16px;
    border-radius: 12px;
    border: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
    box-shadow: 0 4px 10px rgba(79, 70, 229, 0.3);
}

.teclita-card:hover .btn-play-game {
    background: #4338CA;
    transform: scale(1.05);
}

/* ==========================================================================
   6. ANIMACIONES
   ========================================================================== */
@keyframes floatAnimation {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-10px) rotate(1.5deg); }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-4px); }
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}
