/* ==========================================================================
   TIPOGRAFÍAS OFICIALES: MANOSQUE (TÍTULOS) & CHILLAX (TEXTO Y SUBTÍTULOS)
   ========================================================================== */

/* 1. Manosque (Título principal de bienvenida y cabeceras display) */
@font-face {
    font-family: 'Manosque';
    src: url('../fonts/Manosque-Regular.woff2') format('woff2'),
         url('../fonts/Manosque-Regular.woff') format('woff'),
         url('../fonts/Manosque-Regular.ttf') format('truetype');
    font-weight: 400 900;
    font-style: normal;
    font-display: swap;
}

/* 2. Familia Chillax (Regular, Medium, Semibold y Bold) */
@font-face {
    font-family: 'Chillax';
    src: url('../fonts/Chillax-Regular.woff2') format('woff2'),
         url('../fonts/Chillax-Regular.woff') format('woff'),
         url('../fonts/Chillax-Regular.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Chillax';
    src: url('../fonts/Chillax-Medium.woff2') format('woff2'),
         url('../fonts/Chillax-Medium.woff') format('woff'),
         url('../fonts/Chillax-Medium.ttf') format('truetype');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Chillax';
    src: url('../fonts/Chillax-Semibold.woff2') format('woff2'),
         url('../fonts/Chillax-Semibold.woff') format('woff'),
         url('../fonts/Chillax-Semibold.ttf') format('truetype');
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Chillax';
    src: url('../fonts/Chillax-Bold.woff2') format('woff2'),
         url('../fonts/Chillax-Bold.woff') format('woff'),
         url('../fonts/Chillax-Bold.ttf') format('truetype');
    font-weight: 700 900;
    font-style: normal;
    font-display: swap;
}

/* Alias directo para selectores con Chillax-Bold */
@font-face {
    font-family: 'Chillax-Bold';
    src: url('../fonts/Chillax-Bold.woff2') format('woff2'),
         url('../fonts/Chillax-Bold.woff') format('woff'),
         url('../fonts/Chillax-Bold.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

:root {
    /* Paleta inspirada en el escudo del CEIP Don Quijote */
    --school-red: #c0262d;
    --school-red-dark: #991b1b;
    --school-blue: #1d4ed8;
    --school-blue-dark: #1e3a8a;
    --school-green: #15803d;
    --school-gold: #f59e0b;
    --school-gold-dark: #d97706;

    --primary-color: #c0262d;
    --primary-hover: #b91c1c;
    --primary-shadow: #991b1b;

    --secondary-color: #f59e0b;
    --secondary-hover: #d97706;
    --secondary-shadow: #b45309;

    --success-color: #16a34a;
    --success-shadow: #15803d;

    --danger-color: #dc2626;
    --danger-shadow: #991b1b;

    /* Fondo alegre y luminoso con matices de los colores institucionales */
    --bg-gradient: linear-gradient(165deg, #eff6ff 0%, #e0e7ff 22%, #fef3c7 62%, #dcfce7 100%);
    --card-bg: #ffffff;
    --text-color: #0f172a;
    --text-muted: #475569;

    --font-title: 'Manosque', cursive, 'Chillax-Bold', system-ui, sans-serif;
    --font-heading: 'Chillax-Bold', 'Chillax', system-ui, sans-serif;
    --font-main: 'Chillax', system-ui, -apple-system, sans-serif;
    --radius-lg: 24px;
    --radius-md: 16px;
    --radius-full: 9999px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-main);
    background: var(--bg-gradient);
    background-attachment: fixed;
    color: var(--text-color);
    min-height: 100vh;
    overflow-x: hidden;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    -webkit-touch-callout: none;
    -webkit-font-smoothing: antialiased;
}

/* Evitar arrastre fantasma de imágenes en navegadores y menús de toque prolongado */
img {
    -webkit-user-drag: none;
    user-drag: none;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
}

/* Elementos táctiles y lienzos sin menú contextual nativo */
canvas, .tactile-btn, button {
    -webkit-touch-callout: none;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 800;
    letter-spacing: -0.02em;
}

#app-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
}

/* Luces ambientales cálidas y vivas */
#app-container::before {
    content: '';
    position: fixed;
    top: -80px;
    right: -80px;
    width: 440px;
    height: 440px;
    background: radial-gradient(circle, rgba(37, 99, 235, 0.22) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
}

#app-container::after {
    content: '';
    position: fixed;
    bottom: -100px;
    left: -100px;
    width: 480px;
    height: 480px;
    background: radial-gradient(circle, rgba(245, 158, 11, 0.24) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
}

.view {
    display: flex;
    flex: 1;
    flex-direction: column;
    padding: 2rem 1.5rem;
    position: relative;
    z-index: 1;
}

.view-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    width: 100%;
    animation: smoothFadeIn 0.32s cubic-bezier(0.16, 1, 0.3, 1);
}

.view:not(:has(.home-top-bar)) {
    animation: smoothFadeIn 0.32s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes smoothFadeIn {
    from {
        opacity: 0;
        transform: translateY(12px) scale(0.99);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.loading-screen {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    font-size: 2.2rem;
    font-family: var(--font-heading);
    color: var(--primary-color);
    gap: 1rem;
}
