:root {
    --primary: #0555ac;
    --secondary: #babdbf;
    --success: #28a745;
    --info: #17a2b8;
    --warning: #ffc107;
    --danger: #dc3545;
    --light: #f4f6f9;
    --dark: #343a40;
}

body {
    font-family: 'Source Sans Pro', sans-serif;
    background-color: var(--light);
    color: #333;
    overflow-x: hidden;
}

/* ADMINLTE CARDS */
.card {
    border: 0;
    box-shadow: 0 0 1px rgba(0,0,0,.125), 0 1px 3px rgba(0,0,0,.2);
    margin-bottom: 1.5rem;
    border-radius: 0.25rem;
}
.card-header {
    background-color: transparent;
    border-bottom: 1px solid rgba(0,0,0,.125);
    padding: 0.75rem 1.25rem;
    font-weight: 600;
}
.card-primary { border-top: 3px solid var(--primary); }
.card-success { border-top: 3px solid var(--success); }
.card-warning { border-top: 3px solid var(--warning); }
.card-danger { border-top: 3px solid var(--danger); }
.card-info { border-top: 3px solid var(--info); }

/* NAVBAR */
.navbar {
    box-shadow: 0 1px 3px rgba(0,0,0,.125);
    background-color: var(--primary);
}
.navbar-brand h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
    margin: 0;
}

/* TOP BAR */
.top-bar {
    background-color: var(--dark);
    color: #000;
    font-size: 0.85rem;
    padding: 5px 0;
}

/* ⚠️ BOTONES INSTITUCIONES - CRÍTICO PARA MÓVIL */
.school-access-btn {
    transition: all 0.3s;
    border: 1px solid #ddd;
    background: #fff;
    border-radius: 4px;
    overflow: hidden;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 10px;
    text-decoration: none;
    color: #333;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
.school-access-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    border-color: var(--primary);
    color: var(--primary);
}
.school-access-btn img {
    width: 50px;
    height: 50px;
    object-fit: contain;
    margin-bottom: 5px;
    border-radius: 50%;
    border: 1px solid #eee;
}
.school-access-btn span {
    font-size: 0.75rem;
    font-weight: 600;
    text-align: center;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ICONOS FLOTANTES - Responsivo */
.floating-icons2 {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    right: 10px;
    z-index: 1050;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: rgba(255,255,255,0.9);
    padding: 10px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}
.floating-icons2 a {
    display: block;
    transition: transform 0.2s;
}
.floating-icons2 a:hover {
    transform: scale(1.1);
}
@media (max-width: 768px) {
    .floating-icons2 {
        top: auto;
        bottom: 20px;
        right: 20px;
        flex-direction: row;
        transform: none;
    }
}

/* CAROUSEL */
.carousel-item img {
    max-height: 600px;
    object-fit: cover;
    filter: brightness(0.7);
}
.carousel-caption {
    bottom: 20%;
}

/* ANIMACIONES */
.fade-animation { animation: fade 5s infinite; }
@keyframes fade {
    0% { opacity: 1; }
    50% { opacity: 0.6; }
    100% { opacity: 1; }
}

/* NIEVE */
.nieve-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    display: none;
}
.copo {
    position: absolute;
    background: white;
    border-radius: 50%;
    opacity: 0.65;
    animation: caerNieve linear infinite;
}
@keyframes caerNieve {
    0% { transform: translateY(-20px); opacity: 0.65; }
    100% { transform: translateY(100vh); opacity: 0; }
}

/* VIDEOS MÓVILES */
.mobile-tutorial-videos { display: none; }
@media (max-width: 767px) {
    .mobile-tutorial-videos { display: block; }
    .desktop-only-section { display: none; }
}
@media (min-width: 768px) {
    .mobile-only-section { display: none; }
}

/* FORMULARIOS */
.form-control {
    border-radius: 0.25rem;
    border: 1px solid #ced4da;
}
.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 0.2rem rgba(0,123,255,.25);
}

/* SPINNER */
#spinner {
    position: fixed;
    inset: 0;
    background: #fff;
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* BACK TO TOP */
.back-to-top {
    position: fixed;
    bottom: 20px;
    right: 20px;
    display: none;
    z-index: 1040;
}

.superpuesto {
    position: relative;
}

.texto-superpuesto {
    position: absolute;
    top: 30px;
    font-size: 14px;
    left: 45px;
    /*background-color: white;*/
    padding: 5px;
}

/* CAROUSEL MODERNO */
.carousel-inner {
    margin-left: 0;
}

.carousel-caption-custom {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    right: auto;
    bottom: auto;
    text-align: center;
    padding: 2rem;
    z-index: 10;
}

.text-shadow {
    text-shadow: 2px 2px 4px rgba(0,0,0,0.7);
}

/* Ajuste para sidebar izquierda */
@media (min-width: 768px) {
    #header-carousel {
        margin-left: 0;
    }
    .carousel-inner {
        padding-left: 0;
    }
}

/* Indicadores modernos */
.carousel-indicators {
    bottom: 20px;
    z-index: 20;
}

.carousel-indicators button {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin: 0 5px;
    opacity: 0.6;
    transition: all 0.3s;
}

.carousel-indicators button.active {
    opacity: 1;
    width: 30px;
    border-radius: 6px;
}

/* Controles mejorados */
.carousel-control-prev,
.carousel-control-next {
    width: 50px;
    height: 50px;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0.7;
    transition: opacity 0.3s;
}

.carousel-control-prev:hover,
.carousel-control-next:hover {
    opacity: 1;
}

.carousel-control-prev-icon,
.carousel-control-next-icon {
    width: 30px;
    height: 30px;
}

/* Responsive */
@media (max-width: 768px) {
    .carousel-caption-custom {
        padding: 1rem;
    }
    .carousel-caption-custom h1 {
        font-size: 1.5rem;
    }
    .carousel-caption-custom .lead {
        font-size: 0.9rem;
    }
    .carousel-indicators {
        bottom: 10px;
    }
}

/* Capa Navidad */
.carousel-navidad-layer {
    position: absolute;
    top: 20px;
    left: 80px;
    width: 150px;
    z-index: 15;
    display: none;
}

@media (max-width: 768px) {
    .carousel-navidad-layer {
        left: 60px;
        width: 100px;
    }
}

/* ===== CAROUSEL RESPONSIVO ===== */

/* Imagen del carousel */
.carousel-img {
    height: 70vh;
    min-height: 400px;
    object-fit: cover;
    filter: brightness(0.65);
    width: 100%;
}

/* Caption personalizado */
.carousel-caption-custom {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    right: auto;
    bottom: auto;
    text-align: center;
    padding: 1rem;
    z-index: 10;
    width: 100%;
    max-width: 1000px;
}

/* Títulos responsive */
.carousel-title {
    font-size: clamp(1.25rem, 4vw, 2.5rem);
    line-height: 1.3;
    text-shadow: 2px 2px 6px rgba(0,0,0,0.8);
}

/* Texto descriptivo */
.carousel-text {
    font-size: clamp(0.875rem, 2.5vw, 1.1rem);
    text-shadow: 1px 1px 3px rgba(0,0,0,0.7);
    max-width: 100%;
}

/* Botones del carousel */
.btn-carousel {
    font-size: 0.875rem;
    min-height: 40px;
    min-width: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
}

.btn-carousel:hover {
    transform: translateY(-2px);
}

.btn-carousel-download {
    font-size: 0.95rem;
    min-height: 45px;
    transition: transform 0.2s;
}

.btn-carousel-download:hover {
    transform: scale(1.02);
}

/* Controles más grandes para touch */
.carousel-control-prev,
.carousel-control-next {
    width: 45px;
    height: 45px;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0.85;
    transition: opacity 0.3s, background-color 0.3s;
    background: rgba(0,0,0,0.3);
    border-radius: 50%;
}

.carousel-control-prev:hover,
.carousel-control-next:hover {
    opacity: 1;
    background: rgba(0,0,0,0.6);
}

.carousel-control-prev-icon,
.carousel-control-next-icon {
    width: 24px;
    height: 24px;
    background-size: contain;
}

/* Indicadores */
.carousel-indicators {
    bottom: 15px;
    z-index: 20;
}

.carousel-indicators button {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin: 0 4px;
    opacity: 0.6;
    transition: all 0.3s;
    border: 2px solid #fff;
    padding: 0;
}

.carousel-indicators button.active {
    opacity: 1;
    width: 25px;
    border-radius: 6px;
    background-color: #fff;
}

/* Capa Navidad - Ajustada para sidebar izquierda */
.carousel-navidad-layer {
    position: absolute;
    top: 15px;
    left: 75px; /* 60px sidebar + 15px margen */
    width: 120px;
    z-index: 15;
    display: none;
    pointer-events: none;
}

.carousel-navidad-layer img {
    width: 100%;
    height: auto;
    display: block;
}

/* ===== MEDIA QUERIES - MÓVILES ===== */

/* Tablets y móviles grandes */
@media (max-width: 991px) {
    .carousel-img {
        height: 60vh;
        min-height: 350px;
    }
    .carousel-caption-custom {
        padding: 0.75rem;
    }
    .carousel-title {
        font-size: clamp(1.1rem, 5vw, 2rem);
    }
    .carousel-text {
        font-size: clamp(0.8rem, 3vw, 1rem);
    }
}

/* Móviles medianos */
@media (max-width: 768px) {
    .carousel-img {
        height: 55vh;
        min-height: 300px;
    }
    .carousel-caption-custom {
        padding: 0.5rem;
        transform: translate(-50%, -55%);
    }
    .carousel-title {
        font-size: clamp(1rem, 5.5vw, 1.5rem);
        margin-bottom: 0.75rem !important;
    }
    .carousel-text {
        font-size: clamp(0.75rem, 3.5vw, 0.9rem);
        margin-bottom: 0.75rem !important;
    }
    .btn-carousel {
        font-size: 0.75rem;
        padding: 0.35rem 0.75rem;
        min-height: 36px;
    }
    .btn-carousel i {
        font-size: 1rem;
    }
    .btn-carousel-download {
        font-size: 0.85rem;
        padding: 0.4rem 1rem;
        min-height: 40px;
    }
    .carousel-control-prev,
    .carousel-control-next {
        width: 40px;
        height: 40px;
    }
}

/* Móviles pequeños */
@media (max-width: 480px) {
    .carousel-img {
        height: 50vh;
        min-height: 250px;
    }
    .carousel-caption-custom {
        transform: translate(-50%, -60%);
        padding: 0.25rem;
    }
    .carousel-title {
        font-size: clamp(0.95rem, 6vw, 1.3rem);
        margin-bottom: 0.5rem !important;
    }
    .carousel-text {
        font-size: clamp(0.7rem, 4vw, 0.85rem);
        margin-bottom: 0.5rem !important;
        display: -webkit-box;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }
    .btn-carousel {
        font-size: 0.7rem;
        padding: 0.3rem 0.6rem;
        min-height: 34px;
    }
    .btn-carousel i {
        font-size: 0.9rem;
    }
    .btn-carousel-download {
        font-size: 0.8rem;
        padding: 0.35rem 0.9rem;
        min-height: 38px;
    }
    .carousel-control-prev,
    .carousel-control-next {
        width: 36px;
        height: 36px;
    }
    .carousel-control-prev-icon,
    .carousel-control-next-icon {
        width: 20px;
        height: 20px;
    }
}

/* Ajuste para sidebar izquierda fija */
@media (min-width: 768px) {
    #header-carousel {
        margin-left: 0;
    }
    .carousel-inner {
        padding-left: 0;
    }
}

/* Animaciones suaves */
.carousel-item {
    transition: opacity 0.8s ease-in-out;
}

.animated.slideInDown {
    animation-duration: 0.8s;
}

/* Accesibilidad: foco visible */
.btn-carousel:focus,
.btn-carousel-download:focus,
.carousel-control-prev:focus,
.carousel-control-next:focus {
    outline: 2px solid #fff;
    outline-offset: 2px;
}

/* Soporte para pantallas muy altas */
@media (min-height: 900px) {
    .carousel-img {
        height: 80vh;
    }
}

/* ⚠️ BOTONES INSTITUCIONES - Actualizado */
.school-access-btn {
    transition: all 0.3s;
    border: 1px solid #ddd;
    background: #f8f9fa; /* ← Gris claro Bootstrap */
    border-radius: 4px;
    overflow: hidden;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 10px;
    text-decoration: none;
    color: #333;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.school-access-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
    border-color: var(--primary);
    color: var(--primary);
    background: #fff; /* ← Blanco al hacer hover para contraste */
}

.tooltip-inner {
    white-space: pre-line;
}