/* ============================================
   HS STUDIO - MODAL FIXES (unificado)
   ============================================ */

/* ============================================
   MODAL BASE - Estructura común landing + panel
   ============================================ */
.hs-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(15, 23, 42, 0.92);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    animation: hsFadeIn 0.25s ease;
}

@keyframes hsFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.hs-modal-box {
    background: #0f172a;
    border-radius: 24px;
    max-width: 900px;
    width: 100%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    animation: hsSlideUp 0.3s ease;
    position: relative;
}

@keyframes hsSlideUp {
    from { transform: translateY(30px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.hs-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: all 0.2s;
    font-size: 16px;
}

.hs-modal-close:hover {
    background: rgba(239, 68, 68, 0.8);
    transform: rotate(90deg);
}

.hs-modal-body {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    display: flex;
    flex-direction: column;
}

/* Scrollbar oculto */
.hs-modal-body::-webkit-scrollbar {
    width: 0;
    display: none;
}

.hs-modal-body {
    scrollbar-width: none;
    -ms-overflow-style: none;
}

/* ============================================
   REPRODUCTOR
   ============================================ */
.hs-preview-player-wrap {
    background: #000;
    flex-shrink: 0;
    position: relative;
}

.hs-preview-player-inner {
    position: relative;
    padding-bottom: 56.25%;
}

.hs-preview-player-inner iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

.hs-preview-no-video {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #0f172a;
    color: #475569;
    gap: 12px;
    flex-direction: column;
}

.hs-preview-no-video i {
    font-size: 48px;
}

/* ============================================
   CONTENIDO (título + notas)
   ============================================ */
.hs-preview-content {
    padding: 24px;
    flex-shrink: 0;
    background: #0f172a;
}

.hs-preview-title {
    font-size: 22px;
    margin: 0 0 20px 0;
    font-weight: 700;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

/* ============================================
   NOTAS
   ============================================ */
.hs-preview-notes {
    margin-top: 8px;
}

.hs-preview-notes-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    margin-bottom: 12px;
}

.hs-preview-notes-header i {
    color: #22d3ee;
}

.hs-preview-notes-count {
    margin-left: auto;
    font-size: 12px;
    color: #94a3b8;
    background: rgba(255, 255, 255, 0.1);
    padding: 2px 10px;
    border-radius: 20px;
}

.hs-notes-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.hs-note-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    transition: background 0.2s;
}

.hs-note-item:last-child {
    border-bottom: none;
}

.hs-note-item:hover {
    background: rgba(255, 255, 255, 0.02);
}

.hs-note-time-btn {
    flex-shrink: 0;
    padding: 4px 12px;
    background: linear-gradient(135deg, #0891b2, #06b6d4);
    color: white;
    border: none;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-family: monospace;
}

.hs-note-time-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(8, 145, 178, 0.3);
}

.hs-preview-notes .hs-note-content {
    flex: 1;
    font-size: 14px;
    line-height: 1.4;
    color: #cbd5e1;
    word-break: break-word;
    overflow: hidden;
    cursor: pointer;
    max-height: 20px;
    position: relative;
    padding-right: 20px;
    transition: max-height 0.3s ease;
}

.hs-preview-notes .hs-note-content.expanded {
    max-height: 500px;
}

.hs-preview-notes .hs-note-content .hs-note-first-line {
    display: block;
}

.hs-preview-notes .hs-note-content .hs-note-rest {
    display: none;
}

.hs-preview-notes .hs-note-content.expanded .hs-note-rest {
    display: block;
}

.hs-preview-notes .hs-note-content .hs-note-rest,
.hs-preview-notes .hs-note-content .hs-note-first-line {
    cursor: pointer;
}

.hs-preview-notes .hs-note-content::after {
    content: '\f078';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    right: 0;
    top: 2px;
    font-size: 10px;
    color: #94a3b8;
    transition: transform 0.3s ease;
    pointer-events: none;
}

.hs-preview-notes .hs-note-content.expanded::after {
    transform: rotate(180deg);
}

.hs-preview-empty {
    color: #94a3b8;
    margin: 0;
}

/* ============================================
   FOOTER / BOTONES
   ============================================ */
.hs-modal-footer {
    display: flex;
    gap: 12px;
    padding: 16px 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    background: #0f172a;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.hs-modal-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.hs-modal-btn-share {
    background: linear-gradient(135deg, #0891b2, #7c3aed);
    color: white;
}

.hs-modal-btn-share:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(8, 145, 178, 0.3);
}

.hs-modal-btn-edit {
    background: #f59e0b;
    color: white;
}

.hs-modal-btn-edit:hover {
    background: #d97706;
    transform: translateY(-2px);
}

.hs-modal-btn-delete {
    background: #ef4444;
    color: white;
}

.hs-modal-btn-delete:hover {
    background: #dc2626;
    transform: translateY(-2px);
}

/* ============================================
   BOTÓN COMPARTIR INLINE (landing)
   ============================================ */
.hs-preview-share-inline {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.hs-preview-share-inline:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
}

/* ============================================
   MENÚ DE PLAYLIST (3 puntos)
   ============================================ */
.hs-shelf-menu-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: #94a3b8;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    font-size: 14px;
}

.hs-shelf-menu-btn:hover {
    background: rgba(0, 0, 0, 0.05);
    color: #64748b;
}

.hs-shelf-menu {
    position: absolute;
    top: 40px;
    right: 0;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    padding: 8px 0;
    min-width: 180px;
    z-index: 100;
}

.hs-shelf-menu button {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 16px;
    border: none;
    background: transparent;
    color: #334155;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    text-align: left;
    transition: background 0.15s;
    white-space: nowrap;
}

.hs-shelf-menu button:hover {
    background: #f1f5f9;
}

/* ============================================
   BODY LOCK
   ============================================ */
body.hs-modal-lock {
    overflow: hidden !important;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    .hs-modal {
        padding: 8px;
    }

    .hs-modal-box {
        max-height: 95vh;
        border-radius: 16px;
    }

    .hs-preview-content {
        padding: 16px;
    }

    .hs-modal-footer {
        padding: 12px 16px;
    }

    .hs-preview-title {
        font-size: 18px;
    }

    .hs-modal-btn {
        padding: 8px 12px;
        font-size: 12px;
    }
}
