/* modals.css — Modals, Command Palette, Settings Panel */

/* ── Modal Base ───────────────────────────────────────────────────── */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.2s ease;
}

.modal {
    background: var(--rampf-ai-900);
    border: 1px solid var(--rampf-ai-700);
    border-radius: var(--radius-xl);
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: var(--shadow-xl);
    animation: slideUp 0.3s ease;
}

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

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-4) var(--space-6);
    border-bottom: 1px solid var(--rampf-ai-700);
}

.modal-header h2 {
    font-size: var(--text-lg);
    font-weight: var(--font-semibold);
    color: var(--text-primary);
}

.modal-close {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-md);
    border: none;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-base);
}

.modal-close:hover {
    background: var(--rampf-ai-800);
    color: var(--text-primary);
}

.modal-body {
    padding: var(--space-6);
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: var(--space-3);
    padding: var(--space-4) var(--space-6);
    border-top: 1px solid var(--rampf-ai-700);
}

/* ── Settings Modal ───────────────────────────────────────────────── */
.settings-section {
    margin-bottom: var(--space-6);
}

.settings-section:last-child {
    margin-bottom: 0;
}

.settings-section h3 {
    font-size: var(--text-sm);
    font-weight: var(--font-semibold);
    color: var(--teal-400);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: var(--space-3);
}

.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-3) 0;
    border-bottom: 1px solid var(--rampf-ai-800);
}

.setting-item:last-child {
    border-bottom: none;
}

.setting-label {
    font-size: var(--text-base);
    color: var(--text-primary);
}

.setting-desc {
    font-size: var(--text-xs);
    color: var(--text-muted);
    margin-top: var(--space-1);
}

.setting-control {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

/* Toggle Switch */
.toggle {
    position: relative;
    width: 44px;
    height: 24px;
    background: var(--rampf-ai-700);
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: background var(--transition-base);
}

.toggle.active {
    background: var(--teal-700);
}

.toggle-knob {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    background: white;
    border-radius: 50%;
    transition: transform var(--transition-base);
    box-shadow: var(--shadow-sm);
}

.toggle.active .toggle-knob {
    transform: translateX(20px);
}

/* Select Dropdown */
.select {
    padding: var(--space-2) var(--space-3);
    background: var(--rampf-ai-850);
    border: 1px solid var(--rampf-ai-700);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: var(--text-sm);
    cursor: pointer;
    transition: all var(--transition-base);
}

.select:hover {
    border-color: var(--teal-600);
}

.select:focus {
    outline: none;
    border-color: var(--teal-500);
    box-shadow: 0 0 0 3px rgba(38, 156, 184, 0.1);
}

/* ── Command Palette ──────────────────────────────────────────────── */
.command-palette {
    background: var(--rampf-ai-900);
    border: 1px solid var(--rampf-ai-700);
    border-radius: var(--radius-xl);
    width: 600px;
    max-width: 90%;
    box-shadow: var(--shadow-xl);
    overflow: hidden;
}

.command-search {
    width: 100%;
    padding: var(--space-4) var(--space-6);
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--rampf-ai-700);
    color: var(--text-primary);
    font-size: var(--text-lg);
    outline: none;
}

.command-search::placeholder {
    color: var(--text-muted);
}

.command-list {
    max-height: 400px;
    overflow-y: auto;
    padding: var(--space-2) 0;
}

.command-item {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-6);
    cursor: pointer;
    transition: background var(--transition-fast);
}

.command-item:hover,
.command-item.selected {
    background: var(--rampf-ai-800);
}

.command-icon {
    font-size: var(--text-lg);
    width: 24px;
    text-align: center;
}

.command-label {
    flex: 1;
    color: var(--text-primary);
    font-size: var(--text-base);
}

.command-shortcut {
    font-size: var(--text-xs);
    color: var(--text-muted);
    background: var(--rampf-ai-800);
    padding: var(--space-1) var(--space-2);
    border-radius: var(--radius-sm);
}

/* ── Memory Panel ─────────────────────────────────────────────────── */
.memory-panel {
    max-width: 700px;
}

.memory-section {
    margin-bottom: var(--space-6);
}

.memory-section h3 {
    font-size: var(--text-base);
    font-weight: var(--font-semibold);
    color: var(--teal-400);
    margin-bottom: var(--space-3);
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.memory-item {
    background: var(--rampf-ai-850);
    border: 1px solid var(--rampf-ai-700);
    border-radius: var(--radius-md);
    padding: var(--space-3);
    margin-bottom: var(--space-2);
}

.memory-item:last-child {
    margin-bottom: 0;
}

.memory-type {
    display: inline-block;
    font-size: var(--text-xs);
    padding: var(--space-1) var(--space-2);
    border-radius: var(--radius-sm);
    margin-bottom: var(--space-2);
}

.memory-type.knowledge {
    background: rgba(38, 156, 184, 0.2);
    color: var(--teal-300);
}

.memory-type.action {
    background: rgba(72, 187, 120, 0.2);
    color: var(--success);
}

.memory-content {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    line-height: 1.6;
}

/* ── Bookmarks Sidebar ────────────────────────────────────────────── */
.bookmarks-sidebar {
    position: fixed;
    right: 0;
    top: 64px;
    bottom: 0;
    width: 300px;
    background: var(--rampf-ai-900);
    border-left: 1px solid var(--rampf-ai-700);
    transform: translateX(100%);
    transition: transform var(--transition-slow);
    z-index: 500;
    overflow-y: auto;
}

.bookmarks-sidebar.open {
    transform: translateX(0);
}

.bookmarks-header {
    padding: var(--space-4) var(--space-6);
    border-bottom: 1px solid var(--rampf-ai-700);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.bookmarks-header h3 {
    font-size: var(--text-base);
    font-weight: var(--font-semibold);
    color: var(--text-primary);
}

.bookmark-item {
    padding: var(--space-4) var(--space-6);
    border-bottom: 1px solid var(--rampf-ai-800);
    cursor: pointer;
    transition: background var(--transition-fast);
}

.bookmark-item:hover {
    background: var(--rampf-ai-850);
}

.bookmark-label {
    font-size: var(--text-sm);
    font-weight: var(--font-medium);
    color: var(--text-primary);
    margin-bottom: var(--space-1);
}

.bookmark-preview {
    font-size: var(--text-xs);
    color: var(--text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ── File Preview Modal ───────────────────────────────────────────── */
.file-preview-modal {
    max-width: 900px;
    width: 90%;
    max-height: 90vh;
}

.file-preview-content {
    padding: 0;
    overflow: hidden;
}

.file-preview-content img {
    max-width: 100%;
    max-height: 70vh;
    object-fit: contain;
}

.file-preview-content pre {
    background: var(--rampf-ai-950);
    padding: var(--space-6);
    overflow: auto;
    max-height: 70vh;
}

/* ── Buttons ──────────────────────────────────────────────────────── */
.btn {
    padding: var(--space-2) var(--space-4);
    border-radius: var(--radius-md);
    font-size: var(--text-sm);
    font-weight: var(--font-medium);
    cursor: pointer;
    transition: all var(--transition-base);
    border: 1px solid transparent;
}

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

.btn-primary:hover {
    background: var(--teal-600);
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--rampf-ai-800);
    color: var(--text-secondary);
    border-color: var(--rampf-ai-600);
}

.btn-secondary:hover {
    background: var(--rampf-ai-700);
    color: var(--text-primary);
    border-color: var(--teal-600);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
}

.btn-ghost:hover {
    background: var(--rampf-ai-800);
    color: var(--text-primary);
}

/* ── Animations ───────────────────────────────────────────────────── */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideInRight {
    from { transform: translateX(100%); }
    to { transform: translateX(0); }
}

@keyframes slideOutRight {
    from { transform: translateX(0); }
    to { transform: translateX(100%); }
}
