/* ===========================
   RSAİ — Premium AI Platform
   Modern Dark Theme
   =========================== */

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

:root {
    /* Dark theme (default) */
    --bg-primary: #0a0a0f;
    --bg-secondary: #13131a;
    --bg-tertiary: #1c1c26;
    --bg-hover: #252531;
    --border: #2a2a37;
    --text-primary: #f0f0f5;
    --text-secondary: #a0a0b0;
    --text-muted: #6a6a7a;
    --accent: #8b5cf6;
    --accent-light: #a78bfa;
    --accent-glow: rgba(139, 92, 246, 0.4);
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --gradient: linear-gradient(135deg, #8b5cf6 0%, #ec4899 100%);
    --gradient-2: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #ec4899 100%);
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    --shadow-glow: 0 0 30px var(--accent-glow);
}

[data-theme="light"] {
    --bg-primary: #f8f9fb;
    --bg-secondary: #ffffff;
    --bg-tertiary: #f1f3f7;
    --bg-hover: #e8eaf0;
    --border: #e0e3eb;
    --text-primary: #1a1a2e;
    --text-secondary: #4a4a5e;
    --text-muted: #8a8a9e;
}

html { scroll-behavior: smooth; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow: hidden;
    height: 100vh;
    -webkit-font-smoothing: antialiased;
}

/* ===== LAYOUT ===== */
.app {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* ===== SIDEBAR ===== */
.sidebar {
    width: 280px;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease;
}

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

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    width: 44px;
    height: 44px;
    background: var(--gradient);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 800;
    color: white;
    box-shadow: var(--shadow-glow);
}

.logo h1 {
    font-size: 20px;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.logo span {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 600;
}

.sidebar-section {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.sidebar-section h3, .chat-details summary {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    margin-bottom: 12px;
    font-weight: 700;
}

.chat-details summary {
    cursor: pointer;
    user-select: none;
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.chat-details summary::-webkit-details-marker {
    display: none;
}

.chat-details summary::after {
    content: '▼';
    font-size: 9px;
    transition: transform 0.2s;
}

.chat-details[open] summary::after {
    transform: rotate(180deg);
}

.chat-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.chat-item {
    padding: 10px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    color: var(--text-secondary);
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 10px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-item:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.chat-item.active {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border-left: 3px solid var(--accent);
    padding-left: 9px;
}

.delete-chat-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    opacity: 0;
    transition: all 0.2s;
}

.chat-item:hover .delete-chat-btn {
    opacity: 1;
}

.delete-chat-btn:hover {
    color: var(--danger);
    background: rgba(239, 68, 68, 0.1);
}

.sidebar-footer {
    padding: 16px;
    border-top: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.sidebar-btn {
    width: 100%;
    padding: 10px 12px;
    border-radius: 8px;
    background: transparent;
    color: var(--text-secondary);
    text-align: left;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 12px;
    font-family: inherit;
}

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

.sidebar-btn .badge {
    margin-left: auto;
    background: var(--accent);
    color: white;
    padding: 2px 8px;
    border-radius: 100px;
    font-size: 11px;
    font-weight: 700;
}

/* ===== MAIN ===== */
.main {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--bg-primary);
    overflow: hidden;
}

.main-header {
    padding: 16px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    background: var(--bg-secondary);
}

.model-selector {
    display: flex;
    align-items: center;
    gap: 10px;
}

.model-selector label {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 600;
}

.model-selector select {
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 8px 14px;
    border-radius: 8px;
    font-family: inherit;
    font-size: 13px;
    cursor: pointer;
    min-width: 220px;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    background: var(--bg-tertiary);
    border-radius: 100px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--success);
    animation: pulse 2s infinite;
}

.status-indicator.busy .status-dot { background: var(--warning); }
.status-indicator.error .status-dot { background: var(--danger); }

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.9); }
}

/* ===== CHAT CONTAINER ===== */
.chat-container {
    flex: 1;
    overflow-y: auto;
    padding: 0;
}

.chat-container::-webkit-scrollbar { width: 8px; }
.chat-container::-webkit-scrollbar-track { background: transparent; }
.chat-container::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
.chat-container::-webkit-scrollbar-thumb:hover { background: var(--bg-hover); }

/* ===== WELCOME SCREEN ===== */
.welcome-screen {
    padding: 60px 40px;
    text-align: center;
    max-width: 900px;
    margin: 0 auto;
}

.welcome-logo {
    width: 80px;
    height: 80px;
    background: var(--gradient-2);
    border-radius: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    color: white;
    margin: 0 auto 24px;
    box-shadow: var(--shadow-glow);
    animation: float 6s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.welcome-screen h1 {
    font-size: 36px;
    font-weight: 800;
    margin-bottom: 12px;
    letter-spacing: -0.02em;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.welcome-screen > p {
    color: var(--text-secondary);
    margin-bottom: 40px;
    font-size: 15px;
}

.capability-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 40px;
}

.capability {
    padding: 24px 18px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 16px;
    text-align: center;
    transition: all 0.3s;
}

.capability:hover {
    transform: translateY(-4px);
    border-color: var(--accent);
    box-shadow: var(--shadow);
}

.capability i {
    font-size: 24px;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 12px;
    display: block;
}

.capability h3 {
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 6px;
}

.capability p {
    font-size: 12px;
    color: var(--text-muted);
}

.example-prompts h3 {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 16px;
    font-weight: 600;
}

.prompt-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.prompt-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px 20px;
    text-align: left;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.prompt-card:hover {
    background: var(--bg-tertiary);
    border-color: var(--accent);
    transform: translateX(4px);
}

.prompt-card i {
    color: var(--accent);
    font-size: 16px;
    flex-shrink: 0;
}

/* ===== MESSAGES ===== */
.messages {
    max-width: 900px;
    margin: 0 auto;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.message {
    display: flex;
    gap: 14px;
    animation: slideUp 0.3s ease;
}

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

.message-avatar {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    flex-shrink: 0;
    font-size: 14px;
}

.message.user .message-avatar {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.message.assistant .message-avatar {
    background: var(--gradient);
    color: white;
}

.message-body {
    flex: 1;
    min-width: 0;
}

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

.message-author {
    font-weight: 600;
    font-size: 14px;
}

.message-meta {
    font-size: 11px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
}

.provider-tag {
    background: var(--bg-tertiary);
    padding: 2px 8px;
    border-radius: 6px;
    font-weight: 600;
    color: var(--accent-light);
}

.message-content {
    color: var(--text-primary);
    font-size: 15px;
    line-height: 1.7;
    word-wrap: break-word;
}

.message-content p { margin-bottom: 12px; }
.message-content p:last-child { margin-bottom: 0; }
.message-content h1, .message-content h2, .message-content h3 {
    margin: 18px 0 10px;
    font-weight: 700;
}
.message-content h1 { font-size: 22px; }
.message-content h2 { font-size: 19px; }
.message-content h3 { font-size: 17px; }
.message-content ul, .message-content ol { margin: 10px 0 12px 24px; }
.message-content li { margin-bottom: 4px; }
.message-content code {
    background: var(--bg-tertiary);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'JetBrains Mono', 'Courier New', monospace;
    font-size: 13px;
    color: #fbb6ce;
}
.message-content pre {
    background: #1a1a24;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 16px;
    overflow-x: auto;
    margin: 12px 0;
    position: relative;
}
.message-content pre code {
    background: none;
    padding: 0;
    color: #e0e0e0;
    font-size: 13px;
}
.message-content blockquote {
    border-left: 3px solid var(--accent);
    padding: 4px 14px;
    margin: 12px 0;
    color: var(--text-secondary);
    font-style: italic;
}
.message-content table {
    border-collapse: collapse;
    margin: 12px 0;
    width: 100%;
}
.message-content th, .message-content td {
    border: 1px solid var(--border);
    padding: 8px 12px;
    text-align: left;
}
.message-content th {
    background: var(--bg-tertiary);
    font-weight: 600;
}
.message-content a {
    color: var(--accent-light);
    text-decoration: underline;
}

.message-actions {
    display: flex;
    gap: 4px;
    margin-top: 8px;
    opacity: 0;
    transition: opacity 0.2s;
}

.message:hover .message-actions { opacity: 1; }

.action-btn {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-muted);
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
    display: flex;
    align-items: center;
    gap: 4px;
}

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

/* Typing indicator */
.typing {
    display: inline-flex;
    gap: 4px;
    align-items: center;
}
.typing span {
    width: 6px;
    height: 6px;
    background: var(--text-muted);
    border-radius: 50%;
    animation: typing 1.4s infinite;
}
.typing span:nth-child(2) { animation-delay: 0.2s; }
.typing span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
    30% { transform: translateY(-6px); opacity: 1; }
}

/* ===== INPUT AREA ===== */
.input-area {
    padding: 16px 24px 20px;
    background: var(--bg-primary);
    border-top: 1px solid var(--border);
}

.chat-form {
    max-width: 900px;
    margin: 0 auto;
}

.input-wrapper {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 12px 14px;
    display: flex;
    gap: 10px;
    align-items: flex-end;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.input-wrapper:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

#messageInput {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 15px;
    resize: none;
    outline: none;
    max-height: 200px;
    line-height: 1.5;
    padding: 6px 4px;
}

#messageInput::placeholder { color: var(--text-muted); }

.input-actions {
    display: flex;
    gap: 6px;
    align-items: center;
}

.send-btn {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: var(--gradient);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    font-size: 14px;
}

.send-btn:hover { transform: scale(1.05); box-shadow: var(--shadow-glow); }
.send-btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.input-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
    padding: 0 4px;
    font-size: 11px;
    color: var(--text-muted);
}

/* ===== ICON BUTTONS ===== */
.icon-btn {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: transparent;
    color: var(--text-secondary);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    font-size: 15px;
}

.icon-btn:hover { background: var(--bg-hover); color: var(--text-primary); }
.icon-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ===== BUTTONS ===== */
.btn {
    padding: 10px 20px;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    font-family: inherit;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background: var(--gradient);
    color: white;
}

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

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

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

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed !important;
    pointer-events: none;
    background: var(--bg-hover) !important;
    color: var(--text-muted) !important;
    border: 1px solid var(--border) !important;
    box-shadow: none !important;
    transform: none !important;
}

/* ===== MODAL ===== */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(8px);
    padding: 20px;
}

.modal.active { display: flex; animation: fadeIn 0.2s ease; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal-content {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 16px;
    max-width: 600px;
    width: 100%;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow);
    animation: slideUp 0.3s ease;
}

.modal-lg { max-width: 900px; }
.modal-xl { max-width: 1200px; width: 95%; }

/* ===== FULLSCREEN MODAL STUDIO ===== */
.modal.modal-fullscreen {
    padding: 0 !important;
    background: var(--bg-primary) !important;
}

.modal.modal-fullscreen .modal-content {
    width: 100vw !important;
    height: 100vh !important;
    max-width: 100vw !important;
    max-height: 100vh !important;
    margin: 0 !important;
    border-radius: 0 !important;
    display: flex;
    flex-direction: column;
    border: none !important;
    box-shadow: none !important;
}

.modal.modal-fullscreen .modal-body {
    flex: 1;
    overflow: hidden !important;
    padding: 0 !important;
    height: calc(100vh - 70px) !important;
    max-height: calc(100vh - 70px) !important;
}

.modal.modal-fullscreen .settings-layout {
    display: flex;
    height: 100%;
    gap: 0;
}

.modal.modal-fullscreen .settings-sidebar {
    width: 260px;
    height: 100%;
    padding: 20px;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border);
    flex-shrink: 0;
}

.modal.modal-fullscreen .settings-content {
    flex: 1;
    height: 100%;
    padding: 30px;
    overflow-y: auto;
    background: var(--bg-primary);
}

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

.modal-header h2 {
    font-size: 18px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-body {
    padding: 20px 24px;
    overflow-y: auto;
    flex: 1;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* ===== PROVIDERS LIST ===== */
.providers-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.stat-card {
    background: var(--bg-tertiary);
    padding: 14px;
    border-radius: 10px;
    text-align: center;
}

.stat-value {
    font-size: 24px;
    font-weight: 800;
    color: var(--accent-light);
    margin-bottom: 4px;
}

.stat-label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}

.providers-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.provider-item {
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px;
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 14px;
    align-items: center;
    transition: all 0.2s;
}

.provider-item:hover { border-color: var(--accent); }

.provider-icon {
    width: 40px;
    height: 40px;
    background: var(--gradient);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 14px;
    text-transform: uppercase;
}

.provider-info h4 {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 4px;
}

.provider-info .meta {
    display: flex;
    gap: 12px;
    font-size: 12px;
    color: var(--text-muted);
}

.provider-status {
    padding: 4px 12px;
    border-radius: 100px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.provider-status.available { background: rgba(16, 185, 129, 0.15); color: var(--success); }
.provider-status.limited { background: rgba(245, 158, 11, 0.15); color: var(--warning); }
.provider-status.exhausted { background: rgba(239, 68, 68, 0.15); color: var(--danger); }
.provider-status.broken { background: rgba(239, 68, 68, 0.25); color: #ff6b6b; border: 1px solid rgba(239, 68, 68, 0.5); }

.provider-progress {
    margin-top: 8px;
    background: var(--bg-primary);
    height: 4px;
    border-radius: 2px;
    overflow: hidden;
}

.provider-progress-bar {
    height: 100%;
    background: var(--gradient);
    transition: width 0.3s;
}

/* ===== SETTINGS ===== */
.setting-group {
    margin-bottom: 24px;
}

.setting-group > label {
    display: block;
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 8px;
}

.setting-group small {
    display: block;
    margin-top: 6px;
    color: var(--text-muted);
    font-size: 12px;
}

.setting-group textarea, .setting-group select, .setting-group input[type="text"] {
    width: 100%;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 10px 14px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 14px;
    resize: vertical;
}

.setting-group textarea:focus, .setting-group select:focus {
    outline: none;
    border-color: var(--accent);
}

/* Toggle switch */
.switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 26px;
}

.switch input { opacity: 0; width: 0; height: 0; }

.slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: var(--bg-tertiary);
    transition: 0.3s;
    border-radius: 100px;
    border: 1px solid var(--border);
}

.slider:before {
    content: '';
    position: absolute;
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background: white;
    transition: 0.3s;
    border-radius: 50%;
}

.switch input:checked + .slider { background: var(--gradient); }
.switch input:checked + .slider:before { transform: translateX(22px); }

/* ===== SETTINGS LAYOUT ===== */
.settings-layout {
    display: flex;
    gap: 20px;
    padding: 0;
}

.settings-sidebar {
    width: 220px;
    flex-shrink: 0;
    border-right: 1px solid var(--border);
    padding: 20px 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.settings-tab {
    background: transparent;
    border: none;
    text-align: left;
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
    display: flex;
    align-items: center;
    gap: 12px;
    border-left: 3px solid transparent;
}

.settings-tab i {
    width: 20px;
    text-align: center;
    font-size: 16px;
}

.settings-tab:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.settings-tab.active {
    background: var(--bg-tertiary);
    color: var(--accent);
    border-left-color: var(--accent);
}

.settings-content {
    flex: 1;
    padding: 20px 24px 20px 0;
    overflow-y: auto;
}

.settings-pane {
    display: none;
    animation: fadeIn 0.3s ease;
}

.settings-pane.active {
    display: block;
}

.settings-pane h3 {
    margin-top: 0;
    margin-bottom: 24px;
    font-size: 18px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 12px;
}

/* Slider Style */
.slider-container {
    display: flex;
    align-items: center;
    gap: 16px;
    background: var(--bg-tertiary);
    padding: 10px 16px;
    border-radius: 10px;
    border: 1px solid var(--border);
}

.slider-container input[type="range"] {
    flex: 1;
    height: 4px;
    background: var(--bg-hover);
    border-radius: 4px;
    outline: none;
    -webkit-appearance: none;
}

.slider-container input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--accent);
    cursor: pointer;
    transition: transform 0.1s;
}

.slider-container input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

#tempValueDisplay {
    font-weight: 700;
    font-size: 14px;
    min-width: 100px;
}

.btn-danger {
    background: var(--danger);
    color: white;
}
.btn-danger:hover {
    background: #dc2626;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

/* Dynamic Classes applied via JS */
.font-small { font-size: 13px !important; }
.font-large { font-size: 17px !important; }
.full-width-chat .messages, .full-width-chat .chat-form { max-width: 100% !important; padding: 24px 40px; }

/* Base Billing Grids */
.billing-stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}
.billing-plans-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}
.topup-methods-flex {
    display: flex;
    gap: 8px;
    margin-bottom: 15px;
}

.api-key-wrapper {
    display: flex;
    gap: 10px;
}

.api-meta-flex {
    margin-top: 15px;
    display: flex;
    gap: 15px;
    font-size: 13px;
    color: var(--text-muted);
}

.api-limits-flex {
    display: flex;
    gap: 15px;
    margin-top: 10px;
}

/* ===== RESPONSIVE ===== */
.mobile-only { display: none; }

@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        z-index: 100;
        transform: translateX(-100%);
    }
    
    .sidebar.open { transform: translateX(0); }
    
    .mobile-only { display: flex; }
    
    .capability-grid, .prompt-grid { grid-template-columns: 1fr 1fr; }
    
    .providers-stats { grid-template-columns: repeat(2, 1fr); }
    
    .welcome-screen { padding: 40px 20px; }
    .welcome-screen h1 { font-size: 28px; }
    
    .messages { padding: 16px; }
    
    .model-selector label { display: none; }
    .model-selector select { min-width: 160px; }

    /* Settings Modal Mobile View */
    .modal {
        padding: 10px;
    }
    
    .modal-content {
        max-height: 92vh;
    }
    
    .settings-layout {
        flex-direction: column;
        gap: 10px;
    }
    
    .settings-sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--border);
        flex-direction: row;
        overflow-x: auto;
        padding: 5px 0;
        gap: 8px;
        scrollbar-width: none; /* Hide scrollbar for Firefox */
    }
    
    .settings-sidebar::-webkit-scrollbar {
        display: none; /* Hide scrollbar for Chrome/Safari */
    }
    
    .settings-tab {
        padding: 8px 16px;
        white-space: nowrap;
        border-left: none;
        border-bottom: 2px solid transparent;
        border-radius: 20px;
        background: var(--bg-tertiary);
        font-size: 13px;
    }
    
    .settings-tab.active {
        background: var(--accent);
        color: white;
        border-bottom-color: transparent;
    }
    
    .settings-content {
        padding: 10px 5px 10px 5px;
    }
    
    .billing-stats-grid {
        grid-template-columns: 1fr;
    }
    
    .billing-plans-grid {
        grid-template-columns: 1fr;
    }
    
    .topup-methods-flex {
        flex-direction: column;
    }

    .api-key-wrapper {
        flex-direction: column;
    }
    
    .api-meta-flex {
        flex-direction: column;
        gap: 8px;
    }
    
    .api-limits-flex {
        flex-direction: column;
        gap: 10px;
    }
}

/* ===== BILLING PLAN CARDS ===== */
.billing-plan-card {
    border: 1px solid var(--border) !important;
    background: var(--bg-primary) !important;
    padding: 15px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
}

.billing-plan-card:hover {
    border-color: var(--accent) !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(106, 17, 203, 0.15);
}

.billing-plan-card.selected {
    border-color: var(--accent) !important;
    background: rgba(106, 17, 203, 0.08) !important;
    box-shadow: 0 0 0 2px var(--accent);
}

/* Currency Selector Toggles */
[id^="btn-curr-"] {
    transition: all 0.2s ease;
    border-radius: 4px;
}
[id^="btn-curr-"]:hover {
    background: var(--bg-hover) !important;
}
[id^="btn-curr-"].active {
    background: var(--accent) !important;
    color: white !important;
}

/* ===== DOCUMENT GENERATION WIDGET ===== */
.gen-doc-widget {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-left: 4px solid var(--accent);
    border-radius: 8px;
    padding: 15px;
    margin: 10px 0;
    transition: transform 0.2s, box-shadow 0.2s;
}

.gen-doc-widget:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

/* ===== QUICK FUNCTION CARDS ===== */
.studio-quick-panel {
    margin-top: 30px;
    width: 100%;
}

.studio-quick-panel h3 {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.quick-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    padding: 16px;
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: left;
    position: relative;
    overflow: hidden;
}

.quick-card:hover {
    transform: translateY(-4px);
    border-color: var(--accent) !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    background: var(--bg-tertiary);
}

.quick-card-icon-wrapper {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    margin-bottom: 12px;
}

.quick-card-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 6px;
    display: block;
}

.quick-card-desc {
    font-size: 12px;
    color: var(--text-muted);
    margin: 0;
    line-height: 1.4;
}

/* ===== RSAİ MUSIC LAB ===== */
.music-lab-layout {
    display: flex;
    gap: 24px;
}

.music-lab-sidebar {
    width: 250px;
    flex-shrink: 0;
    border-right: 1px solid var(--border);
    padding-right: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.music-lab-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.music-lab-pane {
    display: none;
    animation: fadeIn 0.3s ease;
}

.music-lab-pane.active {
    display: block;
}

/* Audio Player */
.custom-audio-player {
    background: rgba(28, 28, 38, 0.6);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px;
    backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 15px;
}

.player-controls {
    display: flex;
    align-items: center;
    gap: 16px;
}

.player-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--gradient);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    box-shadow: var(--shadow-glow);
    transition: all 0.2s;
}

.player-btn:hover {
    transform: scale(1.1);
}

.player-progress-container {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
}

.player-progress-bar {
    flex: 1;
    height: 6px;
    background: var(--bg-hover);
    border-radius: 3px;
    position: relative;
    cursor: pointer;
}

.player-progress-fill {
    height: 100%;
    background: var(--gradient);
    border-radius: 3px;
    width: 0%;
}

.player-time {
    font-size: 12px;
    color: var(--text-muted);
    min-width: 35px;
    font-family: monospace;
}

/* Mic Recording UI */
.mic-recording-card {
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    position: relative;
}

.mic-rec-btn {
    background: var(--bg-primary);
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 12px 24px;
    border-radius: 50px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s;
}

.mic-rec-btn.recording {
    background: var(--danger);
    color: white;
    border-color: var(--danger);
    box-shadow: 0 0 15px rgba(239, 68, 68, 0.4);
    animation: pulse-red 1.5s infinite;
}

@keyframes pulse-red {
    0% { transform: scale(1); }
    50% { transform: scale(1.03); }
    100% { transform: scale(1); }
}

.waveform-simulation {
    display: flex;
    align-items: center;
    gap: 3px;
    height: 30px;
}

.waveform-bar {
    width: 3px;
    height: 100%;
    background: var(--accent);
    border-radius: 3px;
    animation: bounce-wave 0.8s ease-in-out infinite alternate;
    opacity: 0.3;
}

.waveform-simulation.active .waveform-bar {
    opacity: 1;
}

/* Give different delays and durations for a realistic look */
.waveform-bar:nth-child(1) { animation-delay: 0.1s; animation-duration: 0.5s; }
.waveform-bar:nth-child(2) { animation-delay: 0.3s; animation-duration: 0.8s; }
.waveform-bar:nth-child(3) { animation-delay: 0.5s; animation-duration: 0.6s; }
.waveform-bar:nth-child(4) { animation-delay: 0.2s; animation-duration: 0.7s; }
.waveform-bar:nth-child(5) { animation-delay: 0.4s; animation-duration: 0.5s; }
.waveform-bar:nth-child(6) { animation-delay: 0.6s; animation-duration: 0.9s; }
.waveform-bar:nth-child(7) { animation-delay: 0.1s; animation-duration: 0.4s; }
.waveform-bar:nth-child(8) { animation-delay: 0.3s; animation-duration: 0.7s; }

@keyframes bounce-wave {
    from { height: 10%; }
    to { height: 100%; }
}


