:root {
    /* Base Themes - Dark */
    --bg-page: #09090b; /* Zinc 950 */
    --bg-panel: #18181b; /* Zinc 900 */
    --bg-surface: #27272a; /* Zinc 800 */
    --bg-hover: #3f3f46;
    
    --bg-editor: #1e1e24; /* Editor Dark */
    
    --text-primary: #fafafa;
    --text-secondary: #d4d4d8;
    --text-muted: #71717a;
    
    --border-color: #3f3f46;
    --border-light: rgba(255, 255, 255, 0.05);
    
    --primary: #3b82f6; /* Blue 500 */
    --primary-hover: #2563eb;
    
    --secondary: #10b981; /* Emerald 500 */
    
    --success: #10b981;
    --error: #ef4444;
    --warning: #f59e0b;
    
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
    
    --font-sans: 'Inter', system-ui, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
}

[data-theme="light"] {
    --bg-page: #f4f4f5; /* Zinc 100 */
    --bg-panel: #ffffff;
    --bg-surface: #f4f4f5;
    --bg-hover: #e4e4e7;
    
    --bg-editor: #ffffff;
    
    --text-primary: #09090b;
    --text-secondary: #3f3f46;
    --text-muted: #71717a;
    
    --border-color: #e4e4e7;
    --border-light: rgba(0, 0, 0, 0.05);
    
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    
    --secondary: #059669;
    
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

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

body {
    font-family: var(--font-sans);
    background-color: var(--bg-page);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    line-height: 1.5;
    transition: background-color 0.3s, color 0.3s;
}

/* Utilities */
.font-mono { font-family: var(--font-mono); }
.text-muted { color: var(--text-muted); }
.text-error { color: var(--error); }
.text-success { color: var(--success); }

/* Layout */
.app-container {
    width: 100%;
    max-width: 1600px;
    margin: 0 auto;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    height: 100vh;
}

/* Header */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    flex-shrink: 0;
}

.brand {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logo {
    display: flex; align-items: center; gap: 0.5rem;
    color: var(--primary);
}
.logo-arrow { color: var(--text-muted); opacity: 0.5; width: 16px; height: 16px; }

.title-group { display: flex; align-items: center; gap: 0.75rem; }
.title-group h1 { font-size: 1.1rem; font-weight: 700; color: var(--text-primary); }
.badge {
    background: rgba(59, 130, 246, 0.1); color: var(--primary);
    padding: 0.2rem 0.5rem; border-radius: 99px; font-size: 0.7rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em;
}

.header-actions { display: flex; align-items: center; gap: 0.5rem; }
.divider { width: 1px; height: 24px; background: var(--border-color); margin: 0 0.5rem; }

/* Buttons */
.btn {
    display: inline-flex; justify-content: center; align-items: center; gap: 0.5rem;
    padding: 0.5rem 1rem; border-radius: var(--radius-md); font-size: 0.85rem; font-weight: 600; font-family: inherit;
    border: 1px solid transparent; cursor: pointer; transition: all 0.2s;
}
.btn i { width: 16px; height: 16px; }
.btn-sm { padding: 0.35rem 0.75rem; font-size: 0.8rem; }
.btn-primary { background: linear-gradient(135deg, var(--primary), #60a5fa); color: white; border: none; }
.btn-primary:hover { opacity: 0.9; transform: translateY(-1px); }
.btn-ghost { background: transparent; color: var(--text-secondary); border: 1px solid var(--border-color); }
.btn-ghost:hover { background: var(--bg-surface); color: var(--text-primary); }
.icon-btn {
    width: 38px; height: 38px; display: flex; align-items: center; justify-content: center;
    border-radius: var(--radius-md); border: none; background: transparent; color: var(--text-secondary);
    cursor: pointer; transition: 0.2s;
}
.icon-btn.sm { width: 30px; height: 30px; }
.icon-btn.sm i { width: 16px; height: 16px; }
.icon-btn:hover { background: var(--bg-surface); color: var(--text-primary); }

/* Workspace Split View */
.workspace {
    display: flex;
    gap: 0;
    flex: 1;
    min-height: 0;
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    position: relative;
    box-shadow: var(--shadow-md);
}

.workspace-divider {
    width: 1px; background: var(--border-color); display: flex; align-items: center; justify-content: center; position: relative; z-index: 10;
}
.convert-icon {
    position: absolute; width: 36px; height: 36px; background: var(--bg-page); border: 1px solid var(--border-color);
    border-radius: 50%; display: flex; align-items: center; justify-content: center; color: var(--primary);
    left: 50%; transform: translateX(-50%); box-shadow: 0 0 10px rgba(0,0,0,0.1);
}

.editor-panel {
    flex: 1; display: flex; flex-direction: column; min-width: 0; position: relative;
}

.output-panel { background: rgba(59, 130, 246, 0.02); }

.panel-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 0.75rem 1.25rem; border-bottom: 1px solid var(--border-color); background: var(--bg-surface);
}

.panel-title { display: flex; align-items: center; gap: 0.5rem; font-weight: 600; font-size: 0.9rem; color: var(--text-secondary); }
.panel-title i { width: 18px; height: 18px; color: var(--text-muted); }
.file-type { font-family: var(--font-mono); font-size: 0.75rem; color: var(--text-muted); background: var(--bg-page); padding: 0.1rem 0.4rem; border-radius: 4px; border: 1px solid var(--border-color);}

.gradient-text { background: linear-gradient(135deg, var(--primary), var(--secondary)); -webkit-background-clip: text; -webkit-text-fill-color: transparent;}

.panel-actions { display: flex; gap: 0.5rem; }

/* Editor Containers */
.editor-container {
    flex: 1; display: flex; overflow: hidden; background: var(--bg-editor); position: relative;
}

.line-numbers {
    width: 3rem; padding: 1rem 0; background: var(--bg-surface); color: var(--text-muted); opacity: 0.6;
    border-right: 1px solid var(--border-color); font-family: var(--font-mono); font-size: 0.85rem;
    text-align: right; user-select: none; overflow: hidden; display: flex; flex-direction: column; line-height: 1.6;
}

.line-numbers span { display: block; padding-right: 0.5rem; }

textarea {
    flex: 1; padding: 1rem; border: none; background: transparent; color: var(--text-primary);
    font-family: var(--font-mono); font-size: 0.85rem; line-height: 1.6; outline: none; resize: none;
    white-space: pre; overflow-wrap: normal; overflow-x: auto;
}
textarea::placeholder { color: var(--text-muted); opacity: 0.5; }
#prisma-output { color: var(--secondary); border: none; outline: none; }

/* Status Bar */
.status-bar {
    display: flex; align-items: center; gap: 0.5rem; padding: 0.5rem 1rem;
    border-top: 1px solid var(--border-color); background: var(--bg-surface); font-size: 0.75rem; color: var(--text-muted); font-weight: 500;
}
.status-icon { width: 14px; height: 14px; }
.status-icon.success { color: var(--success); }
.status-icon.error { color: var(--error); }

.output-status { justify-content: space-between; }
.models-count { color: var(--primary); font-family: var(--font-mono); font-weight: 600; }
.output-status i { width: 14px; height: 14px; color: var(--warning); display: inline-block; vertical-align: middle; margin-right: 0.2rem;}

/* Modals & Toasts */
.modal-overlay {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.6); backdrop-filter: blur(4px); z-index: 1000;
    display: none; align-items: center; justify-content: center; opacity: 0; transition: opacity 0.2s;
}
.modal-overlay.show { display: flex; animation: fadeIn 0.2s forwards; }

.modal {
    width: 100%; max-width: 450px; background: var(--bg-panel); border: 1px solid var(--border-color);
    border-radius: var(--radius-lg); padding: 1.5rem; animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.5rem; padding-bottom: 1rem; border-bottom: 1px solid var(--border-color);}
.modal-header h2 { font-size: 1.1rem; display: flex; align-items: center; gap: 0.5rem; }
.modal-close { margin-top: -0.5rem; margin-right: -0.5rem; }
.shortcuts-list { list-style: none; display: flex; flex-direction: column; gap: 0.75rem; }
.shortcuts-list li { display: flex; justify-content: space-between; align-items: center; font-size: 0.9rem; color: var(--text-muted); }
kbd { background: var(--bg-surface); border: 1px solid var(--border-color); padding: 0.2rem 0.4rem; border-radius: 4px; font-family: var(--font-mono); font-size: 0.8rem; color: var(--text-primary); }

.toast {
    position: fixed; bottom: 2rem; left: 50%; transform: translateX(-50%) translateY(100px);
    background: var(--text-primary); color: var(--bg-page); padding: 0.75rem 1.5rem; border-radius: 99px;
    font-weight: 600; font-size: 0.9rem; box-shadow: var(--shadow-md); z-index: 2000;
    opacity: 0; transition: all 0.3s; pointer-events: none;
}
.toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }

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

/* Media Queries */
@media (max-width: 900px) {
    .workspace { flex-direction: column; }
    .workspace-divider { width: 100%; height: 1px; }
    .convert-icon { top: 50%; left: auto; right: 2rem; transform: translateY(-50%); }
    .editor-container { min-height: 250px; }
}
