/* Oryxen AI - Light Theme Interface */
/* Matches oryxen.ai branding: white, teal, yellow */

:root {
    /* Brand Colors - White/Teal/Yellow */
    --oryxen-teal: #14b8a6;
    --oryxen-teal-dark: #0d9488;
    --oryxen-teal-light: #5eead4;
    --oryxen-yellow: #fbbf24;
    --oryxen-yellow-dark: #f59e0b;
    --oryxen-black: #1a1a1a;
    --oryxen-gray: #6b7280;
    --oryxen-gray-light: #9ca3af;
    --oryxen-gray-bg: #f3f4f6;
    
    /* Light Theme */
    --bg-primary: #ffffff;
    --bg-secondary: #f9fafb;
    --bg-tertiary: #f3f4f6;
    --bg-card: #ffffff;
    --bg-hover: #f3f4f6;
    
    /* Text Colors */
    --text-primary: #111827;
    --text-secondary: #4b5563;
    --text-muted: #9ca3af;
    --text-accent: #14b8a6;
    
    /* Status Colors */
    --error: #ef4444;
    --warning: #f59e0b;
    --success: #22c55e;
    
    /* Borders */
    --border: #e5e7eb;
    --border-hover: #d1d5db;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-glow: 0 0 20px rgba(20, 184, 166, 0.3);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    height: 100vh;
    overflow: hidden;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.container {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

/* Header - Clean White Style */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border);
    position: relative;
    z-index: 100;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo-img {
    height: 36px;
    width: auto;
}

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

/* Buttons - Teal/Yellow Style */
.btn {
    padding: 0.625rem 1.25rem;
    border: none;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-primary {
    background: var(--oryxen-teal);
    color: white;
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
    background: var(--oryxen-teal-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow-glow);
}

.btn-secondary {
    background: white;
    color: var(--text-primary);
    border: 1px solid var(--border);
}

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

.btn-small {
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
}

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

/* Screen Management */
.screen {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.hidden {
    display: none !important;
}

/* Auth Screen - Clean Card Design */
.auth-container {
    max-width: 480px;
    margin: auto;
    padding: 2rem;
    text-align: center;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
}

.auth-container h2 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.auth-description {
    color: var(--text-secondary);
    margin-bottom: 2rem;
    font-size: 0.95rem;
}

/* Tabs - Clean Style */
.auth-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 2rem;
    justify-content: center;
    background: var(--bg-secondary);
    padding: 0.25rem;
    border-radius: 12px;
}

.tab-btn {
    padding: 0.625rem 1.25rem;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.875rem;
    transition: all 0.2s ease;
    flex: 1;
}

.tab-btn:hover {
    color: var(--text-primary);
    background: rgba(20, 184, 166, 0.1);
}

.tab-btn.active {
    background: var(--bg-card);
    color: var(--oryxen-teal);
    box-shadow: var(--shadow-sm);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Input Fields */
.key-input-group {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.key-input-group input,
.key-input-group textarea {
    flex: 1;
    padding: 0.875rem 1rem;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 0.95rem;
    font-family: 'Monaco', 'Menlo', monospace;
    transition: all 0.2s ease;
}

.key-input-group input:focus,
.key-input-group textarea:focus {
    outline: none;
    border-color: var(--oryxen-teal);
    box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.1);
}

.key-input-group textarea {
    resize: none;
    min-height: 80px;
}

.hint {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-top: 0.5rem;
}

/* Generate/Recover Sections */
.generate-section,
.recover-section {
    padding: 1.5rem;
    background: var(--bg-secondary);
    border-radius: 12px;
    border: 1px solid var(--border);
}

.generate-section p,
.recover-section p {
    color: var(--text-secondary);
    margin-bottom: 1.25rem;
    font-size: 0.95rem;
}

.generated-keys {
    padding: 1.5rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    text-align: left;
    margin-top: 1rem;
}

.key-display {
    margin-bottom: 1.5rem;
}

.key-display:last-child {
    margin-bottom: 0;
}

.key-display label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}

.key-display input,
.key-display textarea {
    width: 100%;
    padding: 0.875rem;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-primary);
    font-family: 'Monaco', 'Menlo', monospace;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    transition: all 0.2s ease;
}

.key-display input:focus,
.key-display textarea:focus {
    outline: none;
    border-color: var(--oryxen-teal);
}

.key-display textarea {
    resize: none;
    min-height: 60px;
}

/* Chat Layout */
.chat-layout {
    display: flex;
    flex: 1;
    overflow: hidden;
    gap: 1rem;
    padding: 1rem;
}

.sidebar {
    width: 280px;
    padding: 1.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
}

.model-section label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}

#model-select {
    width: 100%;
    padding: 0.75rem;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

#model-select:focus {
    outline: none;
    border-color: var(--oryxen-teal);
}

.model-info {
    margin-top: 1rem;
    padding: 1rem;
    background: var(--bg-secondary);
    border-radius: 8px;
}

.cost-info {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.cost-info span span {
    color: var(--oryxen-teal);
    font-weight: 600;
}

.api-info {
    margin-top: auto;
    padding: 1rem;
    background: var(--bg-secondary);
    border-radius: 8px;
    font-size: 0.75rem;
}

.api-info p {
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}

.api-info code {
    display: block;
    color: var(--oryxen-teal);
    font-family: 'Monaco', 'Menlo', monospace;
    word-break: break-all;
}

/* Chat Container */
.chat-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
}

.messages {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.message {
    max-width: 85%;
    padding: 1rem 1.25rem;
    border-radius: 12px;
    line-height: 1.6;
    font-size: 0.95rem;
    animation: fadeIn 0.3s ease-out;
}

.message.user {
    align-self: flex-end;
    background: var(--oryxen-teal);
    color: white;
    border-bottom-right-radius: 4px;
}

.message.assistant {
    align-self: flex-start;
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border);
    border-bottom-left-radius: 4px;
}

.message.system {
    align-self: center;
    background: rgba(239, 68, 68, 0.05);
    color: var(--error);
    font-size: 0.9rem;
    padding: 0.75rem 1rem;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

/* Input Area */
.input-container {
    display: flex;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
}

#message-input {
    flex: 1;
    padding: 0.875rem 1rem;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 0.95rem;
    resize: none;
    font-family: inherit;
    min-height: 48px;
    max-height: 120px;
    transition: all 0.2s ease;
}

#message-input:focus {
    outline: none;
    border-color: var(--oryxen-teal);
    box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.1);
}

#send-btn {
    width: 48px;
    height: 48px;
    background: var(--oryxen-teal);
    color: white;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-sm);
}

#send-btn:hover:not(:disabled) {
    background: var(--oryxen-teal-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow-glow);
}

#send-btn:disabled {
    background: var(--bg-primary);
    color: var(--text-muted);
    cursor: not-allowed;
    box-shadow: none;
}

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

/* Animations */
@keyframes fadeIn {
    from { 
        opacity: 0; 
        transform: translateY(10px); 
    }
    to { 
        opacity: 1; 
        transform: translateY(0); 
    }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.loading-dots::after {
    content: '...';
    animation: pulse 1.5s infinite;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* Responsive */
@media (max-width: 768px) {
    header {
        padding: 1rem;
    }
    
    .logo-img {
        height: 28px;
    }
    
    .chat-layout {
        flex-direction: column;
        padding: 0.75rem;
    }
    
    .sidebar {
        width: 100%;
        padding: 1rem;
    }
    
    .auth-container {
        margin: 1rem;
        padding: 1.5rem;
    }
    
    .message {
        max-width: 95%;
    }
    
    .key-input-group {
        flex-direction: column;
    }
}

/* Credit Display */
.credit-display {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: rgba(20, 184, 166, 0.1);
    border: 1px solid rgba(20, 184, 166, 0.2);
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--oryxen-teal);
}

.credit-icon {
    font-size: 1rem;
}
