/* =============================================================================
   AOS Program — Frontend CSS (v1.8.0)
   ============================================================================= */

:root {
    --aospf-primary: #2271b1;
    --aospf-bg: #f8f9fa;
    --aospf-card: #ffffff;
    --aospf-border: #dee2e6;
    --aospf-text: #212529;
    --aospf-muted: #6c757d;
    --aospf-radius: 6px;
    /* Moderadores */
    --aospf-mod-purple: #6366f1;
    --aospf-mod-purple-light: #ede9fe;
    --aospf-mod-purple-text: #4338ca;
}

/* ── Contenedor Principal ───────────────────────────────────────────────────── */
.aos-program-wrap {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: var(--aospf-text);
}

/* ── Cabecera del Programa ──────────────────────────────────────────────────── */
.aos-program-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 24px;
}

.aos-program-title {
    font-size: 1.6em;
    font-weight: 700;
    margin: 0;
}

.aos-program-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 14px;
    border-radius: 20px;
    font-size: 0.78em;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.aos-program-status-badge.draft {
    background: #fff3cd;
    color: #664d03;
}

.aos-program-status-badge.final {
    background: #d1e7dd;
    color: #0a3622;
}

/* ── Filtros AJAX ───────────────────────────────────────────────────────────── */
.aos-program-filters {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 20px;
    align-items: center;
}

.aos-program-filters input,
.aos-program-filters select {
    border: 1px solid var(--aospf-border);
    border-radius: var(--aospf-radius);
    padding: 8px 12px;
    font-size: 0.9em;
    outline: none;
    transition: border-color .15s;
}

.aos-program-filters input:focus,
.aos-program-filters select:focus {
    border-color: var(--aospf-primary);
}

/* Selector de Día */
.aos-day-tabs {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    margin-bottom: 20px;
    border-bottom: 2px solid var(--aospf-border);
    padding-bottom: 0;
}

.aos-day-tab {
    padding: 8px 18px;
    border: 1px solid transparent;
    border-bottom: none;
    border-radius: 6px 6px 0 0;
    cursor: pointer;
    font-size: 0.9em;
    font-weight: 600;
    color: var(--aospf-muted);
    background: transparent;
    transition: all .15s;
    position: relative;
    bottom: -2px;
}

.aos-day-tab:hover,
.aos-day-tab.active {
    background: var(--aospf-card);
    border-color: var(--aospf-border);
    border-bottom-color: var(--aospf-card);
    color: var(--aospf-primary);
}

/* ── Grid del Programa ──────────────────────────────────────────────────────── */
.aos-program-grid {
    overflow-x: auto;
    margin-bottom: 30px;
}

.aos-program-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 500px;
    font-size: 0.88em;
}

.aos-program-table th {
    background: var(--aospf-primary);
    color: #fff;
    padding: 10px 14px;
    text-align: center;
    font-weight: 600;
    white-space: nowrap;
    position: sticky;
    top: 0;
    z-index: 5;
}

.aos-program-table th.time-col {
    background: #135e96;
    width: 72px;
}

.aos-program-table td {
    border: 1px solid var(--aospf-border);
    vertical-align: top;
    padding: 0;
    min-width: 180px;
}

.aos-time-cell-fe {
    padding: 10px;
    font-size: 0.82em;
    font-weight: 700;
    color: var(--aospf-muted);
    background: #f1f3f5;
    white-space: nowrap;
    text-align: right;
    border-right: 2px solid var(--aospf-border);
}

/* ── Tarjeta de Ponencia (Frontend) ─────────────────────────────────────────── */
.aos-fe-slot {
    padding: 12px 14px;
    border-left: 4px solid var(--aospf-primary);
    background: #f8fbff;
    min-height: 80px;
    transition: background .15s;
}

.aos-fe-slot:hover {
    background: #eef4fc;
}

.aos-fe-slot.is-activity {
    background: #fffbf4;
    border-left-color: #c7532a;
}

.aos-fe-slot.is-global {
    background: #f5f0fa;
    border-left-color: #8a3fbf;
    text-align: center;
    font-weight: 600;
    color: #5a2b8f;
}

.aos-fe-slot-title {
    font-weight: 700;
    color: var(--aospf-text);
    margin-bottom: 6px;
    line-height: 1.35;
    font-size: 0.92em;
}

/* v1.10.0 — badge "Poster" para diferenciar artículo de póster (aos-paper v2.5+) */
.aos-fe-badge {
    display: inline-block;
    padding: 1px 7px;
    border-radius: 10px;
    font-size: 0.65em;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    vertical-align: middle;
    margin-right: 4px;
}
.aos-fe-badge--poster {
    background: #fff3cd;
    color: #8a6d00;
    border: 1px solid #ffe491;
}
.aos-fe-slot.is-poster {
    /* Tono ámbar muy sutil en el borde izquierdo */
    border-left: 3px solid #f0b341;
}

.aos-fe-slot-author {
    font-size: 0.82em;
    color: var(--aospf-muted);
    margin-bottom: 4px;
}

.aos-fe-slot-thematic {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75em;
    background: #e8f0fa;
    color: var(--aospf-primary);
    font-weight: 600;
    margin-top: 4px;
}

.aos-fe-slot-desc {
    margin-top: 10px;
    font-size: 0.82em;
    color: var(--aospf-text);
    line-height: 1.4;
    border-top: 1px dotted var(--aospf-border);
    padding-top: 8px;
}

.aos-fe-slot-desc p {
    margin: 0 0 6px 0;
}

.aos-fe-slot-desc p:last-child {
    margin-bottom: 0;
}

.aos-fe-slot-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
}

/* ── Moderadores en el slot del programa público ────────────────────────────── */
.aos-fe-slot-moderators {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 6px;
    padding-top: 5px;
    border-top: 1px dotted var(--aospf-border);
}

.aos-fe-mod-label {
    font-size: 0.75em;
    color: var(--aospf-mod-purple);
    font-weight: 700;
    flex-shrink: 0;
    margin-right: 2px;
}

.aos-fe-mod-name {
    display: inline-block;
    font-size: 0.75em;
    background: var(--aospf-mod-purple-light);
    color: var(--aospf-mod-purple-text);
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 600;
    white-space: nowrap;
}

.aos-fe-mod-name + .aos-fe-mod-name::before {
    content: '';
}

/* ── Favoritos ──────────────────────────────────────────────────────────────── */
.aos-fav-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    padding: 0 2px;
    color: var(--aospf-muted);
    transition: color .15s, transform .1s;
}

.aos-fav-btn:hover {
    color: #e63946;
    transform: scale(1.2);
}

.aos-fav-btn.active {
    color: #e63946;
}

/* ── Sala Virtual ───────────────────────────────────────────────────────────── */
.aos-room-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.8em;
    color: var(--aospf-primary);
    text-decoration: none;
    font-weight: 600;
    border: 1px solid var(--aospf-primary);
    border-radius: 4px;
    padding: 2px 8px;
    transition: background .15s, color .15s;
}

.aos-room-link:hover {
    background: var(--aospf-primary);
    color: #fff;
}

/* ── Mi Programación ────────────────────────────────────────────────────────── */
.aos-my-schedule {
    padding: 4px 0;
}

.aos-my-tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid var(--aospf-border);
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.aos-my-tab-btn {
    padding: 10px 20px;
    border: none;
    border-bottom: 2px solid transparent;
    background: transparent;
    cursor: pointer;
    font-size: 0.9em;
    font-weight: 600;
    color: var(--aospf-muted);
    margin-bottom: -2px;
    transition: color .15s, border-color .15s;
    white-space: nowrap;
}

.aos-my-tab-btn.active {
    color: var(--aospf-primary);
    border-bottom-color: var(--aospf-primary);
}

/* Pestaña de moderación con color especial */
.aos-my-tab-btn[data-panel="aos-my-moderation"].active {
    color: var(--aospf-mod-purple);
    border-bottom-color: var(--aospf-mod-purple);
}

.aos-my-tab-panel {
    display: none;
}

.aos-my-tab-panel.active {
    display: block;
}

/* Tarjeta de Mi Ponencia */
.aos-my-slot-card {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    background: var(--aospf-card);
    border: 1px solid var(--aospf-border);
    border-left: 5px solid var(--aospf-primary);
    border-radius: var(--aospf-radius);
    padding: 16px 18px;
    margin-bottom: 12px;
    transition: box-shadow .15s;
}

.aos-my-slot-card:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,.08);
}

.aos-my-slot-card.is-draft {
    border-left-color: var(--aospf-primary);
}

.aos-my-slot-card.is-final {
    border-left-color: #107c10;
}

/* Tarjeta de moderación */
.aos-my-slot-card.mod-card {
    border-left-color: var(--aospf-mod-purple);
}

.aos-my-slot-time {
    flex-shrink: 0;
    text-align: center;
    background: var(--aospf-bg);
    border-radius: var(--aospf-radius);
    padding: 10px 14px;
    min-width: 70px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.aos-my-slot-time .day {
    font-size: 0.7em;
    text-transform: uppercase;
    font-weight: 700;
    color: var(--aospf-muted);
    display: block;
}

.aos-my-slot-time .hour {
    font-size: 1.2em;
    font-weight: 700;
    color: var(--aospf-text);
    display: block;
}

.aos-my-slot-info {
    flex: 1;
    min-width: 0;
}

.aos-my-slot-info h4 {
    margin: 0 0 6px;
    font-size: 1em;
    line-height: 1.35;
}

.aos-my-slot-info p {
    margin: 0;
    font-size: 0.85em;
    color: var(--aospf-muted);
}

/* ── Tutorial del moderador ─────────────────────────────────────────────────── */
.aos-mod-tutorial {
    background: #f0f6ff;
    border: 1px solid #c3d9f0;
    border-radius: 8px;
    padding: 20px 22px;
    margin-bottom: 24px;
}

.aos-mod-tutorial ul {
    margin: 8px 0;
    padding-left: 18px;
    line-height: 1.7;
}

.aos-mod-tutorial li {
    font-size: 0.88em;
    color: #374151;
}

/* ── Materiales del moderador ───────────────────────────────────────────────── */
.aos-mod-materials {
    border-top: 1px solid #e5e7eb;
    padding-top: 10px;
    margin-top: 8px;
}

.aos-mod-material-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: #f0fdf4;
    border: 1px solid #86efac;
    color: #15803d;
    padding: 5px 12px;
    border-radius: 6px;
    font-size: 0.85em;
    text-decoration: none;
    transition: background .15s, border-color .15s;
}

.aos-mod-material-chip:hover {
    background: #dcfce7;
    border-color: #4ade80;
}

/* ── Repositorio personal del moderador ─────────────────────────────────────── */
.aos-mod-repo-section {
    margin-top: 32px;
    border-top: 2px solid #e5e7eb;
    padding-top: 24px;
}

.aos-mod-repo-form {
    background: #fafafa;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 16px 20px;
    margin-bottom: 20px;
}

.aos-mod-repo-form input,
.aos-mod-repo-form select {
    border: 1px solid #d1d5db;
    border-radius: 4px;
    padding: 6px 10px;
    font-family: inherit;
    font-size: 0.9em;
    outline: none;
    transition: border-color .15s;
}

.aos-mod-repo-form input:focus,
.aos-mod-repo-form select:focus {
    border-color: var(--aospf-primary);
}

.aos-repo-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    margin-bottom: 8px;
    transition: border-color .15s, box-shadow .15s;
}

.aos-repo-item:hover {
    border-color: #c3d9f0;
    box-shadow: 0 1px 4px rgba(0,0,0,.06);
}

.aos-repo-item a {
    font-weight: 600;
    color: #2271b1;
    text-decoration: none;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.aos-repo-item a:hover {
    text-decoration: underline;
}

/* ── Modal de Indisponibilidad ──────────────────────────────────────────────── */
.aos-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .55);
    z-index: 99999;
    align-items: center;
    justify-content: center;
}

.aos-modal-overlay.active,
.aos-modal-overlay.is-open {
    display: flex;
}

.aos-modal-box {
    background: #fff;
    border-radius: 10px;
    padding: 32px;
    max-width: 560px;
    width: 95%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, .25);
    position: relative;
}

.aos-modal-close {
    position: absolute;
    top: 12px;
    right: 16px;
    font-size: 22px;
    cursor: pointer;
    background: none;
    border: none;
    color: var(--aospf-muted);
    line-height: 1;
    padding: 2px 6px;
}

.aos-modal-close:hover {
    color: var(--aospf-text);
}

/* Rango horario de indisponibilidad */
.aos-unavail-range {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.aos-unavail-range input {
    padding: 7px 10px;
    border: 1px solid var(--aospf-border);
    border-radius: 4px;
    flex: 1;
    min-width: 160px;
}

.aos-unavail-range .remove-range {
    cursor: pointer;
    color: #e63946;
    font-size: 18px;
    background: none;
    border: none;
}

/* ── Sistema de Valoraciones (Estrellas) ────────────────────────────────────── */
.aos-rating-widget {
    margin-top: 10px;
}

.aos-stars {
    display: flex;
    gap: 2px;
}

.aos-star {
    font-size: 22px;
    cursor: pointer;
    background: none;
    border: none;
    color: #cdd1d6;
    padding: 0 1px;
    line-height: 1;
    transition: color .1s, transform .1s;
}

.aos-star:hover,
.aos-star.filled,
.aos-star.hovered {
    color: #f59e0b;
}

.aos-star:hover {
    transform: scale(1.2);
}

.aos-rating-avg {
    font-size: 0.8em;
    color: var(--aospf-muted);
    margin-top: 4px;
    display: block;
}

/* ── Vista Compacta ─────────────────────────────────────────────────────────── */
.aos-compact-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.aos-compact-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-bottom: 1px solid var(--aospf-border);
    font-size: 0.9em;
    transition: background .1s;
}

.aos-compact-item:hover {
    background: var(--aospf-bg);
}

.aos-compact-time {
    font-weight: 700;
    color: var(--aospf-primary);
    min-width: 90px;
    font-size: 0.85em;
}

.aos-compact-title {
    flex: 1;
    font-weight: 600;
}

.aos-compact-loc {
    font-size: 0.8em;
    color: var(--aospf-muted);
}

/* ── Estado Vacío ───────────────────────────────────────────────────────────── */
.aos-empty-state {
    text-align: center;
    padding: 48px 20px;
    color: var(--aospf-muted);
}

.aos-empty-state .aos-icon {
    font-size: 48px;
    color: var(--aospf-border);
    margin-bottom: 12px;
}

.aos-empty-state h3 {
    margin: 0 0 8px;
    color: var(--aospf-text);
}

.aos-empty-state p {
    margin: 0;
    font-size: 0.9em;
}

/* ── Animaciones ────────────────────────────────────────────────────────────── */
@keyframes aosFadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.aos-fe-slot,
.aos-my-slot-card,
.aos-repo-item {
    animation: aosFadeIn .22s ease;
}

/* ── Responsive ─────────────────────────────────────────────────────────────── */
@media (max-width: 640px) {
    .aos-program-filters       { flex-direction: column; }
    .aos-program-table th,
    .aos-program-table td      { min-width: 120px; }
    .aos-my-slot-card          { flex-direction: column; }
    .aos-my-tab-btn            { padding: 8px 12px; font-size: 0.82em; }
    .aos-mod-repo-form > div   { flex-direction: column; }
    .aos-fe-slot-moderators    { gap: 3px; }
}
