/**
 * PUNTO 0 — ASSETS/CSS/VIEWS/CHECKIN-SESIONES.CSS
 * Estilos exclusivos de Check-in (#v2-view-proy-checkin) y Sesiones (#v2-view-proy-sesiones) con soporte MP3.
 */

/* =========================================================================
   1. CHECK-IN (#v2-view-proy-checkin) Y MODAL MODO POESÍA
   ========================================================================= */
.checkin-text {
    font-size: 15px;
    color: var(--text-main);
    line-height: 1.6;
    word-wrap: break-word;
}
.checkin-text p { margin-top: 0 !important; margin-bottom: 15px !important; }
.checkin-text p:last-child { margin-bottom: 0 !important; }
.checkin-text p:empty { display: none !important; }
.checkin-text a { color: #fff !important; text-decoration: underline !important; text-underline-offset: 3px; font-weight: 800; }
.checkin-text ul { padding-left: 20px; margin: 10px 0; }
.checkin-text li { margin-bottom: 5px; }

#proyd-agenda-content-checkin .checkin-agenda-list {
    margin: 0;
    padding: 0;
    list-style-type: none;
    font-size: 15px;
    color: var(--text-main);
    line-height: 1.8;
}
@media (max-width: 768px) {
    #proyd-agenda-content-checkin .checkin-agenda-list li {
        display: flex;
        flex-direction: column;
        margin-bottom: 14px;
        line-height: 1.45;
    }
    #proyd-agenda-content-checkin .checkin-agenda-list li:last-child { margin-bottom: 0; }
    #proyd-agenda-content-checkin .checkin-agenda-sep { display: none !important; }
}

#checkin-link-modal {
    z-index: var(--z-modal) !important;
}

#checkin-poesia-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: var(--z-modal);
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.4s ease;
    padding: 20px;
    box-sizing: border-box;
}
#checkin-poesia-box {
    background: transparent;
    width: 100%;
    max-width: 650px;
    max-height: 85vh;
    overflow-y: auto;
    position: relative;
    padding: 40px 20px;
    scrollbar-width: none;
}
#checkin-poesia-box::-webkit-scrollbar { display: none; }
.poesia-close-btn {
    position: fixed;
    top: 30px;
    right: 40px;
    background: transparent !important;
    border: none !important;
    color: #888 !important;
    font-size: 35px;
    line-height: 1;
    cursor: pointer !important;
    outline: none !important;
    transition: color 0.2s;
    z-index: 10;
    font-weight: 300;
    box-shadow: none !important;
    padding: 0 !important;
}
.poesia-close-btn:hover { color: #fff !important; }
#checkin-poesia-content {
    font-size: 16px;
    color: var(--text-main);
    line-height: 1.8;
    white-space: normal;
    word-wrap: break-word;
    font-family: inherit;
}
#checkin-poesia-content p { margin-top: 0; margin-bottom: 20px; }
#checkin-poesia-content a { color: #fff; text-decoration: underline; text-underline-offset: 3px; font-weight: 800; }

/* =========================================================================
   2. SESIONES (#v2-view-proy-sesiones) + PANEL ADMIN Y AUDIO MP3
   ========================================================================= */
.v2-spa-view-sesiones { width: 100%; max-width: 900px; margin: 0 auto; padding-top: 60px; padding-bottom: 80px; box-sizing: border-box; }

.sesiones-filter-inner { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 30px; }
.sesiones-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #888;
    padding: 8px 16px;
    font-size: 12px;
    font-weight: 700;
    border-radius: 2px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: var(--font-mono);
    outline: none;
}
.sesiones-pill:hover { background: rgba(255, 255, 255, 0.05); color: #ffffff; border-color: rgba(255, 255, 255, 0.2); }
.sesiones-pill.active { background: var(--text-main) !important; color: #0a0a0a !important; border-color: var(--text-main) !important; }

.ps-admin-panel {
    background: #050505;
    border: 1px solid var(--border-subtle);
    border-radius: 2px;
    margin-bottom: 40px;
    padding: 20px;
}
.ps-panel-heading {
    font-size: 11px;
    color: #666666;
    font-weight: 800;
    text-transform: uppercase;
    font-family: var(--font-mono);
    margin: 0 0 15px 0;
}
.ps-admin-row {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}
.ps-admin-row-full {
    margin-bottom: 15px;
}
.ps-admin-input,
.ps-admin-select,
.ps-admin-textarea {
    background: #000000;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #ffffff;
    font-size: 13px;
    font-family: var(--font-mono);
    padding: 10px 12px;
    outline: none;
    border-radius: 2px;
    box-sizing: border-box;
}
.ps-admin-input,
.ps-admin-select {
    flex: 1;
    min-width: 180px;
}
.ps-admin-textarea {
    width: 100%;
    height: 100px;
    resize: vertical;
}
.ps-mp3-upload-box {
    background: #080808;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 2px;
    padding: 12px 14px;
    margin-bottom: 15px;
}
.ps-mp3-label {
    display: block;
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 800;
    color: #888888;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    margin-bottom: 10px;
}
.ps-mp3-controls-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}
.ps-hidden-file {
    display: none !important;
}
.ps-btn-upload-mp3 {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.16);
    color: var(--text-main);
    padding: 9px 14px;
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    border-radius: 2px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
}
.ps-btn-upload-mp3:hover {
    background: var(--text-main);
    color: #000000;
    border-color: var(--text-main);
}
.ps-mp3-filename {
    font-family: var(--font-mono);
    font-size: 11px;
    color: #666666;
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.ps-mp3-filename.has-file {
    color: var(--text-main);
    font-weight: 700;
}
.ps-mp3-url-input {
    flex: 1;
    min-width: 220px;
}
.ps-admin-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}
.ps-btn-cancel {
    display: none;
    background: transparent;
    color: #888888;
    border: none;
    padding: 10px 20px;
    font-family: var(--font-mono);
    font-weight: 800;
    font-size: 12px;
    cursor: pointer;
    border-radius: 2px;
}
.ps-btn-submit {
    background: var(--text-main);
    color: #000000;
    border: none;
    padding: 10px 20px;
    font-family: var(--font-mono);
    font-weight: 800;
    font-size: 12px;
    cursor: pointer;
    border-radius: 2px;
}

.ps-grid { display: flex; flex-direction: column; gap: 15px; }
.ps-card-wrapper {
    background: #111;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 2px;
    display: flex;
    flex-direction: column;
    transition: border-color 0.2s, background 0.2s;
    overflow: hidden;
    cursor: pointer;
}
.ps-card-wrapper:hover { border-color: rgba(255, 255, 255, 0.3); background: #141414; }
.ps-card-link { display: flex; flex-direction: row; align-items: stretch; text-decoration: none; min-height: 150px; }
.ps-card-link.inline-audio-trigger { cursor: pointer; }
.ps-info { display: flex; flex-direction: column; justify-content: flex-start; flex: 1; padding: 25px 30px; gap: 8px; }
.ps-meta-row { display: flex; align-items: center; gap: 8px; margin-bottom: 5px; }
.ps-cat { font-family: var(--font-mono); font-size: 13px; font-weight: 800; color: var(--text-main); text-transform: uppercase; }
.ps-sep { font-family: var(--font-mono); font-size: 13px; color: #555; }
.ps-date { font-family: var(--font-mono); font-size: 13px; color: #888; font-weight: 400; }
.ps-badge-mp3 { font-family: var(--font-mono); font-size: 11px; font-weight: 800; color: var(--text-main); letter-spacing: 0.6px; }
.ps-title { font-size: 20px; font-weight: 800; color: var(--text-main); margin: 0; line-height: 1.3; font-family: var(--font-mono); }
.ps-audio-actions-row { margin-top: 12px; display: flex; align-items: center; }
.ps-btn-escuchar-mp3 {
    background: #080808 !important;
    border: 1px solid rgba(255, 255, 255, 0.16) !important;
    color: var(--text-main) !important;
    padding: 10px 18px !important;
    font-family: var(--font-mono) !important;
    font-size: 11px !important;
    font-weight: 800 !important;
    letter-spacing: 1px !important;
    text-transform: uppercase !important;
    border-radius: 2px !important;
    cursor: pointer !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px !important;
    transition: all 0.2s ease !important;
}
.ps-btn-escuchar-mp3:hover,
.ps-btn-escuchar-mp3.is-playing-now {
    background: var(--text-main) !important;
    color: #000000 !important;
    border-color: var(--text-main) !important;
}
.ps-thumb-wrap { width: 300px; flex-shrink: 0; border-left: 1px solid rgba(255, 255, 255, 0.05); aspect-ratio: 16 / 9; }
.ps-thumb { width: 100%; height: 100%; object-fit: cover; background: #050505; display: block; }
.ps-admin-actions { padding: 10px 30px; background: rgba(0, 0, 0, 0.2); border-top: 1px solid rgba(255, 255, 255, 0.05); display: flex; justify-content: flex-start; gap: 20px; }
.ps-admin-actions button { background: transparent; border: none; font-size: 10px; font-weight: 800; font-family: var(--font-mono); cursor: pointer; padding: 0; outline: none; transition: color 0.2s; }
.btn-editar-sesion { color: #888; }
.btn-editar-sesion:hover { color: #fff; }
.btn-borrar-sesion { color: #ff5555; }
.btn-borrar-sesion:hover { color: #ff0000; }

@media (max-width: 991px) {
    .ps-card-link { flex-direction: column; }
    .ps-thumb-wrap { width: 100%; order: -1; aspect-ratio: 16 / 9; border-left: none; border-bottom: 1px solid rgba(255, 255, 255, 0.05); }
}

/* =========================================================================
   BLOQUEO DE SESIONES Y TIMER DE CADUCIDAD
   ========================================================================= */
.ps-lock-controls-row {
    margin-bottom: 0 !important;
}
.ps-lock-field {
    flex: 1;
    min-width: 220px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.ps-sub-label {
    font-family: var(--font-mono);
    font-size: 10px;
    color: #666666;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}
.ps-expira-input-wrap {
    display: flex;
    gap: 8px;
    align-items: stretch;
}
.ps-expira-input-wrap .ps-admin-input {
    flex: 1;
    color-scheme: dark;
}
.ps-btn-clear-expira {
    background: #000000;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #888888;
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 800;
    padding: 0 12px;
    cursor: pointer;
    border-radius: 2px;
    transition: color 0.2s, border-color 0.2s;
}
.ps-btn-clear-expira:hover {
    color: var(--text-main);
    border-color: rgba(255, 255, 255, 0.28);
}

.ps-countdown-badge,
.ps-lock-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    padding: 2px 8px;
    border-radius: 2px;
}
.ps-countdown-badge {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.14);
}
.ps-lock-badge {
    color: #777777;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.ps-card-wrapper.is-sesion-locked {
    background: #080808;
    border-color: rgba(255, 255, 255, 0.04);
    cursor: not-allowed;
}
.ps-card-wrapper.is-sesion-locked:hover {
    background: #080808;
    border-color: rgba(255, 255, 255, 0.06);
}
.ps-card-locked-surface {
    cursor: not-allowed !important;
    user-select: none;
}
.ps-card-wrapper.is-sesion-locked .ps-title,
.ps-card-wrapper.is-sesion-locked .ps-cat,
.ps-card-wrapper.is-sesion-locked .ps-date {
    color: #555555 !important;
}
.ps-card-wrapper.is-sesion-locked .ps-thumb {
    filter: grayscale(1) brightness(0.35);
}
.ps-thumb-wrap {
    position: relative;
}
.ps-thumb-lock-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(239, 239, 239, 0.55);
    background: rgba(0, 0, 0, 0.35);
    pointer-events: none;
}

.btn-toggle-lock-sesion {
    color: #b5b5b5;
}
.btn-toggle-lock-sesion:hover {
    color: #ffffff;
}

/* === SESIONES: SIN PÍLDORAS DE FILTRO + DESKTOP INTACTO + MOBILE DESAPELMAZADO === */
.sesiones-filter-inner,
.ps-card-wrapper .ps-cat,
.ps-card-wrapper .ps-cat + .ps-sep {
    display: none !important;
}

@media (max-width: 991px) {
    #v2-view-proy-sesiones.v2-spa-view-sesiones {
        width: 100% !important;
        max-width: 100% !important;
        padding-top: calc(var(--header-h, 65px) + 22px) !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
        padding-bottom: calc(var(--bottom-nav-h, 65px) + var(--mob-player-dock-h, 0px) + 32px) !important;
        margin: 0 !important;
        box-sizing: border-box !important;
    }
    .ps-grid {
        gap: 18px;
        width: 100%;
    }
    .ps-info {
        padding: 18px 18px 22px 18px;
        gap: 10px;
    }
    .ps-meta-row {
        display: flex;
        align-items: center;
        justify-content: space-between;
        flex-wrap: wrap;
        gap: 8px;
        margin-bottom: 2px;
    }
    .ps-meta-row .ps-sep {
        display: none !important;
    }
    .ps-date {
        font-size: 12px;
        color: #9a9a9a;
    }
    .ps-countdown-badge,
    .ps-lock-badge {
        font-size: 10.5px;
        padding: 4px 9px;
        white-space: nowrap;
        line-height: 1.2;
    }
    .ps-title {
        font-size: 18px;
        line-height: 1.32;
    }
}

/* === VISIBILIDAD GARANTIZADA MODAL LINK CHECK-IN === */
#checkin-link-modal {
    position: fixed !important;
    inset: 0 !important;
    width: 100vw !important;
    height: 100dvh !important;
    z-index: var(--z-modal) !important;
    background: rgba(2, 2, 2, 0.9) !important;
    backdrop-filter: blur(5px) !important;
    -webkit-backdrop-filter: blur(5px) !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 20px !important;
    box-sizing: border-box !important;
}
#checkin-link-modal.is-open {
    display: flex !important;
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
}
#checkin-link-modal.is-open > div {
    position: relative !important;
    z-index: 2 !important;
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
    transform: none !important;
    width: 100% !important;
    max-width: 400px !important;
    max-height: 90dvh !important;
    overflow-y: auto !important;
    box-sizing: border-box !important;
}
