/* --- 1. VARIABLES Y PALETA CELSIUS (IG STYLE) --- */
:root {
    /* Colores extraídos de tus imágenes */
    --brand-blue: #152858;   /* Azul oscuro profundo (Header y fondos) */
    --brand-cyan: #00AEEF;   /* Celeste brillante (Detalles y acentos) */
    --brand-yellow: #FFC107; /* Amarillo (Logo y alertas) */
    
    /* Tema Claro */
    --bg-body: #E8EBF0;      /* Gris azulado muy suave */
    --bg-container: #ffffff;
    --text-primary: #152858; /* Texto principal en azul oscuro */
    --text-secondary: #586885;
    --header-bg: linear-gradient(135deg, #0f1c3f 0%, #1c3575 100%);
    --header-text: #ffffff;
    --card-bg: #ffffff;
    --icon-bg: #F0F7FF;      /* Fondo de iconos muy suave */
    --shadow: 0 8px 25px rgba(21, 40, 88, 0.1); /* Sombra azulada elegante */
    --modal-bg: #ffffff;
    --course-border: #eee;
    --details-bg: #f8faff;
    
    --radius: 18px; /* Bordes un poco más redondeados y modernos */
}

/* Tema Oscuro (Estilo "Night Tech") */
body.dark-mode {
    --bg-body: #0a0f1d;
    --bg-container: #121826;
    --text-primary: #ffffff;
    --text-secondary: #a0aabf;
    --header-bg: linear-gradient(180deg, #0a0f1d 0%, #152036 100%);
    --header-text: #ffffff;
    --card-bg: #1c253b;
    --icon-bg: #252f4a;
    --shadow: 0 4px 20px rgba(0,0,0,0.4);
    --modal-bg: #121826;
    --course-border: #2d3a52;
    --details-bg: #1a2236;
}

/* --- 2. ESTILOS GENERALES --- */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Montserrat', sans-serif; /* FUENTE NUEVA */
    background-color: var(--bg-body);
    color: var(--text-primary);
    display: flex; justify-content: center; min-height: 100vh;
    transition: background-color 0.3s, color 0.3s;
}

.mobile-container {
    width: 100%; max-width: 480px;
    background: var(--bg-container);
    min-height: 100vh; position: relative;
    box-shadow: var(--shadow); overflow-x: hidden;
    padding-bottom: 50px;
}

/* --- 3. HEADER IMPONENTE --- */
.header {
    background: var(--header-bg);
    color: var(--header-text);
    padding: 3.5rem 1.5rem 3rem;
    text-align: center;
    border-bottom-left-radius: 40px;
    border-bottom-right-radius: 40px;
    position: relative;
    box-shadow: 0 10px 30px rgba(21, 40, 88, 0.25);
}

.theme-btn {
    position: absolute; top: 20px; right: 20px;
    background: rgba(255,255,255,0.15); border: none;
    font-size: 1.2rem; width: 40px; height: 40px; border-radius: 50%;
    cursor: pointer; display: flex; align-items: center; justify-content: center;
    backdrop-filter: blur(5px); transition: background 0.3s;
}
.theme-btn:hover { background: rgba(255,255,255,0.25); }

.logo-placeholder {
    width: 150px;
    height: 150px; /* Forzamos que sea cuadrada para que el círculo sea perfecto */
    
    background: transparent;
    border: none;
    padding: 0;
    margin: 0 auto 0.5rem;
    display: block;
    
    /* EL TRUCO: Esto recorta las esquinas azules sobrantes */
    border-radius: 50%; 
    object-fit: cover; /* Asegura que la imagen llene el círculo */
}

.institute-name { 
    font-size: 1.5rem; font-weight: 800; /* Más grueso como en IG */
    margin-bottom: 0.3rem; letter-spacing: 0.5px; text-transform: uppercase;
}
.institute-location { font-size: 0.9rem; font-weight: 500; opacity: 0.85; }

/* --- 4. BOTONES FLOTANTES (MODO CIRCULAR) --- */
.action-buttons {
    display: flex;
    gap: 25px; /* Aumenté un poco la separación para que respiren mejor */
    padding: 0 1.5rem;
    margin-top: -2rem; /* Ajusta esto si sientes que quedan muy arriba o abajo */
    margin-bottom: 2.5rem;
    position: relative; z-index: 10;
    justify-content: center; /* NUEVO: Centra los botones horizontalmente */
}

.btn-social {
    width: 65px;        
    height: 65px;       
    border-radius: 50%; 
    padding: 0;         /* Importante: 0 padding */
    
    background: var(--card-bg); /* Fondo blanco */
    box-shadow: var(--shadow);
    transition: transform 0.2s;
    
    /* Esto centra la imagen PNG justo al medio */
    display: flex; 
    align-items: center; 
    justify-content: center; 
}
.btn-social:hover {
    transform: translateY(-3px); /* Pequeño efecto al pasar el mouse */
    box-shadow: 0 10px 20px rgba(0,0,0,0.15);
}

.btn-social:active { transform: scale(0.95); }
/* Los colores se mantienen igual */
.whatsapp { color: #25D366; }
.instagram { color: #E1306C; }

/* --- 5. MENÚ --- */
.menu-section { padding: 0 1.5rem 2rem; }
.section-title { 
    font-size: 0.8rem; text-transform: uppercase; letter-spacing: 2px; 
    color: var(--text-secondary); margin-bottom: 1.2rem; font-weight: 800; 
    border-left: 4px solid var(--brand-yellow); padding-left: 10px; /* Detalle estético */
}

.card-btn {
    background: var(--card-bg); width: 100%; padding: 1.5rem; margin-bottom: 1rem;
    border: none; border-radius: var(--radius);
    box-shadow: var(--shadow);
    display: flex; justify-content: space-between; align-items: center;
    cursor: pointer; transition: all 0.3s ease; text-align: left;
}
.card-btn:hover { transform: translateY(-3px); box-shadow: 0 12px 30px rgba(0,0,0,0.1); }

.card-icon { 
    font-size: 1.8rem; margin-right: 18px; 
    background: var(--icon-bg); color: var(--brand-blue); 
    padding: 12px; border-radius: 14px; 
}
/* En modo oscuro, usamos el Cyan para el icono para resaltar */
body.dark-mode .card-icon { color: var(--brand-cyan); }

.card-text h3 { font-size: 1.1rem; color: var(--text-primary); margin-bottom: 4px; font-weight: 700; }
.card-text p { font-size: 0.8rem; color: var(--text-secondary); font-weight: 500; }
.arrow { color: var(--brand-cyan); font-size: 1.5rem; font-weight: 800; }

.footer { text-align: center; padding: 2rem; color: var(--text-secondary); font-size: 0.75rem; font-weight: 600; opacity: 0.6; }

/* --- 6. MODAL --- */
.modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(15, 28, 63, 0.7); /* Fondo azulado oscuro */
    z-index: 100; opacity: 0; visibility: hidden; transition: all 0.3s;
    backdrop-filter: blur(4px);
}

.modal-sheet {
    position: fixed; bottom: -100%; left: 0; width: 100%;
    background: var(--modal-bg);
    border-top-left-radius: 35px; border-top-right-radius: 35px;
    padding: 2.5rem 1.5rem; z-index: 101;
    transition: bottom 0.4s cubic-bezier(0.19, 1, 0.22, 1);
    max-height: 85vh; overflow-y: auto; color: var(--text-primary);
}

.modal-open .modal-overlay { opacity: 1; visibility: visible; }
.modal-open .modal-sheet { bottom: 0; }

.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 2rem; }
.modal-header h2 { 
    color: var(--brand-blue); font-weight: 800; font-size: 1.4rem; 
    border-bottom: 3px solid var(--brand-cyan); padding-bottom: 5px; /* Subrayado estilo IG */
}
body.dark-mode .modal-header h2 { color: white; }

.close-btn { 
    background: var(--icon-bg); color: var(--text-primary); border: none; 
    width: 40px; height: 40px; border-radius: 50%; font-size: 1.2rem; 
    cursor: pointer; transition: 0.2s; 
}

/* --- 7. ACORDEÓN DE CURSOS --- */
.course-item-container { border-bottom: 1px solid var(--course-border); margin-bottom: 12px; }

.course-header { display: flex; justify-content: space-between; align-items: center; padding: 1rem 0.5rem; cursor: pointer; }
.course-title { font-weight: 700; color: var(--text-primary); font-size: 1rem; }
.course-arrow { font-size: 1.2rem; color: var(--brand-cyan); transition: transform 0.3s; }

.modalidad-badge {
    display: inline-block; font-size: 0.7rem; font-weight: 600;
    color: var(--brand-blue); background: var(--icon-bg);
    padding: 4px 10px; border-radius: 6px; margin-top: 6px;
}
body.dark-mode .modalidad-badge { color: var(--brand-cyan); }

.course-details {
    max-height: 0; overflow: hidden; transition: max-height 0.35s ease-out;
    background: var(--details-bg); border-radius: 12px;
}

.course-details-content { padding: 1.5rem; font-size: 0.9rem; color: var(--text-secondary); line-height: 1.6; }
.course-item-container.active .course-details { max-height: 500px; transition: max-height 0.5s ease-in; }
.course-item-container.active .course-arrow { transform: rotate(180deg); }

.btn-consultar {
    display:block; background: var(--brand-blue); color: white;
    text-align:center; padding:18px; border-radius:16px; margin-top:30px;
    text-decoration:none; font-weight: 700; font-size: 1rem; text-transform: uppercase; letter-spacing: 1px;
    box-shadow: 0 4px 15px rgba(0, 174, 239, 0.3); /* Sombra Cyan */
}

/* --- Imágenes PNG de redes sociales --- */
.wpp-img {
    width: 40px;         /* Bajamos de 40px a 32px */
    height: 40px;        /* Bajamos de 40px a 32px */
    object-fit: contain;
    display: block;
}

/* --- Imágenes PNG de redes sociales --- */
.ig-img {
    width: 32px;         /* Bajamos de 40px a 32px */
    height: 32px;        /* Bajamos de 40px a 32px */
    object-fit: contain;
    display: block;
}

/* --- 8. GRILLA DE CONVENIOS (VERSION GRANDE) --- */
.convenios-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;      /* Espacio entre burbujas */
    margin-top: 15px;
    padding-bottom: 20px;
}

.convenio-item {
    width: 80px;       /* ANTES: 60px -> AHORA: 80px (Más grandes) */
    height: 80px;
    background: var(--card-bg);
    border-radius: 50%;
    box-shadow: var(--shadow);
    display: flex; align-items: center; justify-content: center;
    transition: transform 0.2s;
    text-decoration: none;
    padding: 10px;    /* Un poco de margen interno para que no toquen el borde */
}

.convenio-item:hover { transform: translateY(-3px); }

.convenio-img {
    width: 100%;      /* Hacemos que la imagen ocupe todo el espacio disponible del padding */
    height: 100%;
    object-fit: contain; /* Ajusta el logo sin recortarlo */
    
    /* Filtro Suave: Los dejamos en blanco y negro pero más nítidos */
    filter: grayscale(100%); 
    opacity: 0.8;    /* Subimos la opacidad para que se vean mejor */
    transition: all 0.3s;
}

.convenio-item:hover .convenio-img {
    filter: grayscale(0%);
    opacity: 1;
    transform: scale(1.1); /* Pequeño zoom al logo cuando lo tocan */
}