/* Reset y Variables */
:root {
    --primary: #2c3e50;
    --secondary: #3498db;
    --accent: #e74c3c;
    --light: #CFE2FF; /*#ecf0f1;*/
    --dark: #2c3e50;
    --dark2: #000000;
    --gray: #95a5a6;
    --success: #27ae60;
    --warning: #f39c12;
    --danger: #e74c3c;
    --transition: all 0.3s ease;
    --shadow: 0 4px 12px rgba(0,0,0,0.1);
    /*ori*--radius: 8px;*/
    /*ab1726 new*/
    --modal-border: 1px solid rgba(255, 255, 255, 0.2);
    --radius: 12px;
    /*--shadow: 0 10px 40px rgba(0, 0, 0, 0.5)*/;/*0 20px 60px*/
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--dark);
    background: #f8f9fa;
}

/** ab1526 NEW CSS **/
/* INTRO VIDEO */
.intro-video-section {
    background: var(--dark2);
    /*background: linear-gradient(135deg, var(--dark) 0%, var(--gray) 100%);*/
    /*background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);*/
    padding: 40px 20px;
    text-align: center;
    margin-bottom: 40px;
}

.intro-video-container {
    max-width: 800px;
    margin: 0 auto;
    border-radius: var(--radius); /*12px;*/
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.intro-video {
    width: 100%;
    height: auto;
    display: block;
    background: #000;
}

/* MODAL MEJORADO */
#modalTitle {
  background: transparent;
  text-align: center;
  text-justify: center;
  font-size: 18px;
  color: white; /*#333;*/
}

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    transition: opacity 0.3s ease;
}

.modal.hidden {
    display: none;
}

.modal__overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);/*negro semitransparente al 80%, significa que deja ver un 20% del contenido que hay detrás.*/
    backdrop-filter: blur(4px);
    cursor: pointer;
}

.modal__content {
    position: relative;
    background: #0f0f0f; /*fondo oscuro (#0f0f0f) video se ve más inmersivo.*/ /* o #121212 — fondo oscuro para video */
    /*background: #1a1a1a;*/
    border: 1px solid rgba(255, 255, 255, 0.15); /* borde muy sutil, casi invisible-borde blanco al 15% de opacidad apenas se nota, pero da estructura.*/
    border-radius: var(--radius);
    /*border-radius: 12px;*/
    padding: 0; /* Sin padding para que el video toque los bordes */
    max-width: 900px;/*probar:800px;*/
    width: 95%;/*90%*/
    max-height: 90vh;/*80vh;*/
    overflow: hidden; /* Cambiar a hidden para evitar scroll innecesario */
    /*probar: overflow: hidden;
    position: relative;*/
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2); /* Sombra consistente con intro-video */
    /*box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);*//*crea una sombra alrededor del modal para darle profundidad y hacerlo "flotar" sobre la página│rgba=Color negro al 50% de opacidad*/
}

.modal__close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    /*
    CSS: Colores básicos y comunes (23): white, black, red, green, blue, yellow, cyan, magenta, orange, purple, pink, brown, gray, silver, lime, maroon, navy, olive, teal, violet, indigo, khaki, salmon
    */
    font-size: 28px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease;
    z-index: 10;
}

.modal__close:hover {
    background: rgba(255, 255, 255, 0.3);
}

.modal__video {
    width: 100%;
    aspect-ratio: 16/9;
    background: #000 !important;
    border-radius: 0; /* Sin border-radius para que el video ocupe todo el espacio */
    overflow: hidden;
}

.modal__video iframe,
.modal__video video {
    width: 100%;
    height: 100%;
    display: block;
    border: none; /* Eliminar cualquier borde del iframe */
}

/* RESPONSIVE */
@media (max-width: 768px) {
    .intro-video-section {
        padding: 20px 10px;
    }

    .modal__content {
        width: 95%;
        padding: 0;
    }

    .modal__video {
        aspect-ratio: 16/9;
    }
}
/** ab1526 fin NEW CSS */

/* Hero */
.hero {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    text-align: center;
    padding: 1rem;  /* Lo mismo — aplica 1rem a los 4 lados (1rem ≈ 16px)*/
    /*padding: 1rem 1rem;*//*2rem 1rem; 3rem 1rem;*/
    margin-bottom: 1rem;/*2rem;*/
}

.hero h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.hero p {
    font-size: 1.2rem;
    opacity: 0.9;
}

/* Filtros */
.filtros {
    padding: 1.5rem;
    background: white;
    box-shadow: var(--shadow);
    border-radius: var(--radius);
    margin-bottom: 2rem;
}

.filtros form {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
}

.filtros__categorias {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.btn {
    padding: 0.5rem 1rem;
    border-radius: var(--radius);
    border: 1px solid var(--gray);
    background: white;
    cursor: pointer;
    transition: var(--transition);
    font-weight: 500;
}

.btn:hover {
    background: var(--light);
    border-color: var(--primary);
}

.btn--activo {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

input[type="search"] {
    flex: 1;
    padding: 0.5rem;
    border: 1px solid var(--gray);
    border-radius: var(--radius);
    font-size: 1rem;
}

input[type="search"]:focus {
    outline: 2px solid var(--secondary);
    border-color: var(--secondary);
}

button[type="submit"] {
    padding: 0.5rem 1rem;
    background: var(--secondary);
    color: white;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    font-weight: 600;
}

button[type="submit"]:hover {
    background: #2980b9;
}

/* === INI - Video de introducción === */
.card--intro {
    width: 100%;
    max-width: 960px;
    margin: 0 auto 1.5rem auto;
    overflow: hidden;
    border-radius: 8px;
    background: #000;/*color negro (equivalente a #000000)*/
}

.card--intro video {
    display: block;
    width: 100%;
    height: auto;
    object-fit: cover;
}
/* === FIN - Video de introducción === */

/* Grid de Videos */
.videos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    padding: 0 1rem;
}

.card {
    background: white;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
    cursor: pointer;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
}

.card__thumb {
    position: relative;
    height: 180px;
    overflow: hidden;
    background: #ddd;
}

.card__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.card:hover .card__thumb img {
    transform: scale(1.05);
}

.card__play {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0,0,0,0.7);
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    opacity: 0;
    transition: var(--transition);
}

.card:hover .card__play {
    opacity: 1;
}

.card__duracion {
    position: absolute;
    bottom: 0.5rem;
    right: 0.5rem;
    background: rgba(0,0,0,0.7);
    color: white;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
}

.card__info {
    padding: 1rem;
}

.card__categoria {
    display: inline-block;
    background: var(--light);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.card__info h3 {
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.card__info p {
    color: var(--gray);
    font-size: 0.9rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Empty State */
.empty {
    text-align: center;
    padding: 3rem;
    color: var(--gray);
    font-size: 1.2rem;
}

/* Responsive */
@media (max-width: 768px) {
    .hero h1 {
        font-size: 2rem;
    }
    .filtros form {
        flex-direction: column;
    }
    .videos-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    }
}

/* Animaciones */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.videos-grid .card {
    animation: fadeIn 0.5s ease-in;
}

/* Botones de Acción */
.btn--primary {
    background: var(--primary);
    color: white;
    border: none;
}

.btn--primary:hover {
    background: #1a252e;
}

.btn--success {
    background: var(--success);
    color: white;
}

.btn--success:hover {
    background: #218838;
}

.btn--danger {
    background: var(--danger);
    color: white;
}

.btn--danger:hover {
    background: #c82333;
}

/* Formularios */
.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid var(--gray);
    border-radius: var(--radius);
 
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: 2px solid var(--secondary);
    border-color: var(--secondary);
}

/* Tablas */
.table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
}

.table th,
.table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--gray);
}

.table th {
    background: var(--light);
    font-weight: 600;
}

.table tr:hover {
    background: var(--light);
}

/* Alertas */
.alert {
    padding: 1rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
    font-weight: 500;
}

.alert--success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert--danger {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Cargando */
.loading {
    text-align: center;
    padding: 2rem;
    font-size: 1.2rem;
    color: var(--gray);
}

/* Footer */
footer {
    text-align: center;
    padding: 2rem;
    background: var(--dark);
    color: white;
    margin-top: 2rem;
}

/* Scrollbar moderno */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: var(--gray);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}
