/* Reader v2.0 - Help Modal Styles - DiseÃ±o Mejorado */

.help-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 3000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.help-modal.visible {
    opacity: 1;
    visibility: visible;
}

.help-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.help-modal-content {
    position: relative;
    background: linear-gradient(180deg, #1f1f1f 0%, #151515 100%);
    border: 1px solid rgba(168, 85, 247, 0.3);
    border-radius: 20px;
    width: 100%;
    max-width: 420px;
    max-height: 85vh;
    overflow: hidden;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5), 0 0 40px rgba(168, 85, 247, 0.1);
    transform: scale(0.9) translateY(20px);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
}

.help-modal.visible .help-modal-content {
    transform: scale(1) translateY(0);
}

/* Header */
.help-modal-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px 20px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(168, 85, 247, 0.05);
}

.help-header-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #a855f7 0%, #7c3aed 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.help-header-icon svg {
    width: 22px;
    height: 22px;
    fill: white;
}

.help-modal-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: #fff;
    margin: 0;
    flex: 1;
}

.help-modal-close {
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: #888;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.help-modal-close svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

.help-modal-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.help-modal-close:active {
    transform: scale(0.95);
}

/* Body */
.help-modal-body {
    padding: 16px 20px;
    overflow-y: auto;
    flex: 1;
    -webkit-overflow-scrolling: touch;
}

/* Categories */
.help-category {
    margin-bottom: 20px;
}

.help-category:last-child {
    margin-bottom: 0;
}

.help-category-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    font-weight: 600;
    color: #a855f7;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.help-category-icon {
    width: 28px;
    height: 28px;
    background: rgba(168, 85, 247, 0.15);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.help-category-icon svg {
    width: 16px;
    height: 16px;
    fill: #a855f7;
}

/* Cards (gestos principales) */
.help-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.help-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    padding: 14px 10px;
    text-align: center;
    transition: all 0.2s ease;
}

.help-card:active {
    transform: scale(0.98);
    background: rgba(255, 255, 255, 0.06);
}

.help-card-icon {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.2) 0%, rgba(124, 58, 237, 0.2) 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 10px;
}

.help-card-icon svg {
    width: 24px;
    height: 24px;
    fill: #a855f7;
}

.help-card-content {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.help-card-content strong {
    font-size: 13px;
    font-weight: 600;
    color: #fff;
}

.help-card-content span {
    font-size: 11px;
    color: #888;
    line-height: 1.3;
}

/* List items (menu options) */
.help-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.help-list-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
}

.help-list-icon {
    width: 32px;
    height: 32px;
    background: rgba(168, 85, 247, 0.1);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.help-list-icon svg {
    width: 18px;
    height: 18px;
    fill: #a855f7;
}

.help-list-text {
    font-size: 13px;
    color: #aaa;
    line-height: 1.4;
}

.help-list-text strong {
    color: #fff;
    font-weight: 500;
}

/* Shortcuts section */
.help-category-shortcuts {
    background: rgba(168, 85, 247, 0.05);
    border: 1px solid rgba(168, 85, 247, 0.15);
    border-radius: 14px;
    padding: 14px;
    margin-top: 16px;
}

.help-category-shortcuts .help-category-title {
    margin-bottom: 14px;
}

.help-shortcuts-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}

.help-shortcut {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 20px;
}

.help-shortcut kbd {
    display: flex;
    align-items: center;
    gap: 2px;
    background: linear-gradient(180deg, #2a2a2a 0%, #1a1a1a 100%);
    border: 1px solid #444;
    border-radius: 6px;
    padding: 4px 8px;
    font-size: 12px;
    font-weight: 500;
    color: #ddd;
    font-family: -apple-system, system-ui, sans-serif;
    min-height: 26px;
    box-shadow: 0 2px 0 #111;
}

.help-shortcut kbd svg {
    width: 14px;
    height: 14px;
    fill: currentColor;
}

.help-shortcut span {
    font-size: 12px;
    color: #888;
}

/* Footer */
.help-modal-footer {
    padding: 16px 20px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.2);
}

.help-btn-close {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 20px;
    background: linear-gradient(135deg, #a855f7 0%, #7c3aed 100%);
    border: none;
    border-radius: 12px;
    color: white;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 15px rgba(168, 85, 247, 0.3);
}

.help-btn-close svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

.help-btn-close:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(168, 85, 247, 0.4);
}

.help-btn-close:active {
    transform: translateY(0);
}

/* ========================================
   RESPONSIVE - MOBILE FIRST
   ======================================== */

/* Pantallas pequeÃ±as */
@media (max-width: 380px) {
    .help-modal {
        padding: 10px;
    }

    .help-modal-content {
        max-height: 90vh;
        border-radius: 16px;
    }

    .help-modal-header {
        padding: 16px;
        gap: 10px;
    }

    .help-header-icon {
        width: 36px;
        height: 36px;
        border-radius: 10px;
    }

    .help-header-icon svg {
        width: 20px;
        height: 20px;
    }

    .help-modal-header h3 {
        font-size: 16px;
    }

    .help-modal-body {
        padding: 14px 16px;
    }

    .help-cards {
        gap: 8px;
    }

    .help-card {
        padding: 12px 8px;
        border-radius: 12px;
    }

    .help-card-icon {
        width: 38px;
        height: 38px;
        border-radius: 10px;
        margin-bottom: 8px;
    }

    .help-card-icon svg {
        width: 20px;
        height: 20px;
    }

    .help-card-content strong {
        font-size: 12px;
    }

    .help-card-content span {
        font-size: 10px;
    }

    .help-list-item {
        padding: 10px 12px;
        gap: 10px;
    }

    .help-list-icon {
        width: 28px;
        height: 28px;
    }

    .help-list-icon svg {
        width: 16px;
        height: 16px;
    }

    .help-list-text {
        font-size: 12px;
    }

    .help-category-shortcuts {
        padding: 12px;
    }

    .help-shortcut {
        padding: 6px 10px;
    }

    .help-shortcut kbd {
        padding: 3px 6px;
        font-size: 11px;
        min-height: 24px;
    }

    .help-shortcut kbd svg {
        width: 12px;
        height: 12px;
    }

    .help-shortcut span {
        font-size: 11px;
    }

    .help-modal-footer {
        padding: 14px 16px 16px;
    }

    .help-btn-close {
        padding: 12px 16px;
        font-size: 14px;
    }
}

/* Tablets y pantallas medianas */
@media (min-width: 481px) and (max-width: 768px) {
    .help-modal-content {
        max-width: 460px;
    }

    .help-cards {
        gap: 12px;
    }

    .help-card {
        padding: 16px 12px;
    }

    .help-card-icon {
        width: 48px;
        height: 48px;
    }

    .help-card-icon svg {
        width: 26px;
        height: 26px;
    }
}

/* Desktop */
@media (min-width: 769px) {
    .help-modal-content {
        max-width: 480px;
        max-height: 80vh;
    }

    .help-modal-header {
        padding: 24px 24px 20px;
    }

    .help-modal-body {
        padding: 20px 24px;
    }

    .help-card:hover {
        background: rgba(255, 255, 255, 0.06);
        border-color: rgba(168, 85, 247, 0.2);
        transform: translateY(-2px);
    }

    .help-list-item:hover {
        background: rgba(255, 255, 255, 0.05);
    }

    .help-modal-footer {
        padding: 20px 24px 24px;
    }
}

/* Landscape en mÃ³vil */
@media (max-height: 500px) and (orientation: landscape) {
    .help-modal {
        padding: 8px;
    }

    .help-modal-content {
        max-height: 95vh;
        flex-direction: row;
        max-width: 90vw;
    }

    .help-modal-header {
        writing-mode: vertical-rl;
        text-orientation: mixed;
        padding: 16px 12px;
        border-bottom: none;
        border-right: 1px solid rgba(255, 255, 255, 0.1);
    }

    .help-modal-header h3 {
        font-size: 14px;
    }

    .help-modal-body {
        padding: 12px 16px;
        display: flex;
        flex-wrap: wrap;
        gap: 16px;
        align-content: flex-start;
    }

    .help-category {
        margin-bottom: 0;
        flex: 1;
        min-width: 200px;
    }

    .help-modal-footer {
        writing-mode: vertical-rl;
        padding: 16px 12px;
        border-top: none;
        border-left: 1px solid rgba(255, 255, 255, 0.1);
    }

    .help-btn-close {
        writing-mode: horizontal-tb;
        padding: 10px 12px;
        font-size: 13px;
    }
}

/* AnimaciÃ³n de entrada suave */
@keyframes helpModalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.help-modal.visible .help-modal-content {
    animation: helpModalSlideIn 0.3s ease forwards;
}

/* Scrollbar personalizado */
.help-modal-body::-webkit-scrollbar {
    width: 6px;
}

.help-modal-body::-webkit-scrollbar-track {
    background: transparent;
}

.help-modal-body::-webkit-scrollbar-thumb {
    background: rgba(168, 85, 247, 0.3);
    border-radius: 3px;
}

.help-modal-body::-webkit-scrollbar-thumb:hover {
    background: rgba(168, 85, 247, 0.5);
}