/**
 * Snapshots Panel Styles
 * Clean, professional styling for conversation snapshots
 */

:root {
    --bg-primary: #1a1a2e;
    --bg-secondary: #16213e;
    --bg-tertiary: #0f3460;
    --accent: #e94560;
    --accent-hover: #d63d57;
    --text-primary: #eee;
    --text-secondary: #a0a0a0;
    --border: #2a2a4a;
    --success: #4caf50;
    --warning: #ff9800;
    --danger: #f44336;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    padding: 20px;
}

/* Snapshot Panel */
.snapshot-panel {
    max-width: 400px;
    margin: 0 auto;
    background: var(--bg-secondary);
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border);
}

/* Header */
.header {
    padding: 20px;
    border-bottom: 1px solid var(--border);
}

.header h2 {
    font-size: 1.3rem;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

/* Actions */
.actions {
    display: flex;
    gap: 10px;
    padding: 15px 20px;
    border-bottom: 1px solid var(--border);
}

/* Stats */
.stats {
    display: flex;
    gap: 20px;
    padding: 15px 20px;
    border-bottom: 1px solid var(--border);
    background: rgba(0,0,0,0.2);
}

.stat {
    display: flex;
    flex-direction: column;
}

.stat .value {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--accent);
}

.stat .label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Buttons */
.btn-primary {
    flex: 1;
    padding: 10px 16px;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.2s;
}

.btn-primary:hover {
    background: var(--accent-hover);
}

.btn-ghost {
    width: 40px;
    height: 40px;
    background: var(--bg-tertiary);
    border: none;
    border-radius: 6px;
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.btn-ghost:hover {
    background: var(--border);
}

.btn-secondary {
    padding: 10px 20px;
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: none;
    border-radius: 6px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-secondary:hover {
    background: var(--border);
}

.btn-danger {
    padding: 10px 20px;
    background: var(--danger);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-danger:hover {
    background: #d32f2f;
}

/* Snapshot List */
.snapshot-list {
    max-height: 400px;
    overflow-y: auto;
}

.empty-state {
    padding: 40px 20px;
    text-align: center;
    color: var(--text-secondary);
}

.empty-state .icon {
    font-size: 3rem;
    margin-bottom: 10px;
    display: block;
}

.empty-state p {
    font-size: 1rem;
    margin-bottom: 5px;
}

.empty-state .hint {
    font-size: 0.85rem;
    opacity: 0.7;
}

/* Snapshot Item */
.snapshot-item {
    padding: 15px 20px;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.snapshot-item:hover {
    background: rgba(233, 69, 96, 0.05);
}

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

.snapshot-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
}

.snapshot-type {
    width: 24px;
    height: 24px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
}

.snapshot-type.manual { background: var(--accent); }
.snapshot-type.auto { background: var(--bg-tertiary); }

.snapshot-name {
    font-weight: 500;
    flex: 1;
}

.snapshot-meta {
    font-size: 0.8rem;
    color: var(--text-secondary);
    display: flex;
    gap: 10px;
    align-items: center;
}

.snapshot-actions {
    display: none;
    gap: 8px;
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
}

.snapshot-item:hover .snapshot-actions {
    display: flex;
}

.snapshot-actions button {
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.75rem;
    transition: all 0.2s;
}

.btn-restore {
    background: var(--success);
    color: white;
}

.btn-restore:hover {
    background: #388e3c;
}

.btn-delete {
    background: var(--danger);
    color: white;
}

.btn-delete:hover {
    background: #d32f2f;
}

/* Timestamp */
.timestamp {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* Tags */
.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 6px;
}

.tag {
    padding: 2px 8px;
    background: var(--bg-tertiary);
    border-radius: 12px;
    font-size: 0.7rem;
    color: var(--text-secondary);
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: var(--bg-secondary);
    border-radius: 12px;
    border: 1px solid var(--border);
    width: 90%;
    max-width: 400px;
    overflow: hidden;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 20px;
    border-bottom: 1px solid var(--border);
}

.modal-header.warning {
    background: rgba(244, 67, 54, 0.1);
}

.modal-header h3 {
    font-size: 1.1rem;
}

.btn-close {
    width: 32px;
    height: 32px;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 1.2rem;
    transition: color 0.2s;
}

.btn-close:hover {
    color: var(--text-primary);
}

.modal-body {
    padding: 20px;
}

.modal-body p {
    margin-bottom: 10px;
    line-height: 1.5;
}

.modal-body .details {
    background: var(--bg-primary);
    padding: 12px;
    border-radius: 6px;
    font-family: monospace;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.modal-body .warning-text {
    color: var(--warning);
    font-weight: 500;
}

.modal-footer {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    padding: 15px 20px;
    border-top: 1px solid var(--border);
    background: var(--bg-primary);
}

/* Form Fields */
.field {
    margin-bottom: 15px;
}

.field:last-child {
    margin-bottom: 0;
}

.field label {
    display: block;
    font-size: 0.85rem;
    margin-bottom: 5px;
    color: var(--text-secondary);
}

.field input,
.field textarea {
    width: 100%;
    padding: 10px 12px;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 0.9rem;
    transition: border-color 0.2s;
}

.field input:focus,
.field textarea:focus {
    outline: none;
    border-color: var(--accent);
}

.field textarea {
    resize: vertical;
    min-height: 60px;
}

/* Loading */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    color: var(--text-secondary);
}

.spinner {
    width: 24px;
    height: 24px;
    border: 2px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-right: 10px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Responsive */
@media (max-width: 480px) {
    body {
        padding: 10px;
    }
    
    .snapshot-panel {
        max-width: 100%;
    }
}