/* AEU Videoteca — Tokens: Montserrat, #FFBC00 dorado, #A23223 granate, #53565A gris */

#aeu-videoteca-app { max-width: 1200px; margin: 0 auto; font-family: 'Montserrat', sans-serif; color: #53565A; }

/* ─── Search (arriba, ancho completo) ─────────────────────── */
.aeu-vt-search { display: flex; gap: 8px; margin-bottom: 16px; align-items: center; }
.aeu-vt-search input {
    flex: 1; padding: 12px 20px; border: 2px solid #ddd; border-radius: 30px;
    font-family: 'Montserrat', sans-serif; font-size: 15px; outline: none;
}
.aeu-vt-search input:focus { border-color: #FFBC00; }
#aeu-videoteca-app .aeu-vt-search button,
#aeu-videoteca-app .aeu-vt-btn {
    padding: 12px 28px; border: none; border-radius: 30px; cursor: pointer;
    font-family: 'Montserrat', sans-serif; font-weight: 600; font-size: 14px;
    background: #53565A; color: #fff; transition: background .3s;
}
#aeu-videoteca-app .aeu-vt-search button:hover,
#aeu-videoteca-app .aeu-vt-btn:hover { background: #FFBC00; color: #53565A; }
/* Desktop: search-actions inline */
.aeu-vt-search-actions { display: flex; gap: 8px; }
#aeu-videoteca-app .aeu-vt-filters-toggle { display: none; }

/* ─── Chips de órganos ────────────────────────────────────── */
.aeu-vt-chips {
    display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 16px;
    padding-bottom: 12px; border-bottom: 1px solid #eee;
}
#aeu-videoteca-app .aeu-vt-chip {
    padding: 3px 10px; border: 1px solid #ddd; border-radius: 12px;
    background: transparent; color: #888; font-family: 'Montserrat', sans-serif;
    font-size: 11px; font-weight: 600; cursor: pointer; transition: all .2s;
    white-space: nowrap;
}
#aeu-videoteca-app .aeu-vt-chip:hover { background: #f0f0f0; color: #53565A; }
#aeu-videoteca-app .aeu-vt-chip.active { background: #FFBC00; color: #53565A; }

/* ─── Layout: sidebar (izda) + main (dcha) ────────────────── */
.aeu-vt-layout { display: flex; gap: 30px; align-items: flex-start; }

/* Main content */
.aeu-vt-main { flex: 1; min-width: 0; }

/* Sidebar — izquierda */
.aeu-vt-sidebar {
    width: 240px; min-width: 240px; flex-shrink: 0;
    background: #f8f8f8; border-radius: 8px; padding: 20px;
    position: sticky; top: 100px;
}
.aeu-vt-sidebar-title {
    font-size: 16px; font-weight: 700; color: #A23223;
    text-transform: uppercase; letter-spacing: 0.5px;
    margin: 0 0 16px; padding-bottom: 8px; border-bottom: 2px solid #FFBC00;
}
.aeu-vt-filter-group { margin-bottom: 14px; }
.aeu-vt-filter-group label {
    display: block; font-size: 12px; font-weight: 600; color: #53565A;
    text-transform: uppercase; letter-spacing: 0.3px; margin-bottom: 4px;
}
.aeu-vt-filter-group select {
    width: 100%; padding: 8px 10px; border: 1px solid #ddd; border-radius: 6px;
    font-family: 'Montserrat', sans-serif; font-size: 13px; color: #53565A;
    background: #fff; cursor: pointer;
}
.aeu-vt-filter-group select:focus { border-color: #FFBC00; outline: none; }
#aeu-videoteca-app #aeu-vt-clear-filters {
    width: 100%; margin-top: 12px; padding: 8px; border: none;
    background: none; color: #A23223; font-family: 'Montserrat', sans-serif;
    font-size: 13px; font-weight: 600; cursor: pointer; text-decoration: underline;
    text-align: center; border-radius: 0;
}

/* Toggle button for mobile (hidden on desktop) */
#aeu-videoteca-app .aeu-vt-filters-toggle {
    display: none; width: 100%; padding: 10px; margin-bottom: 12px;
    border: 1px solid #ddd; border-radius: 8px; background: #f8f8f8;
    font-family: 'Montserrat', sans-serif; font-size: 13px; font-weight: 600;
    color: #53565A; cursor: pointer; text-align: center;
}
.aeu-vt-filters-toggle:hover { border-color: #FFBC00; }
.aeu-vt-filters-toggle .arrow { transition: transform .3s; display: inline-block; margin-left: 6px; }
.aeu-vt-filters-toggle.open .arrow { transform: rotate(180deg); }

/* Toolbar */
.aeu-vt-toolbar {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 16px;
}
#aeu-vt-count { font-size: 13px; font-weight: 600; flex: 1; }
#aeu-vt-sort {
    padding: 3px 8px; border: 1px solid #ddd; border-radius: 4px;
    font-family: 'Montserrat', sans-serif; font-size: 11px; color: #888;
    width: auto; flex-shrink: 0;
}

/* ─── Grid ────────────────────────────────────────────────── */
.aeu-vt-grid {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px;
    margin-bottom: 30px;
}
.aeu-vt-card {
    text-decoration: none; color: inherit; border-radius: 8px;
    overflow: hidden; background: #fff; border: 1px solid #eee;
    transition: box-shadow .3s, transform .2s;
}
.aeu-vt-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,.12); transform: translateY(-2px); }
.aeu-vt-thumb { position: relative; aspect-ratio: 16/9; background: #f0f0f0; overflow: hidden; }
.aeu-vt-thumb img { width: 100%; height: 100%; object-fit: cover; }
.aeu-vt-no-thumb { width: 100%; height: 100%; background: #ddd; }
.aeu-vt-badge-premio {
    position: absolute; top: 8px; right: 8px;
    background: #FFBC00; color: #53565A; padding: 4px 10px;
    border-radius: 20px; font-size: 12px; font-weight: 700;
}
.aeu-vt-card-body { padding: 12px; }
.aeu-vt-card-title {
    font-size: 11px; font-weight: 600; color: #A23223;
    margin: 0 0 6px; line-height: 1.3;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.aeu-vt-card-autores {
    font-size: 12px; color: #888; margin: 0 0 6px; line-height: 1.4;
    display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden;
}
.aeu-vt-badge-anno {
    display: inline-block; background: #FFBC00; color: #53565A; padding: 2px 10px;
    border-radius: 12px; font-size: 11px; font-weight: 700;
}

/* Pagination */
.aeu-vt-pagination { display: flex; justify-content: center; gap: 4px; margin: 20px 0 40px; flex-wrap: wrap; }
#aeu-videoteca-app .aeu-vt-pagination button {
    padding: 8px 14px; border: 1px solid #ddd; background: #fff; border-radius: 6px;
    font-family: 'Montserrat', sans-serif; font-size: 13px; cursor: pointer;
    color: #53565A; transition: all .2s;
}
#aeu-videoteca-app .aeu-vt-pagination button:hover { border-color: #FFBC00; color: #FFBC00; }
#aeu-videoteca-app .aeu-vt-pagination button.active { background: #FFBC00; color: #53565A; border-color: #FFBC00; font-weight: 700; }

/* Loading / No results */
.aeu-vt-loading { text-align: center; padding: 40px; font-size: 16px; color: #999; }
.aeu-vt-no-results { text-align: center; padding: 60px 20px; color: #999; font-size: 16px; grid-column: 1 / -1; }

/* ─── Detail ──────────────────────────────────────────────── */
.aeu-vt-detail { max-width: 900px; margin: 0 auto; }
.aeu-vt-player-wrap { margin-bottom: 24px; border-radius: 8px; overflow: hidden; }
.aeu-vt-player-wrap video { display: block; width: 100%; border-radius: 8px; }
.aeu-vt-locked { position: relative; }
.aeu-vt-locked img { width: 100%; display: block; filter: brightness(.4); border-radius: 8px; }
.aeu-vt-lock-overlay {
    position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
    text-align: center; color: #fff;
}
.aeu-vt-lock-icon { font-size: 48px; margin-bottom: 12px; }
.aeu-vt-lock-overlay p { font-size: 16px; margin-bottom: 16px; }
.aeu-vt-lock-overlay .aeu-vt-btn { background: #FFBC00; color: #53565A; }

.aeu-vt-detail-title { font-size: 22px; font-weight: 600; color: #53565A; margin: 0 0 16px; }
.aeu-vt-detail-meta { margin-bottom: 24px; }
.aeu-vt-detail-meta p { margin: 4px 0; font-size: 15px; }
.aeu-vt-detail-meta strong { color: #A23223; }
.aeu-vt-visto { font-size: 13px; color: #999; }

.aeu-vt-abstract { margin-bottom: 24px; line-height: 1.7; }
.aeu-vt-abstract h3 { font-size: 18px; font-weight: 600; margin-bottom: 8px; padding-bottom: 6px; border-bottom: 2px solid #FFBC00; }

.aeu-vt-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 24px; }
.aeu-vt-tag {
    background: #f0f0f0; padding: 4px 12px; border-radius: 16px;
    font-size: 12px; font-weight: 600; color: #53565A;
}
.aeu-vt-back { color: #A23223; font-weight: 600; text-decoration: none; font-size: 14px; }
.aeu-vt-back:hover { color: #FFBC00; }

/* ─── Login ──────────────────────────────────────────────── */
.aeu-vt-login-form { max-width: 400px; margin: 0 auto; }
.aeu-vt-login-form h2 { font-size: 22px; color: #53565A; margin-bottom: 8px; }
.aeu-vt-field { margin-bottom: 16px; }
.aeu-vt-field label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 4px; color: #53565A; }
.aeu-vt-field input {
    width: 100%; padding: 10px 16px; border: 2px solid #ddd; border-radius: 8px;
    font-family: 'Montserrat', sans-serif; font-size: 14px; box-sizing: border-box;
}
.aeu-vt-field input:focus { border-color: #FFBC00; outline: none; }
.aeu-vt-error { color: #A23223; font-size: 14px; margin-bottom: 12px; padding: 8px 12px; background: #fef3f3; border-radius: 6px; }
.aeu-vt-help { font-size: 13px; color: #999; margin-top: 16px; }
.aeu-vt-help a { color: #A23223; }
.aeu-vt-login-ok { padding: 16px; background: #f0fdf4; border-radius: 8px; }
.aeu-vt-login-ok p { margin: 0; font-size: 15px; }

/* ─── Responsive ─────────────────────────────────────────── */
@media (max-width: 1024px) {
    .aeu-vt-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    /* Search: input full width, below row Buscar + Filtros 50/50 */
    .aeu-vt-search { flex-direction: column; gap: 6px; }
    .aeu-vt-search-actions {
        display: flex !important; gap: 6px; width: 100%;
    }
    #aeu-videoteca-app .aeu-vt-search button,
    #aeu-videoteca-app .aeu-vt-search .aeu-vt-filters-toggle {
        flex: 1; padding: 8px 0 !important; font-size: 13px !important;
        text-align: center; box-sizing: border-box; height: 38px !important;
    }
    #aeu-videoteca-app .aeu-vt-filters-toggle {
        display: flex !important; align-items: center; justify-content: center;
    }

    /* Chips: scroll horizontal */
    .aeu-vt-chips {
        flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch;
        scrollbar-width: none; padding-bottom: 10px;
    }
    .aeu-vt-chips::-webkit-scrollbar { display: none; }

    /* Toolbar: count + sort en misma fila siempre */
    .aeu-vt-toolbar { flex-direction: row; gap: 8px; align-items: center; }
    #aeu-vt-count { font-size: 12px; }

    /* Sidebar: desplegable */
    .aeu-vt-layout { flex-direction: column; gap: 0; }
    .aeu-vt-sidebar {
        width: 100%; min-width: 100%; position: static;
        max-height: 0; overflow: hidden; padding: 0 16px;
        transition: max-height .4s ease, padding .4s ease;
        margin-bottom: 0;
    }
    .aeu-vt-sidebar.open {
        max-height: 600px; padding: 16px;
        margin-bottom: 16px;
    }
    .aeu-vt-sidebar-title { display: none; }
    .aeu-vt-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 480px) {
    .aeu-vt-grid { grid-template-columns: 1fr; }
}
