/* Aurelius - Dark Theme */

:root {
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-tertiary: #1a1a25;
    --bg-hover: #22222f;
    --text-primary: #e8e8ed;
    --text-secondary: #8888a0;
    --text-muted: #55556a;
    --accent: #6366f1;
    --accent-hover: #818cf8;
    --accent-glow: rgba(99, 102, 241, 0.2);
    --success: #22c55e;
    --error: #ef4444;
    --warning: #f59e0b;
    --border: #2a2a3a;
    --border-light: #3a3a4a;
    --font-mono: 'JetBrains Mono', monospace;
    --font-sans: 'Inter', -apple-system, sans-serif;
    --radius: 8px;
    --radius-lg: 12px;
}

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

body {
    font-family: var(--font-sans);
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.5;
}

/* Landing Page */
.landing {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 3rem 1.5rem;
    background: radial-gradient(ellipse at top, #1a1a2e 0%, var(--bg-primary) 60%);
}

.landing-header {
    text-align: center;
    margin-bottom: 3rem;
}

.logo {
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--accent) 0%, #a855f7 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.tagline {
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin-top: 0.5rem;
}

.auth-container {
    width: 100%;
    max-width: 400px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 2rem;
    margin-bottom: 3rem;
}

.auth-container h2 {
    font-size: 1.25rem;
    margin-bottom: 1.5rem;
    text-align: center;
}

.auth-container input {
    width: 100%;
    padding: 0.875rem 1rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-size: 1rem;
    margin-bottom: 1rem;
    transition: border-color 0.2s;
}

.auth-container input:focus {
    outline: none;
    border-color: var(--accent);
}

.auth-container button {
    width: 100%;
    padding: 0.875rem;
    background: var(--accent);
    border: none;
    border-radius: var(--radius);
    color: white;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
}

.auth-container button:hover {
    background: var(--accent-hover);
}

.auth-container button:active {
    transform: scale(0.98);
}

.hint {
    color: var(--text-secondary);
    font-size: 0.875rem;
    text-align: center;
    margin-top: 1rem;
}

.dev-hint {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--warning);
    background: rgba(245, 158, 11, 0.1);
    padding: 0.5rem;
    border-radius: var(--radius);
    margin-top: 1rem;
    word-break: break-all;
}

.status {
    padding: 1rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
    text-align: center;
}

.status.success {
    background: rgba(34, 197, 94, 0.1);
    color: var(--success);
}

.status.error {
    background: rgba(239, 68, 68, 0.1);
    color: var(--error);
}

.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    max-width: 900px;
    width: 100%;
}

.feature {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    text-align: center;
}

.feature-icon {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.feature h3 {
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

.feature p {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.landing-footer {
    margin-top: auto;
    padding-top: 3rem;
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* App Layout */
.app-container {
    display: grid;
    grid-template-columns: 280px 1fr;
    height: 100vh;
}

.sidebar {
    background: var(--bg-secondary);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    padding: 1.25rem;
    border-bottom: 1px solid var(--border);
}

.sidebar-header .logo {
    font-size: 1.5rem;
}

.sessions {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
}

.sessions-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.sessions-header h4 {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
}

.btn-icon {
    width: 28px;
    height: 28px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-primary);
    cursor: pointer;
    font-size: 1rem;
}

.btn-icon:hover {
    background: var(--bg-hover);
}

.sessions ul {
    list-style: none;
}

.sessions li {
    padding: 0.625rem 0.75rem;
    border-radius: var(--radius);
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-bottom: 0.25rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sessions li:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.sessions li.active {
    background: var(--accent-glow);
    color: var(--text-primary);
    border: 1px solid var(--accent);
}

.sessions li.empty {
    color: var(--text-muted);
    cursor: default;
}

.user-panel {
    padding: 1rem;
    border-top: 1px solid var(--border);
}

.user-email {
    font-size: 0.875rem;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
    overflow: hidden;
    text-overflow: ellipsis;
}

.usage-bar {
    height: 4px;
    background: var(--bg-tertiary);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.usage-fill {
    height: 100%;
    background: var(--accent);
    transition: width 0.3s;
}

.usage-text {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.claude-status {
    font-size: 0.75rem;
    margin-bottom: 0.75rem;
}

.claude-status.connected {
    color: var(--success);
}

.claude-status.disconnected {
    color: var(--error);
}

.btn-logout {
    width: 100%;
    padding: 0.5rem;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-secondary);
    font-size: 0.75rem;
    cursor: pointer;
}

.btn-logout:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

/* Main Area */
.main-area {
    display: flex;
    flex-direction: column;
    height: 100vh;
    background: var(--bg-primary);
}

.banner {
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border);
    padding: 0.75rem 1.5rem;
}

.banner-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 800px;
    margin: 0 auto;
}

.banner span {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.messages {
    flex: 1;
    overflow-y: auto;
    padding: 2rem;
}

.welcome-message {
    text-align: center;
    padding: 3rem;
    color: var(--text-secondary);
}

.welcome-message h2 {
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.message {
    max-width: 800px;
    margin: 0 auto 1.5rem;
}

.message.user {
    background: var(--bg-tertiary);
    padding: 1rem 1.25rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.message.assistant {
    font-family: var(--font-mono);
    font-size: 0.875rem;
    line-height: 1.7;
    white-space: pre-wrap;
    padding: 1rem 0;
}

.message.assistant.error {
    color: var(--error);
}

.message.loading {
    color: var(--text-muted);
}

/* Input Area */
.input-area {
    padding: 1rem 2rem 1.5rem;
    border-top: 1px solid var(--border);
    background: var(--bg-secondary);
}

.input-controls {
    max-width: 800px;
    margin: 0 auto 0.75rem;
}

.model-select {
    padding: 0.5rem 0.75rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-size: 0.875rem;
    cursor: pointer;
}

.input-box {
    display: flex;
    gap: 0.75rem;
    max-width: 800px;
    margin: 0 auto;
}

.input-box textarea {
    flex: 1;
    padding: 0.875rem 1rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 0.9375rem;
    resize: none;
    min-height: 52px;
    max-height: 200px;
}

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

.btn-send {
    padding: 0 1.25rem;
    background: var(--accent);
    border: none;
    border-radius: var(--radius);
    color: white;
    cursor: pointer;
    transition: background 0.2s;
}

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

.btn-send:disabled {
    background: var(--bg-tertiary);
    color: var(--text-muted);
    cursor: not-allowed;
}

.send-icon {
    font-size: 1.25rem;
}

/* Modal */
.modal {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
}

.modal-content {
    position: relative;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 2rem;
    max-width: 450px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-content h3 {
    margin-bottom: 1.5rem;
    text-align: center;
}

.oauth-steps {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.step {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.step-num {
    width: 24px;
    height: 24px;
    background: var(--accent);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
    flex-shrink: 0;
}

.step p {
    color: var(--text-secondary);
    font-size: 0.875rem;
    padding-top: 2px;
}

.step code {
    background: var(--bg-tertiary);
    padding: 0.125rem 0.375rem;
    border-radius: 4px;
    font-family: var(--font-mono);
    font-size: 0.8125rem;
}

.modal-content input {
    width: 100%;
    padding: 0.875rem 1rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-size: 0.875rem;
}

.btn-primary {
    padding: 0.75rem 1.5rem;
    background: var(--accent);
    border: none;
    border-radius: var(--radius);
    color: white;
    font-weight: 600;
    cursor: pointer;
}

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

.btn-full {
    width: 100%;
}

.btn-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 32px;
    height: 32px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
}

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

/* Utilities */
.hidden {
    display: none !important;
}

/* Responsive */
@media (max-width: 768px) {
    .app-container {
        grid-template-columns: 1fr;
    }
    
    .sidebar {
        display: none;
    }
    
    .features {
        grid-template-columns: 1fr;
    }
}
