* { margin: 0; padding: 0; box-sizing: border-box; }
:root {
    --bg-dark: #050505;
    --bg-page: #0a0a0a;
    --glass-surface: rgba(20, 20, 20, 0.7);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-highlight: rgba(255, 255, 255, 0.03);
    --text-primary: #ededed;
    --text-secondary: #a1a1a1;
    --text-muted: #525252;
    --accent-blue: #60a5fa;
    --font-sans: 'Inter', sans-serif;
}
body {
    font-family: var(--font-sans);
    background: var(--bg-page);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
}
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--glass-border); border-radius: 3px; }

main { 
    flex: 1; 
    padding: 1.5rem 2rem 1.5rem 1rem;
    display: flex; 
    flex-direction: column; 
    gap: 1.5rem; 
    max-width: calc(100% - 240px); 
    margin-left: 40px;
    overflow-y: auto;
}
.model-selector {
    background: var(--glass-surface);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 1.25rem;
    backdrop-filter: blur(20px);
}
.model-selector-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem; }
.model-selector-header h2 { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-secondary); font-weight: 500; }
.header-controls { display: flex; align-items: center; gap: 1rem; }
.selected-count { font-size: 0.75rem; color: var(--text-muted); }
.select-all-btn {
    font-family: inherit; font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.05em;
    padding: 0.5rem 1rem; border: 1px solid var(--glass-border);
    background: transparent; color: var(--text-secondary); border-radius: 6px; cursor: pointer; transition: all 0.2s;
}
.select-all-btn:hover { background: var(--glass-highlight); color: var(--text-primary); }
.model-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 0.5rem; }
.model-option {
    display: flex; align-items: center; gap: 0.5rem;
    padding: 0.625rem 0.75rem; border: 1px solid var(--glass-border);
    border-radius: 8px; cursor: pointer; transition: all 0.15s; background: transparent;
}
.model-option:hover { border-color: var(--text-muted); background: var(--glass-highlight); }
.model-option.selected { background: var(--text-primary); border-color: var(--text-primary); color: var(--bg-dark); }
.model-option input { display: none; }
.model-option .checkbox { width: 16px; height: 16px; border: 1px solid currentColor; border-radius: 4px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.model-option.selected .checkbox::after { content: '✓'; font-size: 10px; }
.model-option .model-name { font-size: 0.8125rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.input-section {
    background: var(--glass-surface);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 1.25rem;
    display: flex; flex-direction: column; gap: 1rem;
    backdrop-filter: blur(20px);
}
.input-section textarea {
    font-family: inherit; font-size: 1rem; padding: 1rem;
    border: 1px solid var(--glass-border); background: var(--glass-highlight);
    color: var(--text-primary); border-radius: 8px;
    outline: none; resize: none; min-height: 80px;
}
.input-section textarea::placeholder { color: var(--text-muted); }
.input-section textarea:focus { border-color: var(--text-muted); }
button.compare-btn {
    font-family: inherit; background: var(--text-primary); color: var(--bg-dark);
    border: none; padding: 1rem 2rem; border-radius: 12px;
    font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.1em;
    font-weight: 500; cursor: pointer; transition: all 0.2s; align-self: flex-start;
}
button.compare-btn:hover { transform: scale(1.02); box-shadow: 0 0 20px rgba(255, 255, 255, 0.2); }
button.compare-btn:disabled { background: var(--glass-highlight); color: var(--text-muted); cursor: not-allowed; transform: none; box-shadow: none; }
.results-container { flex: 1; overflow-x: auto; padding-bottom: 1rem; }
.results-grid { display: flex; gap: 1rem; min-width: min-content; }
.result-card {
    background: var(--glass-surface);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    display: flex; flex-direction: column;
    min-width: 320px; max-width: 380px; flex-shrink: 0;
    backdrop-filter: blur(20px);
}
.result-header { padding: 1rem; border-bottom: 1px solid var(--glass-border); display: flex; align-items: center; justify-content: space-between; }
.result-model-name { font-size: 0.875rem; font-weight: 500; }
.result-status { font-size: 0.625rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); }
.result-status.generating { color: var(--accent-blue); }
.result-content { min-height: 300px; display: flex; align-items: center; justify-content: center; padding: 1rem; }
.result-content img { max-width: 100%; max-height: 400px; object-fit: contain; border-radius: 8px; }
.spinner { width: 30px; height: 30px; border: 3px solid var(--glass-border); border-top-color: var(--text-primary); border-radius: 50%; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.empty-results { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--text-muted); text-align: center; min-height: 300px; }
.empty-results h2 { font-size: 1.5rem; font-weight: 500; color: var(--text-primary); margin-bottom: 0.5rem; }
.empty-results p { font-size: 0.875rem; color: var(--text-secondary); }
@media (max-width: 768px) {
    header { padding: 1rem; flex-wrap: wrap; gap: 1rem; }
    nav { width: 100%; overflow-x: auto; }
    main { padding: 1rem; }
    .model-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
}


/* Light Theme */
[data-theme="light"] {
    --bg-dark: #ffffff;
    --bg-page: #f5f5f5;
    --glass-surface: rgba(255, 255, 255, 0.9);
    --glass-border: rgba(0, 0, 0, 0.1);
    --glass-highlight: rgba(0, 0, 0, 0.03);
    --text-primary: #1a1a1a;
    --text-secondary: #525252;
    --text-muted: #a1a1a1;
    --accent-blue: #3b82f6;
}

[data-theme="light"] .model-selector,
[data-theme="light"] .input-section {
    background: rgba(255, 255, 255, 0.95);
    border-color: rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .model-option {
    border-color: rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .model-option:hover {
    background: rgba(0, 0, 0, 0.03);
    border-color: rgba(0, 0, 0, 0.15);
}

[data-theme="light"] .model-option.selected {
    background: #1a1a1a;
    border-color: #1a1a1a;
    color: #ffffff;
}

[data-theme="light"] .input-section textarea {
    background: rgba(0, 0, 0, 0.03);
    border-color: rgba(0, 0, 0, 0.1);
    color: #1a1a1a;
}

[data-theme="light"] button.compare-btn {
    background: #1a1a1a;
    color: #ffffff;
}

[data-theme="light"] button.select-all-btn {
    background: rgba(0, 0, 0, 0.03);
    border-color: rgba(0, 0, 0, 0.1);
    color: #1a1a1a;
}

[data-theme="light"] button.select-all-btn:hover {
    background: rgba(0, 0, 0, 0.06);
}

[data-theme="light"] .results-container {
    background: rgba(255, 255, 255, 0.95);
    border-color: rgba(0, 0, 0, 0.1);
}
