/* Variables de Color y Tema */
:root {
    --primary: #7C9070; /* Verde Salvia - Tranquilidad */
    --primary-hover: #6a7c60;
    --bg-light: #F8F9FA;
    --text: #2D3436;
    --danger: #e74c3c;
    --warning: #f39c12;
}

/* Reseteo y Base */
body {
    margin: 0;
    font-family: 'Quicksand', sans-serif;
    background-color: var(--bg-light);
    color: var(--text);
}

.hidden { display: none !important; }
.error { color: var(--danger); font-size: 0.9em; margin-top: 10px; }

/* --- SECCIÓN LOGIN --- */
.full-bg {
    height: 100vh;
    background: linear-gradient(rgba(0,0,0,0.3), rgba(0,0,0,0.3)),
                url('https://images.unsplash.com/photo-1526724038726-3007ffb8025f?q=80&w=1740&auto=format&fit=crop');
    background-size: cover;
    background-position: center;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding-top: 50px;
}

.glass-card {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    padding: 2.5rem;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    width: 90%;
    max-width: 380px;
    text-align: center;
}
/* En el HTML lo pones fuera de la glass-card */
.colibri-flotante {
    position: absolute;
    top: 20%;
    right: 25%; /* Ajustar posición para que quede cerca de la tarjeta */
    width: 60px;
    animation: flotar 5s ease-in-out infinite;
}

@keyframes flotar {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-15px); } /* Se mueve 15px hacia arriba lentamente */
}

/* --- ANIMACIÓN DEL COLIBRÍ (VUELO SERENO) --- */
.colibri-flotante {
    position: absolute;
    /* Ajusta top y right para moverlo a tu gusto por la pantalla */
    top:7%; 
    right: 56%; 
    width: 70px; /* Tamaño del ave */
    opacity: 0.8; /* Ligeramente transparente para integrarse al fondo */
    pointer-events: none; /* Evita que el usuario interactúe con la imagen */
    z-index: 1; /* Lo mantiene detrás del modal si la pantalla es muy pequeña */
    
    /* La animación dura 6 segundos infinitamente */
    animation: vueloSereno 6s ease-in-out infinite; 
}

@keyframes vueloSereno {
    0% { 
        transform: translateY(0) rotate(0deg); 
    }
    50% { 
        /* Sube 20 píxeles y se inclina sutilmente 3 grados */
        transform: translateY(-20px) rotate(-13deg); 
    }
    100% { 
        transform: translateY(0) rotate(0deg); 
    }
}

.glass-card h1 { margin-top: 0; color: var(--text); }


/* --- FORMULARIOS Y BOTONES --- */
input {
    width: 100%;
    padding: 12px;
    margin: 10px 0;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-sizing: border-box;
    font-family: inherit;
}

input:focus, textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 5px rgba(124, 144, 112, 0.3);
}

/* Estilos para campos de selección */
.input-select {
    width: 100%;
    padding: 12px;
    margin: 10px 0;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-sizing: border-box;
    font-family: inherit;
    background-color: white;
    cursor: pointer;
}

.input-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 5px rgba(124, 144, 112, 0.3);
}

.btn-primary {
    background: var(--primary);
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 25px;
    cursor: pointer;
    font-weight: bold;
    width: 100%;
    transition: background 0.3s, transform 0.2s;
}

.btn-primary:hover { 
    background: var(--primary-hover);
    transform: translateY(-2px); 
}

/* --- NAVEGACIÓN --- */
nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 5%;
    background: white;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    position: sticky;
    top: 0;
    z-index: 100;
}

/*.logo { font-weight: 700; font-size: 1.2rem; letter-spacing: 1px; color: var(--primary); }
/* --- LOGOTIPO --- */
.logo-container {
    display: flex;
    align-items: center;
    gap: 12px; /* Espacio entre el ícono y el texto */
    cursor: pointer;
}

.logo-img {
    height: 40px; /* Altura ideal para la barra de navegación */
    width: auto;
    object-fit: contain; /* Evita que la imagen se estire o deforme */
}

.logo-text { 
    font-weight: 700; 
    font-size: 1.4rem; 
    letter-spacing: 1px; 
    color: var(--primary); 
}

.nav-links { list-style: none; display: flex; gap: 20px; margin: 0; padding: 0; }
.nav-links a { text-decoration: none; color: var(--text); font-weight: 500; transition: color 0.3s; }
.nav-links a:hover { color: var(--primary); }

/* --- ESTRUCTURA PRINCIPAL --- */
.container { padding: 40px 5%; max-width: 1200px; margin: 0 auto; }
.header-section { display: flex; justify-content: space-between; align-items: center; margin-bottom: 30px; }
.header-section h2 { margin: 0; }
.header-section .btn-primary { width: auto; padding: 10px 20px; }

/* --- TARJETAS DE CURSOS --- */
.grid-cursos {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
}

.curso-card {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
    border: 1px solid #eee;
    display: flex;
    flex-direction: column;
}

.curso-card:hover { 
    transform: translateY(-5px); 
    box-shadow: 0 15px 30px rgba(0,0,0,0.08); 
}

.curso-img { 
    height: 180px; 
    background-color: #e0eadd; /* Color de fondo mientras carga la imagen */
    /* background-image: url(...);  <-- Eliminamos esta línea */
    background-size: cover;
    background-position: center;
    transition: transform 0.3s; /* Añadimos un efecto suave al hacer hover */
}

/* Efecto opcional: ligero zoom en la imagen al pasar el mouse sobre la tarjeta */
.curso-card:hover .curso-img {
    transform: scale(1.05);
}

.curso-card h3 { margin: 15px 15px 5px 15px; }
.curso-card p { margin: 0 15px 20px 15px; color: #666; font-size: 0.95em; flex-grow: 1; }

/* Botones de Admin en Tarjetas */
.card-actions {
    display: flex;
    gap: 10px;
    padding: 15px;
    background: #fdfdfd;
    border-top: 1px solid #eee;
}

.btn-edit { background: var(--warning); color: white; border: none; padding: 8px 12px; border-radius: 8px; cursor: pointer; flex: 1; font-weight: bold; }
.btn-danger { background: var(--danger); color: white; border: none; padding: 8px 12px; border-radius: 8px; cursor: pointer; flex: 1; font-weight: bold; }
.btn-edit:hover { background: #e67e22; }
.btn-danger:hover { background: #c0392b; }

/* --- TABLA DE USUARIOS --- */
.table-container {
    background: white;
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.03);
}

/* --- MODAL (CRUD) --- */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(3px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 15px;
    width: 90%;
    max-width: 450px;
    box-shadow: 0 15px 40px rgba(0,0,0,0.2);
    animation: fadeIn 0.3s ease-out;
}

.modal-content h2 { margin-top: 0; }

.modal-actions {
    display: flex;
    gap: 15px;
    margin-top: 25px;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 👇 AGREGA ESTE FRAGMENTO AQUÍ 👇 */
/* --- MODAL DE VIDEO Y CONTENEDOR RESPONSIVE --- */
.video-modal-content {
    background: #000;
    width: 95%;
    max-width: 900px;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
    animation: fadeIn 0.3s ease-out;
}

.video-header {
    background: #111;
    padding: 10px 15px;
    display: flex;
    justify-content: flex-end;
}

.btn-close-video {
    background: transparent;
    color: #ccc;
    border: none;
    font-size: 1rem;
    font-family: inherit;
    cursor: pointer;
    transition: color 0.3s;
}

.btn-close-video:hover { color: white; }

/* Truco CSS para mantener el aspecto 16:9 del iframe */
.iframe-container {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* Proporción 16:9 perfecta */
    height: 0;
}

.iframe-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}
/* 👆 FIN DEL FRAGMENTO 👆 */