/* ============================================
   KEYBOARD SHORTCUTS HELP MODAL
   ============================================ */

.keyboard-shortcuts-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
}

.keyboard-shortcuts-modal.visible {
    display: block;
}

.keyboard-shortcuts-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.2s ease;
}

.keyboard-shortcuts-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    animation: slideInFromTop 0.3s ease;
}

.keyboard-shortcuts-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px;
    border-bottom: 1px solid #e0e0e0;
}

.keyboard-shortcuts-header h2 {
    margin: 0;
    font-size: 24px;
    font-weight: 600;
    color: #333;
}

.keyboard-shortcuts-header .close-btn {
    background: none;
    border: none;
    font-size: 32px;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.keyboard-shortcuts-header .close-btn:hover {
    background-color: #f5f5f5;
    color: #333;
}

.keyboard-shortcuts-body {
    padding: 24px;
}

.shortcut-section {
    margin-bottom: 32px;
}

.shortcut-section:last-child {
    margin-bottom: 0;
}

.shortcut-section h3 {
    margin: 0 0 16px 0;
    font-size: 16px;
    font-weight: 600;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.shortcut-item {
    display: flex;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
}

.shortcut-item:last-child {
    border-bottom: none;
}

.shortcut-item kbd {
    background-color: #f5f5f5;
    border: 1px solid #d0d0d0;
    border-radius: 4px;
    padding: 4px 8px;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    font-weight: 600;
    color: #333;
    box-shadow: 0 2px 0 rgba(0, 0, 0, 0.1);
    margin-right: 4px;
}

.shortcut-item span {
    margin-left: 12px;
    color: #666;
    font-size: 14px;
}

/* ============================================
   TOAST NOTIFICATIONS
   ============================================ */

.toast-container {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    background: white;
    color: #333;
    padding: 12px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    font-size: 14px;
    font-weight: 500;
    min-width: 200px;
    opacity: 0;
    transform: translateX(100%);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.toast.visible {
    opacity: 1;
    transform: translateX(0);
}

.toast-success {
    border-left: 4px solid #4caf50;
}

.toast-error {
    border-left: 4px solid #f44336;
}

.toast-warning {
    border-left: 4px solid #ff9800;
}

.toast-info {
    border-left: 4px solid #2196f3;
}

/* ============================================
   UNDO/REDO TOOLBAR
   ============================================ */

.undo-redo-toolbar {
    position: fixed;
    top: 20px;
    right: 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    padding: 8px;
    display: flex;
    gap: 4px;
    z-index: 1000;
    animation: slideInFromTop 0.3s ease;
}

.undo-redo-btn {
    background: none;
    border: none;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: #333;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: background-color 0.15s ease, transform 0.1s ease;
}

.undo-redo-btn:hover:not(:disabled) {
    background-color: #f5f5f5;
}

.undo-redo-btn:active:not(:disabled) {
    transform: scale(0.95);
}

.undo-redo-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.undo-redo-btn .icon {
    font-size: 16px;
}

.undo-redo-btn .shortcut-hint {
    font-size: 11px;
    color: #999;
    margin-left: 4px;
}

/* Tooltip for command description */
.undo-redo-btn[title]:hover::after {
    content: attr(title);
    position: absolute;
    bottom: -32px;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: white;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    z-index: 1001;
    animation: fadeIn 0.2s ease;
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

@media (max-width: 768px) {
    .keyboard-shortcuts-content {
        width: 95%;
        max-height: 90vh;
    }
    
    .keyboard-shortcuts-header,
    .keyboard-shortcuts-body {
        padding: 16px;
    }
    
    .undo-redo-toolbar {
        top: 10px;
        right: 10px;
    }
    
    .toast-container {
        top: 70px;
        right: 10px;
        left: 10px;
    }
    
    .toast {
        min-width: auto;
        width: 100%;
    }
}

/* ============================================
   DARK MODE SUPPORT (OPTIONAL)
   ============================================ */

@media (prefers-color-scheme: dark) {
    .keyboard-shortcuts-content {
        background: #2d2d2d;
    }
    
    .keyboard-shortcuts-header {
        border-bottom-color: #444;
    }
    
    .keyboard-shortcuts-header h2 {
        color: #f5f5f5;
    }
    
    .keyboard-shortcuts-header .close-btn {
        color: #999;
    }
    
    .keyboard-shortcuts-header .close-btn:hover {
        background-color: #444;
        color: #f5f5f5;
    }
    
    .shortcut-section h3 {
        color: #aaa;
    }
    
    .shortcut-item {
        border-bottom-color: #444;
    }
    
    .shortcut-item kbd {
        background-color: #444;
        border-color: #555;
        color: #f5f5f5;
    }
    
    .shortcut-item span {
        color: #ccc;
    }
    
    .toast {
        background: #2d2d2d;
        color: #f5f5f5;
    }
    
    .undo-redo-toolbar {
        background: #2d2d2d;
    }
    
    .undo-redo-btn {
        color: #f5f5f5;
    }
    
    .undo-redo-btn:hover:not(:disabled) {
        background-color: #444;
    }
}

/* ============================================
   ACCESSIBILITY - REDUCED MOTION
   ============================================ */

@media (prefers-reduced-motion: reduce) {
    .keyboard-shortcuts-backdrop,
    .keyboard-shortcuts-content,
    .toast,
    .undo-redo-toolbar {
        animation: none !important;
    }
    
    .keyboard-shortcuts-content {
        transition: none;
    }
    
    .toast {
        transition: none;
        opacity: 1;
        transform: none;
    }
    
    .undo-redo-btn {
        transition: none;
    }
}
