/* ==========================================================================
   Universal Spotlight Command Palette & Floating Toast Notifications
   ========================================================================== */

.cmd-palette-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 9999;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 12vh 1rem 2rem;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.cmd-palette-backdrop.active {
    opacity: 1;
    visibility: visible;
}

.cmd-palette-modal {
    width: 100%;
    max-width: 620px;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 20px 60px -15px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(226, 232, 240, 0.8);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transform: scale(0.96) translateY(-10px);
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.cmd-palette-backdrop.active .cmd-palette-modal {
    transform: scale(1) translateY(0);
}

.cmd-palette-input-wrap {
    display: flex;
    align-items: center;
    padding: 0.95rem 1.25rem;
    border-bottom: 1px solid #e2e8f0;
    gap: 0.75rem;
    background: #ffffff;
}

.cmd-palette-input-wrap svg {
    color: #6366f1;
    flex-shrink: 0;
}

.cmd-palette-input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 1rem;
    font-family: inherit;
    color: #0f172a !important;
    background: transparent !important;
    padding: 0;
    box-shadow: none !important;
}

.cmd-palette-input::placeholder {
    color: #94a3b8;
}

.cmd-palette-esc-badge {
    font-family: monospace;
    font-size: 0.7rem;
    padding: 0.2rem 0.45rem;
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    color: #64748b;
    flex-shrink: 0;
}

.cmd-palette-results {
    max-height: 380px;
    overflow-y: auto;
    padding: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.cmd-palette-empty {
    padding: 2.5rem 1rem;
    text-align: center;
    color: #64748b;
    font-size: 0.92rem;
}

.cmd-palette-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.65rem 0.85rem;
    border-radius: 8px;
    text-decoration: none;
    color: #0f172a;
    transition: background 0.12s ease;
    cursor: pointer;
    gap: 0.75rem;
}

.cmd-palette-item:hover,
.cmd-palette-item.selected {
    background: #f1f5f9;
    outline: none;
}

.cmd-palette-item-left {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    flex: 1;
    min-width: 0;
}

.cmd-palette-item-icon {
    font-size: 1.1rem;
    flex-shrink: 0;
}

.cmd-palette-item-text {
    flex: 1;
    min-width: 0;
}

.cmd-palette-item-title {
    font-size: 0.88rem;
    font-weight: 600;
    color: #0f172a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cmd-palette-item-subtitle {
    font-size: 0.72rem;
    color: #64748b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cmd-palette-item-category {
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 0.15rem 0.45rem;
    border-radius: 4px;
    background: #e0e7ff;
    color: #4338ca;
    flex-shrink: 0;
}

.cmd-palette-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 1rem;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
    font-size: 0.72rem;
    color: #64748b;
}

.cmd-palette-keys {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.cmd-palette-key-hint {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.cmd-palette-key-hint kbd {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 3px;
    padding: 0.1rem 0.3rem;
    font-size: 0.68rem;
    font-family: monospace;
}

/* ==========================================================================
   Command Palette Dark Mode Support
   ========================================================================== */
[data-theme="dark"] .cmd-palette-modal {
    background: #0e1526 !important;
    box-shadow: 0 20px 60px -15px rgba(0, 0, 0, 0.8), 0 0 0 1px #1e293b !important;
}

[data-theme="dark"] .cmd-palette-input-wrap {
    background: #0e1526 !important;
    border-color: #1e293b !important;
}

[data-theme="dark"] .cmd-palette-input {
    color: #ffffff !important;
    background: transparent !important;
}

[data-theme="dark"] .cmd-palette-input::placeholder {
    color: #64748b !important;
}

[data-theme="dark"] .cmd-palette-esc-badge {
    background: #172033 !important;
    border-color: #334155 !important;
    color: #cbd5e1 !important;
}

[data-theme="dark"] .cmd-palette-empty {
    color: #94a3b8 !important;
}

[data-theme="dark"] .cmd-palette-item {
    color: #f8fafc !important;
}

[data-theme="dark"] .cmd-palette-item:hover,
[data-theme="dark"] .cmd-palette-item.selected {
    background: #172033 !important;
}

[data-theme="dark"] .cmd-palette-item-title {
    color: #ffffff !important;
}

[data-theme="dark"] .cmd-palette-item-subtitle {
    color: #94a3b8 !important;
}

[data-theme="dark"] .cmd-palette-item-category {
    background: rgba(99, 102, 241, 0.2) !important;
    color: #a5b4fc !important;
}

[data-theme="dark"] .cmd-palette-footer {
    background: #090d16 !important;
    border-color: #1e293b !important;
    color: #94a3b8 !important;
}

[data-theme="dark"] .cmd-palette-key-hint kbd {
    background: #172033 !important;
    border-color: #334155 !important;
    color: #cbd5e1 !important;
}

/* Floating Toast Notifications */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    pointer-events: none;
    max-width: 90vw;
}

.toast {
    background: #0f172a;
    color: #ffffff;
    border: 1px solid #334155;
    padding: 0.75rem 1.15rem;
    border-radius: 10px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    gap: 0.65rem;
    font-size: 0.86rem;
    font-weight: 500;
    pointer-events: auto;
    animation: toastSlideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.toast.toast-success {
    background: #064e3b;
    border-color: #059669;
    color: #ecfdf5;
}

.toast.toast-warning {
    background: #78350f;
    border-color: #d97706;
    color: #fffbeb;
}

.toast.toast-danger {
    background: #7f1d1d;
    border-color: #dc2626;
    color: #fef2f2;
}

@keyframes toastSlideIn {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}
