/* ==========================================================================
   Hotkey System Styles
   ========================================================================== */

/* ---------- Sub-menu overlay (no backdrop, no animation) ---------- */

.hotkey-sub-overlay {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1060;
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.18);
    padding: 12px 16px;
    min-width: 200px;
    font-family: inherit;
}

[data-bs-theme="dark"] .hotkey-sub-overlay {
    background: #2a2a3d;
    border-color: rgba(255, 255, 255, 0.15);
    color: #e9ecef;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
}

.hotkey-sub-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    padding-bottom: 6px;
    border-bottom: 1px solid #dee2e6;
}

[data-bs-theme="dark"] .hotkey-sub-header {
    border-color: rgba(255, 255, 255, 0.15);
}

.hotkey-sub-title {
    font-weight: 700;
    font-size: 0.9rem;
}

.hotkey-sub-caps {
    display: none;
    margin-left: auto;
    margin-right: 10px;
    padding: 2px 6px;
    border-radius: 4px;
    background: #fff3cd;
    color: #664d03;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.hotkey-sub-caps.is-on {
    display: inline-flex;
}

.hotkey-sub-close {
    background: none;
    border: none;
    font-size: 1.1rem;
    cursor: pointer;
    opacity: 0.5;
    color: inherit;
    padding: 0 2px;
    line-height: 1;
}

.hotkey-sub-close:hover {
    opacity: 1;
}

.hotkey-sub-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1059;
    background: transparent;
}

.hotkey-sub-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 0;
    font-size: 0.9rem;
}

/* ---------- Shared kbd styling ---------- */

.hotkey-sub-option kbd,
.hotkey-guide-table kbd {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 24px;
    padding: 0 6px;
    background: #f0f0f0;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-family: inherit;
    font-size: 0.8rem;
    font-weight: 600;
    color: #222;
}

[data-bs-theme="dark"] .hotkey-sub-option kbd,
[data-bs-theme="dark"] .hotkey-guide-table kbd {
    background: #3a3d41;
    border-color: #555;
    color: #e9ecef;
}

/* ---------- Guide overlay (with tinted backdrop) ---------- */

.hotkey-guide-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1059;
    background: rgba(0, 0, 0, 0.45);
}

[data-bs-theme="dark"] .hotkey-guide-backdrop {
    background: rgba(0, 0, 0, 0.6);
}

.hotkey-guide-overlay {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1060;
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 10px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.22);
    padding: 14px 18px;
    min-width: 340px;
    max-width: min(1120px, calc(100vw - 48px));
    max-height: calc(100vh - 48px);
    overflow-y: auto;
    font-family: inherit;
}

[data-bs-theme="dark"] .hotkey-guide-overlay {
    background: #2a2a3d;
    border-color: rgba(255, 255, 255, 0.15);
    color: #e9ecef;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.hotkey-guide-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #dee2e6;
}

[data-bs-theme="dark"] .hotkey-guide-header {
    border-color: rgba(255, 255, 255, 0.15);
}

.hotkey-guide-header h5 {
    margin: 0;
    font-weight: 700;
    font-size: 1rem;
}

.hotkey-guide-close {
    background: none;
    border: none;
    font-size: 1.25rem;
    cursor: pointer;
    opacity: 0.6;
    color: inherit;
    padding: 0 4px;
}

.hotkey-guide-close:hover {
    opacity: 1;
}

.hotkey-guide-table {
    width: 100%;
    border-collapse: collapse;
}

.hotkey-guide-columns {
    display: grid;
    grid-template-columns: repeat(var(--hotkey-guide-column-count, 2), minmax(0, 1fr));
    gap: 14px;
}

.hotkey-guide-column {
    min-width: 0;
}

.hotkey-guide-table td {
    padding: 3px 6px;
    vertical-align: middle;
    border-bottom: 1px solid #f0f0f0;
    font-size: 0.84rem;
}

[data-bs-theme="dark"] .hotkey-guide-table td {
    border-bottom-color: rgba(255, 255, 255, 0.08);
}

.hotkey-guide-table td:first-child {
    width: 50px;
    text-align: center;
}

.hotkey-guide-table .hotkey-guide-type {
    font-size: 0.7rem;
    text-transform: uppercase;
    opacity: 0.5;
    margin-left: 6px;
}

.hotkey-guide-subitem {
    display: inline-block;
    margin-left: 12px;
    opacity: 0.7;
    padding-top: 3px;
}

.hotkey-guide-section {
    font-weight: 600;
    font-size: 0.72rem;
    text-transform: uppercase;
    opacity: 0.5;
    padding: 7px 6px 3px;
    border-bottom: none !important;
}

.hotkey-notice {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, calc(-50% + 74px));
    z-index: 1061;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    background: #212529;
    color: #fff;
    font-size: 0.9rem;
    font-weight: 600;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.25);
    opacity: 1;
    transition: opacity 0.25s ease;
}

.hotkey-notice.is-hiding {
    opacity: 0;
}

@media (max-width: 720px) {
    .hotkey-guide-columns {
        grid-template-columns: 1fr;
    }
}
