/* ─── Panneau Raccourcis Clavier ───────────────────────────────────────────── */
/* css/shortcuts.css                                                            */

/* Container principal du panneau */
.shortcuts-panel-inner {
    display: flex;
    flex-direction: column;
    height: 100%;
    gap: 0;
}

/* ─── Header ──────────────────────────────────────────────────────────────── */
.shortcuts-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 0 12px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    margin-bottom: 10px;
    flex-shrink: 0;
}

.shortcuts-header-title {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 11px;
    font-weight: 900;
    color: white;
    text-transform: uppercase;
    letter-spacing: 0.18em;
}

.shortcuts-header-title svg {
    color: var(--accent-primary);
    flex-shrink: 0;
}

.shortcuts-header-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.shortcuts-action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #9ca3af;
    cursor: pointer;
    transition: all 0.2s;
}

.shortcuts-action-btn:hover {
    background: rgba(var(--accent-primary-rgb), 0.15);
    border-color: rgba(var(--accent-primary-rgb), 0.3);
    color: var(--accent-primary);
}

.shortcuts-reset-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 4px 8px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #6b7280;
    font-size: 8px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    cursor: pointer;
    transition: all 0.2s;
}

.shortcuts-reset-btn:hover {
    color: #f87171;
    border-color: rgba(248, 113, 113, 0.3);
    background: rgba(248, 113, 113, 0.08);
}

/* ─── Search ──────────────────────────────────────────────────────────────── */
.shortcuts-search-wrap {
    position: relative;
    margin-bottom: 10px;
    flex-shrink: 0;
}

.shortcuts-search-icon {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: #4b5563;
    pointer-events: none;
}

.shortcuts-search-input {
    width: 100%;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 10px;
    padding: 7px 12px 7px 30px;
    font-size: 10px;
    font-weight: 600;
    color: white;
    outline: none;
    box-sizing: border-box;
    transition: border-color 0.2s;
}

.shortcuts-search-input::placeholder {
    color: #4b5563;
}

.shortcuts-search-input:focus {
    border-color: rgba(var(--accent-primary-rgb), 0.4);
}

/* ─── Body (scrollable) ───────────────────────────────────────────────────── */
.shortcuts-body {
    flex: 1 1 0;
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding-right: 2px;
}

/* ─── Category ────────────────────────────────────────────────────────────── */
.shortcuts-category {
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.04);
    background: rgba(0, 0, 0, 0.2);
}

.shortcuts-category-header {
    display: flex;
    align-items: center;
    gap: 7px;
    width: 100%;
    padding: 8px 10px;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.02);
    border: none;
    color: #9ca3af;
    transition: background 0.15s, color 0.15s;
    text-align: left;
}

.shortcuts-category-header:hover {
    background: rgba(255, 255, 255, 0.05);
    color: white;
}

.shortcuts-cat-icon {
    color: var(--accent-primary);
    opacity: 0.7;
    display: flex;
    align-items: center;
}

.shortcuts-cat-label {
    font-size: 9px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    flex: 1;
}

.shortcuts-cat-count {
    font-size: 9px;
    font-weight: 700;
    font-family: monospace;
    color: #4b5563;
    background: rgba(255, 255, 255, 0.05);
    padding: 1px 5px;
    border-radius: 4px;
}

.shortcuts-cat-chevron {
    transition: transform 0.2s;
    color: #4b5563;
    flex-shrink: 0;
}

.shortcuts-cat-chevron.collapsed {
    transform: rotate(-90deg);
}

.shortcuts-category-body {
    display: flex;
    flex-direction: column;
    gap: 0;
    overflow: hidden;
    max-height: 9999px;
    transition: max-height 0.25s ease;
}

.shortcuts-category-body.collapsed {
    max-height: 0;
}

/* ─── Row ─────────────────────────────────────────────────────────────────── */
.shortcuts-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 7px 10px;
    gap: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    transition: background 0.15s;
}

.shortcuts-row:last-child {
    border-bottom: none;
}

.shortcuts-row:hover {
    background: rgba(255, 255, 255, 0.02);
}

.shortcuts-row.capturing {
    background: rgba(var(--accent-primary-rgb), 0.06);
    animation: shortcut-capture-pulse 1.5s ease infinite;
}

@keyframes shortcut-capture-pulse {
    0%, 100% { background: rgba(var(--accent-primary-rgb), 0.04); }
    50%       { background: rgba(var(--accent-primary-rgb), 0.10); }
}

.shortcuts-label {
    font-size: 10px;
    font-weight: 600;
    color: #d1d5db;
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ─── Badge Wrap ──────────────────────────────────────────────────────────── */
.shortcuts-badge-wrap {
    display: flex;
    align-items: center;
    gap: 5px;
    flex-shrink: 0;
    position: relative;
}

.shortcuts-custom-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--accent-primary);
    box-shadow: 0 0 6px rgba(var(--accent-primary-rgb), 0.7);
    flex-shrink: 0;
}

/* ─── Kbd Badge ───────────────────────────────────────────────────────────── */
.shortcuts-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 60px;
    padding: 3px 8px;
    border-radius: 7px;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    overflow: hidden;
}

.shortcuts-badge::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.03) 0%, transparent 60%);
    pointer-events: none;
}

.shortcuts-badge:hover {
    border-color: rgba(var(--accent-primary-rgb), 0.5);
    background: rgba(var(--accent-primary-rgb), 0.08);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.shortcuts-badge.unset {
    border-style: dashed;
    border-color: rgba(255, 255, 255, 0.08);
}

.shortcuts-badge.capturing {
    border-color: var(--accent-primary);
    background: rgba(var(--accent-primary-rgb), 0.12);
    box-shadow: 0 0 0 2px rgba(var(--accent-primary-rgb), 0.2), 0 0 12px rgba(var(--accent-primary-rgb), 0.15);
    animation: shortcut-badge-glow 1.2s ease infinite;
}

@keyframes shortcut-badge-glow {
    0%, 100% { box-shadow: 0 0 0 2px rgba(var(--accent-primary-rgb), 0.2), 0 0 8px rgba(var(--accent-primary-rgb), 0.1); }
    50%       { box-shadow: 0 0 0 2px rgba(var(--accent-primary-rgb), 0.5), 0 0 16px rgba(var(--accent-primary-rgb), 0.3); }
}

.shortcuts-badge kbd {
    font-family: 'JetBrains Mono', 'Cascadia Code', ui-monospace, monospace;
    font-size: 9px;
    font-weight: 700;
    color: #e5e7eb;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

.shortcuts-capture-hint {
    font-size: 8px;
    font-weight: 900;
    color: var(--accent-primary);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    white-space: nowrap;
    animation: shortcut-hint-blink 0.8s step-end infinite;
}

@keyframes shortcut-hint-blink {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.4; }
}

/* ─── Reset Single ────────────────────────────────────────────────────────── */
.shortcuts-reset-single {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    border-radius: 4px;
    background: transparent;
    border: none;
    color: #4b5563;
    cursor: pointer;
    transition: all 0.15s;
    flex-shrink: 0;
}

.shortcuts-reset-single:hover {
    background: rgba(248, 113, 113, 0.15);
    color: #f87171;
}

/* ─── Conflict Badge ──────────────────────────────────────────────────────── */
.shortcuts-conflict-badge {
    position: absolute;
    right: 0;
    top: calc(100% + 4px);
    z-index: 100;
    background: rgba(251, 191, 36, 0.15);
    border: 1px solid rgba(251, 191, 36, 0.3);
    border-radius: 8px;
    padding: 4px 8px;
    font-size: 8px;
    font-weight: 700;
    color: #fbbf24;
    white-space: nowrap;
    animation: shortcut-conflict-in 0.2s ease;
    pointer-events: none;
}

@keyframes shortcut-conflict-in {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ─── Empty State ─────────────────────────────────────────────────────────── */
.shortcuts-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 16px;
    font-size: 10px;
    color: #4b5563;
    font-style: italic;
    text-align: center;
}
