@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;800&display=swap');
:root {
    --bg-body: #F5F5F7;
    --text-main: #1D1D1F;
    --text-sec: #86868B;
    --accent: #0071E3;
    --accent-hover: #0077ED;
    --card-bg: #FFFFFF;
    --radius-l: 24px;
    --radius-m: 16px;
    /* Sombras multicapa para efecto "Elevación suave" */
    --shadow-hover: 0 20px 40px -10px rgba(0, 0, 0, 0.15), 0 0 20px -5px rgba(0, 0, 0, 0.05);
    --shadow-card: 0 4px 20px rgba(0, 0, 0, 0.04);
}


/* --- AJUSTES GLOBALES PREMIUM --- */

* {
    box-sizing: border-box;
    /* Vital para maquetación precisa */
}

::selection {
    background: rgba(0, 113, 227, 0.2);
    /* Azul suave al seleccionar texto */
    color: var(--text-main);
}


/* Scrollbar personalizado (Estilo Mac/iOS) */

::-webkit-scrollbar {
    width: 12px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background-color: rgba(0, 0, 0, 0.1);
    border-radius: 20px;
    border: 4px solid transparent;
    background-clip: content-box;
}

::-webkit-scrollbar-thumb:hover {
    background-color: rgba(0, 0, 0, 0.3);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--bg-body);
    color: var(--text-main);
    margin: 0;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    /* Texto más nítido */
    overflow-x: hidden;
}


/* --- Navbar Flotante (Mejorada con saturación) --- */

.nav-bar {
    position: sticky;
    top: 20px;
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.75);
    /* Un poco más transparente */
    backdrop-filter: blur(25px) saturate(180%);
    /* Efecto vidrio real iOS */
    -webkit-backdrop-filter: blur(25px) saturate(180%);
    border-radius: 100px;
    padding: 12px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.5);
    /* Borde sutil de luz */
    z-index: 100;
    transition: transform 0.3s ease;
}

.logo {
    font-weight: 800;
    font-size: 20px;
    letter-spacing: -0.8px;
    /* Tracking más ajustado estilo Apple */
    color: var(--text-main);
}

.btn-pill {
    background: var(--text-main);
    color: white;
    padding: 10px 24px;
    border-radius: 100px;
    font-size: 14px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.btn-pill:hover {
    transform: scale(1.05);
    background: #000;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}


/* --- Hero Section (Con Gradiente de Texto) --- */

.hero {
    text-align: center;
    padding: 100px 20px 60px;
    /* Más aire arriba */
    animation: fadeInUp 1s ease-out;
}

.hero h1 {
    font-size: 56px;
    /* Más grande */
    font-weight: 800;
    letter-spacing: -2px;
    margin-bottom: 15px;
    line-height: 1.1;
    /* Efecto gradiente sutil en el texto */
    background: linear-gradient(135deg, #1D1D1F 0%, #434344 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero p {
    color: var(--text-sec);
    font-size: 20px;
    /* Ligeramente más grande */
    max-width: 650px;
    margin: 0 auto;
    font-weight: 400;
    line-height: 1.6;
}


/* Animación de entrada */

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}


/* --- Grid de Cursos --- */

.grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 30px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
}

.course-card {
    background: var(--card-bg);
    border-radius: var(--radius-l);
    overflow: hidden;
    box-shadow: var(--shadow-card);
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    cursor: pointer;
    position: relative;
    border: 1px solid rgba(0, 0, 0, 0.04);
    /* Optimización de renderizado */
    backface-visibility: hidden;
    transform: translateZ(0);
}

.course-card:hover {
    transform: translateY(-10px) scale(1.01);
    /* Elevación y leve escala */
    box-shadow: var(--shadow-hover);
    border-color: rgba(0, 0, 0, 0.08);
}

.card-image {
    width: 100%;
    height: 220px;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.course-card:hover .card-image {
    transform: scale(1.06);
    /* Zoom más suave */
}

.card-content {
    padding: 28px;
    /* Un poco más de espacio interno */
}

.badge {
    display: inline-block;
    background: #F2F2F7;
    color: #6e6e73;
    padding: 6px 12px;
    border-radius: 8px;
    /* Más redondeado */
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}

.card-title {
    font-size: 22px;
    font-weight: 700;
    margin: 0 0 8px 0;
    line-height: 1.25;
    letter-spacing: -0.5px;
}

.card-desc {
    color: var(--text-sec);
    font-size: 15px;
    line-height: 1.5;
    margin-bottom: 24px;
    display: -webkit-box;
    /* Limitar líneas para uniformidad */
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid #F5F5F7;
    padding-top: 20px;
}

.price {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-main);
    letter-spacing: -0.5px;
}

.btn-mini {
    color: var(--accent);
    font-weight: 600;
    font-size: 14px;
    border: none;
    background: rgba(0, 113, 227, 0.05);
    /* Fondo muy sutil */
    padding: 8px 16px;
    border-radius: 100px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-mini:hover {
    background: rgba(0, 113, 227, 0.1);
    transform: translateX(3px);
    /* Pequeño movimiento a la derecha */
}


/* --- MODAL MODERNO (Refinado) --- */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    /* Fondo un poco más oscuro */
    backdrop-filter: blur(15px);
    /* Más desenfoque del fondo */
    -webkit-backdrop-filter: blur(15px);
    z-index: 999;
    display: flex;
    justify-content: center;
    align-items: flex-end;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s cubic-bezier(0.33, 1, 0.68, 1);
}

@media(min-width: 768px) {
    .modal-overlay {
        align-items: center;
    }
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-box {
    background: #FFFFFF;
    width: 100%;
    max-width: 550px;
    /* Un poco más estrecho para elegancia */
    border-radius: 28px 28px 0 0;
    padding: 0;
    overflow: hidden;
    transform: translateY(100%);
    transition: transform 0.5s cubic-bezier(0.19, 1, 0.22, 1);
    /* Curva "Spring" de iOS */
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-height: 90vh;
    overflow-y: auto;
}

@media(min-width: 768px) {
    .modal-box {
        border-radius: 28px;
        transform: translateY(40px) scale(0.96);
        box-shadow: 0 40px 100px rgba(0, 0, 0, 0.2);
    }
}

.modal-overlay.active .modal-box {
    transform: translateY(0) scale(1);
}

.modal-header-img {
    height: 240px;
    /* Más altura */
    background-size: cover;
    background-position: center;
    position: relative;
}


/* Efecto degradado sobre la imagen del modal para que el botón de cerrar se vea siempre */

.modal-header-img::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 80px;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.4), transparent);
}

.btn-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.2);
    /* Glassmorphism en el botón */
    backdrop-filter: blur(10px);
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.3);
    cursor: pointer;
    font-size: 18px;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2;
    transition: transform 0.2s;
}

.btn-close:hover {
    transform: rotate(90deg);
    background: rgba(255, 255, 255, 0.4);
}

.modal-body {
    padding: 35px;
}

.modal-meta {
    display: flex;
    gap: 12px;
    margin-bottom: 25px;
}

.meta-tag {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-main);
    background: #F5F5F7;
    padding: 6px 12px;
    border-radius: 100px;
    /* Pill shape */
    border: 1px solid rgba(0, 0, 0, 0.03);
}

.syllabus-list {
    list-style: none;
    padding: 0;
    margin: 25px 0;
    background: #F9F9FB;
    /* Bloque grisaceo */
    border-radius: 16px;
    padding: 10px 20px;
}

.syllabus-item {
    padding: 14px 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    display: flex;
    gap: 12px;
    font-size: 14px;
    color: #333;
    font-weight: 500;
}

.syllabus-item:last-child {
    border-bottom: none;
}

.check-icon {
    color: var(--accent);
    font-weight: bold;
}

.modal-cta {
    background: #1D1D1F;
    /* Casi negro Apple */
    color: white;
    width: 100%;
    padding: 18px;
    border-radius: 16px;
    font-weight: 600;
    font-size: 16px;
    border: none;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 15px;
    text-decoration: none;
    transition: all 0.2s;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.modal-cta:hover {
    transform: scale(1.02);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    background: #000;
}


/* --- FOOTER ESTILO APPLE (Refinado) --- */

.site-footer {
    background-color: #F5F5F7;
    padding: 80px 20px 40px;
    margin-top: 100px;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    font-size: 13px;
    color: #86868B;
}

.footer-content {
    max-width: 1000px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 40px;
}

.footer-column h4 {
    font-size: 12px;
    font-weight: 600;
    color: #1D1D1F;
    text-transform: uppercase;
    margin-bottom: 20px;
    letter-spacing: 0.5px;
}

.footer-column ul {
    list-style: none;
    padding: 0;
}

.footer-column ul li {
    margin-bottom: 12px;
}

.footer-column ul li a {
    color: #424245;
    text-decoration: none;
    transition: color 0.2s;
}

.footer-column ul li a:hover {
    color: var(--accent);
    text-decoration: underline;
}


/* Botón Admin en Footer */

.btn-admin-access {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #FFFFFF;
    color: #1D1D1F;
    padding: 8px 16px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s;
    border: 1px solid #D2D2D7;
    font-size: 12px;
}

.btn-admin-access:hover {
    background: #F2F2F7;
    border-color: #86868B;
}

.copyright {
    text-align: center;
    margin-top: 60px;
    padding-top: 25px;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    color: #86868B;
    font-size: 12px;
}