/**
 * Custom Hotkeys Styles
 */

/* Settings Button */
.hotkeys-settings-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.hotkeys-settings-btn:hover {
    background: var(--bg-tertiary);
    transform: translateY(-1px);
}

.hotkeys-settings-btn svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

/* Settings Modal */
.hotkeys-settings-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.hotkeys-settings-modal.visible {
    opacity: 1;
    visibility: visible;
}

.hotkeys-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

.hotkeys-content {
    position: relative;
    background: var(--card-bg, #ffffff);
    border-radius: 20px;
    width: 90%;
    max-width: 700px;
    max-height: 85vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    transform: scale(0.9) translateY(20px);
    transition: transform 0.3s ease;
}

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

.hotkeys-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--border-primary);
}

.hotkeys-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.btn-close-hotkeys {
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.btn-close-hotkeys:hover {
    background: var(--bg-secondary);
}

.btn-close-hotkeys svg {
    width: 20px;
    height: 20px;
    fill: var(--text-secondary);
}

.hotkeys-toolbar {
    display: flex;
    gap: 1rem;
    padding: 1rem 2rem;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-primary);
}

.hotkeys-search {
    flex: 1;
    padding: 0.5rem 1rem;
    background: var(--bg-primary);
    border: 1px solid var(--border-primary);
    border-radius: 8px;
    font-size: 0.95rem;
    color: var(--text-primary);
}

.hotkeys-search:focus {
    outline: none;
    border-color: var(--color-primary);
}

.btn-reset-hotkeys {
    padding: 0.5rem 1rem;
    background: transparent;
    border: 1px solid var(--border-primary);
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-reset-hotkeys:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.hotkeys-list {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem 2rem;
}

.hotkey-category {
    margin-bottom: 2rem;
}

.hotkey-category h3 {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 1rem;
}

.hotkey-items {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.hotkey-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-radius: 8px;
    transition: all 0.2s ease;
}

.hotkey-item:hover {
    background: var(--bg-tertiary);
}

.hotkey-action {
    font-size: 0.95rem;
    color: var(--text-primary);
}

.hotkey-combo {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.375rem 0.75rem;
    background: var(--bg-primary);
    border: 1px solid var(--border-primary);
    border-radius: 6px;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.hotkey-combo:hover {
    background: var(--bg-tertiary);
    border-color: var(--color-primary);
}

.hotkey-combo.recording {
    background: var(--color-primary);
    color: white;
    border-color: var(--color-primary);
    animation: pulse 1.5s ease-in-out infinite;
}

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

.recording-text {
    font-style: italic;
}

.hotkey-combo kbd {
    display: inline-block;
    padding: 0.125rem 0.375rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-secondary);
    border-radius: 4px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-primary);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.hotkey-combo.recording kbd {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
    color: white;
}

.hotkeys-footer {
    padding: 1rem 2rem;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-primary);
    text-align: center;
}

.hotkeys-tip {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin: 0;
}

/* Conflict Modal */
.hotkey-conflict-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    background: var(--card-bg);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    z-index: 10001;
    opacity: 0;
    transition: all 0.2s ease;
}

.hotkey-conflict-modal.visible {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.conflict-content h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.conflict-content p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.conflict-content kbd {
    display: inline-block;
    padding: 0.125rem 0.375rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-radius: 4px;
    font-family: monospace;
    font-size: 0.875rem;
}

.conflict-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
}

.conflict-actions button {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-reassign {
    background: var(--color-primary);
    color: white;
}

.btn-reassign:hover {
    background: var(--color-primary-dark);
}

.btn-cancel {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-primary);
}

.btn-cancel:hover {
    background: var(--bg-tertiary);
}

/* Cheat Sheet */
.hotkey-cheat-sheet {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: var(--card-bg);
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    border: 1px solid var(--border-primary);
    z-index: 999;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
}

.hotkey-cheat-sheet.visible {
    opacity: 1;
    transform: translateY(0);
}

.cheat-sheet-content {
    padding: 1.5rem;
    min-width: 300px;
}

.cheat-sheet-content h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.cheat-category {
    margin-bottom: 1rem;
}

.cheat-category h4 {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.cheat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.25rem 0;
    font-size: 0.8125rem;
}

.cheat-item span:first-child {
    color: var(--text-primary);
}

.cheat-item span:last-child {
    color: var(--text-secondary);
    font-family: monospace;
}

.cheat-footer {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-primary);
    text-align: center;
    font-size: 0.75rem;
    color: var(--text-tertiary);
}

.cheat-footer kbd {
    display: inline-block;
    padding: 0.125rem 0.25rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-radius: 3px;
    font-family: monospace;
    font-size: 0.75rem;
}

/* Action Feedback */
.hotkey-feedback {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 1rem 2rem;
    border-radius: 8px;
    font-size: 1.125rem;
    font-weight: 500;
    z-index: 10003;
    opacity: 0;
    transition: all 0.2s ease;
    pointer-events: none;
}

.hotkey-feedback.visible {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

/* Dark theme adjustments */
[data-theme="dark"] .hotkeys-content {
    background: #1a1a1a;
}

[data-theme="dark"] .hotkeys-toolbar {
    background: #222;
}

[data-theme="dark"] .hotkeys-search {
    background: #1a1a1a;
    border-color: #444;
}

[data-theme="dark"] .hotkey-item {
    background: #2a2a2a;
    border-color: #444;
}

[data-theme="dark"] .hotkey-item:hover {
    background: #333;
}

[data-theme="dark"] .hotkey-combo {
    background: #1a1a1a;
    border-color: #444;
}

[data-theme="dark"] .hotkey-combo:hover {
    background: #333;
}

[data-theme="dark"] .hotkey-combo kbd {
    background: #333;
    border-color: #555;
}

[data-theme="dark"] .hotkeys-footer {
    background: #222;
}

[data-theme="dark"] .hotkey-conflict-modal {
    background: #1a1a1a;
}

[data-theme="dark"] .hotkey-cheat-sheet {
    background: #1a1a1a;
    border-color: #444;
}

[data-theme="dark"] .btn-cancel {
    background: #2a2a2a;
    border-color: #444;
}

[data-theme="dark"] .btn-cancel:hover {
    background: #333;
}

/* Mobile responsiveness */
@media (max-width: 640px) {
    .hotkeys-content {
        width: 100%;
        height: 100%;
        max-height: 100vh;
        border-radius: 0;
    }
    
    .hotkey-cheat-sheet {
        bottom: 10px;
        right: 10px;
        left: 10px;
        width: auto;
    }
    
    .cheat-sheet-content {
        min-width: auto;
        padding: 1rem;
    }
}