/* Keyboard Shortcuts Modal Styles */

.shortcuts-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.shortcuts-modal-overlay.visible {
    opacity: 1;
    visibility: visible;
}

.shortcuts-modal {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 
        0 20px 25px -5px rgba(0, 0, 0, 0.1),
        0 10px 10px -5px rgba(0, 0, 0, 0.04);
    width: 90vw;
    max-width: 800px;
    max-height: 80vh;
    overflow: hidden;
    transform: translateY(-20px) scale(0.95);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.shortcuts-modal-overlay.visible .shortcuts-modal {
    transform: translateY(0) scale(1);
}

.shortcuts-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem 2rem;
    border-bottom: 1px solid #e5e7eb;
    background: #f9fafb;
}

.shortcuts-header h2 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
    color: #1f2937;
}

.close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #6b7280;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 0.25rem;
    transition: all 0.15s ease;
}

.close-btn:hover {
    background: #e5e7eb;
    color: #374151;
}

.shortcuts-content {
    display: flex;
    flex-direction: column;
    height: calc(80vh - 100px);
}

.shortcuts-tabs {
    display: flex;
    border-bottom: 1px solid #e5e7eb;
    background: #f9fafb;
}

.tab-btn {
    flex: 1;
    padding: 1rem 1.5rem;
    border: none;
    background: transparent;
    color: #6b7280;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
    border-bottom: 2px solid transparent;
}

.tab-btn:hover {
    color: #374151;
    background: #f3f4f6;
}

.tab-btn.active {
    color: #3b82f6;
    border-bottom-color: #3b82f6;
    background: #ffffff;
}

.shortcuts-lists {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem 2rem;
}

.shortcuts-categories {
    display: grid;
    gap: 2rem;
}

.shortcut-category h4 {
    margin: 0 0 1rem 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: #374151;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #e5e7eb;
}

.shortcut-items {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 0.75rem;
}

.shortcut-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    transition: all 0.15s ease;
}

.shortcut-item:hover {
    background: #f3f4f6;
    border-color: #d1d5db;
}

.shortcut-item.custom {
    background: #eff6ff;
    border-color: #dbeafe;
}

.shortcut-item.custom:hover {
    background: #dbeafe;
}

.shortcut-key {
    font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
    font-size: 0.875rem;
    background: #ffffff;
    padding: 0.25rem 0.5rem;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    color: #374151;
    font-weight: 500;
    min-width: 120px;
    text-align: center;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.shortcut-desc {
    flex: 1;
    margin-left: 1rem;
    color: #6b7280;
    font-size: 0.875rem;
}

.delete-shortcut {
    background: #ef4444;
    color: white;
    border: none;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    cursor: pointer;
    transition: background 0.15s ease;
}

.delete-shortcut:hover {
    background: #dc2626;
}

/* Record new shortcut form */
.shortcuts-record {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 300px;
}

.record-form {
    background: #f9fafb;
    padding: 2rem;
    border-radius: 12px;
    border: 2px dashed #d1d5db;
    text-align: center;
    max-width: 400px;
    width: 100%;
}

.record-form h3 {
    margin: 0 0 1.5rem 0;
    color: #374151;
    font-size: 1.25rem;
}

.record-form input,
.record-form select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    margin-bottom: 1rem;
    font-size: 0.875rem;
    transition: border-color 0.15s ease;
}

.record-form input:focus,
.record-form select:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.record-btn {
    background: #3b82f6;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s ease;
    width: 100%;
}

.record-btn:hover {
    background: #2563eb;
}

.no-shortcuts {
    text-align: center;
    color: #6b7280;
    font-style: italic;
    padding: 2rem;
}

/* Dark theme support */
.dark-theme .shortcuts-modal {
    background: #1f2937;
    color: #f9fafb;
}

.dark-theme .shortcuts-header {
    background: #111827;
    border-bottom-color: #374151;
}

.dark-theme .shortcuts-header h2 {
    color: #f9fafb;
}

.dark-theme .shortcuts-tabs {
    background: #111827;
    border-bottom-color: #374151;
}

.dark-theme .tab-btn {
    color: #9ca3af;
}

.dark-theme .tab-btn:hover {
    color: #d1d5db;
    background: #374151;
}

.dark-theme .tab-btn.active {
    color: #60a5fa;
    background: #1f2937;
}

.dark-theme .shortcut-item {
    background: #374151;
    border-color: #4b5563;
}

.dark-theme .shortcut-item:hover {
    background: #4b5563;
}

.dark-theme .shortcut-key {
    background: #1f2937;
    border-color: #4b5563;
    color: #d1d5db;
}

.dark-theme .shortcut-desc {
    color: #d1d5db;
}

.dark-theme .record-form {
    background: #374151;
    border-color: #4b5563;
}

.dark-theme .record-form input,
.dark-theme .record-form select {
    background: #1f2937;
    border-color: #4b5563;
    color: #f9fafb;
}

/* Responsive design */
@media (max-width: 768px) {
    .shortcuts-modal {
        width: 95vw;
        max-height: 90vh;
        margin: 1rem;
    }
    
    .shortcuts-header {
        padding: 1rem 1.5rem;
    }
    
    .shortcuts-lists {
        padding: 1rem 1.5rem;
    }
    
    .shortcut-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .shortcut-key {
        min-width: auto;
        align-self: flex-start;
    }
    
    .shortcut-desc {
        margin-left: 0;
    }
    
    .shortcuts-categories {
        gap: 1.5rem;
    }
}

/* Animation for keyboard recording */
.recording-indicator {
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Focus indicators */
.tab-btn:focus,
.record-btn:focus,
.delete-shortcut:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* Custom scrollbar */
.shortcuts-lists::-webkit-scrollbar {
    width: 8px;
}

.shortcuts-lists::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 4px;
}

.shortcuts-lists::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

.shortcuts-lists::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}