/* ==========================================================================
   Ai-gerim — Premium Minimalist Design System (One-to-One Reference Implementation)
   ========================================================================== */

:root {
    --primary: #4f46e5;
    --primary-light: #6366f1;
    --primary-bg: rgba(79, 70, 229, 0.05);
    
    --bg-main: #f8fafc;
    --bg-sidebar: #ffffff;
    --border-color: #e2e8f0;
    
    --text-main: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    
    --card-shadow: 0 1px 3px rgba(0,0,0,0.02), 0 1px 2px rgba(0,0,0,0.01);
    --input-shadow: 0 10px 30px rgba(0,0,0,0.04);
    --sidebar-width: 260px;
    --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

body.dark-theme {
    --bg-main: #0f172a;
    --bg-sidebar: #1e293b;
    --border-color: #334155;
    
    --text-main: #f8fafc;
    --text-secondary: #cbd5e1;
    --text-muted: #64748b;
    
    --primary-bg: rgba(99, 102, 241, 0.15);
    --card-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

/* Base Reset */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 15px;
}

body {
    background: var(--bg-main);
    color: var(--text-main);
    height: 100vh;
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
}

button, input, textarea, select {
    font-family: inherit;
    outline: none;
}

/* Screens */
.screen {
    display: none;
    width: 100%;
    height: 100vh;
}
.screen.active {
    display: flex;
}

/* ==========================================================================
   AUTH SCREEN
   ========================================================================== */
#auth-screen {
    justify-content: center;
    align-items: center;
    background: #f8fafc;
    position: relative;
    overflow: hidden;
}

.auth-bg-interactive {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background: radial-gradient(circle at center, #ffffff 0%, #f1f5f9 100%);
}

.glow-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.2;
}

.orb-1 { width: 500px; height: 500px; background: #4f46e5; top: -100px; left: -100px; }
.orb-2 { width: 450px; height: 450px; background: #9333ea; bottom: -50px; right: -50px; }
.orb-3 { width: 350px; height: 350px; background: #3b82f6; top: 40%; left: 40%; }

.auth-center-container {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 440px;
    padding: 20px;
}

.auth-glass-card {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.9);
    border-radius: 24px;
    padding: 40px 32px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.05);
}

.auth-card-header {
    text-align: center;
    margin-bottom: 28px;
}

.brand-logo-small {
    margin-bottom: 16px;
    display: flex;
    justify-content: center;
}

.brand-name-small {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--text-main);
    letter-spacing: -0.5px;
    margin-bottom: 4px;
}

.brand-subtitle {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.auth-form {
    display: none;
}
.auth-form.active {
    display: block;
}

.auth-form-header {
    margin-bottom: 24px;
    text-align: center;
}

.auth-form-header h2 {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 4px;
}

.auth-form-header p {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-secondary);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-group input, .form-select {
    width: 100%;
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 11px 14px;
    font-size: 0.9rem;
    color: var(--text-main);
    font-weight: 500;
    transition: var(--transition);
}

.form-group input:focus, .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.input-password {
    position: relative;
}

.toggle-pw {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.9rem;
    opacity: 0.4;
}

.btn-submit {
    width: 100%;
    padding: 12px;
    background: var(--text-main);
    color: #ffffff;
    border: none;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    margin-top: 8px;
}

.btn-submit:hover {
    background: #1e293b;
    transform: translateY(-1px);
}

.auth-switch {
    text-align: center;
    margin-top: 20px;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.auth-switch a {
    color: var(--primary);
    font-weight: 700;
    text-decoration: none;
}

.auth-switch a:hover {
    text-decoration: underline;
}

.error-msg {
    background: #fff1f2;
    color: #e11d48;
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-top: 12px;
    text-align: center;
    border: 1px solid #ffe4e6;
}

/* ==========================================================================
   SIDEBAR (Modern, Clean)
   ========================================================================== */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    flex-shrink: 0;
    overflow: hidden;
}

.sidebar-top {
    flex: 1;
    overflow-y: auto;
    padding: 24px 20px;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.sidebar-top::-webkit-scrollbar {
    width: 4px;
}
.sidebar-top::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 2px;
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-bottom: 20px;
    margin-bottom: 16px;
}

.sidebar-brand {
    font-weight: 800;
    font-size: 1.15rem;
    color: var(--text-main);
    letter-spacing: -0.5px;
}

/* Search Bar Styled New Chat */
.new-chat-search {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg-main);
    border: 1px solid var(--border-color);
    padding: 10px 14px;
    border-radius: 12px;
    cursor: pointer;
    transition: var(--transition);
    margin-bottom: 24px;
    color: var(--text-secondary);
}

.new-chat-search:hover {
    border-color: var(--text-muted);
}

.new-chat-search span {
    flex: 1;
    font-size: 0.85rem;
    font-weight: 600;
}

.new-chat-search .search-icon {
    width: 16px;
    height: 16px;
    color: var(--text-muted);
}

.new-chat-search .plus-icon {
    width: 16px;
    height: 16px;
    color: var(--text-secondary);
}

/* Sidebar Nav */
.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 24px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    background: transparent;
    border: none;
    border-radius: 10px;
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    transition: var(--transition);
    text-align: left;
    width: 100%;
}

.nav-item svg {
    width: 18px;
    height: 18px;
    opacity: 0.7;
    color: var(--text-secondary);
}

.nav-item:hover {
    background: var(--bg-main);
    color: var(--text-main);
}

.nav-item.active {
    background: var(--primary-bg);
    color: var(--primary);
}

.nav-item.active svg {
    opacity: 1;
    color: var(--primary);
}

/* Pro Upgrade Card */
.pro-upgrade-card {
    background: #f5f3ff;
    border: 1px solid #ddd6fe;
    border-radius: 16px;
    padding: 18px 16px;
    margin-top: auto;
    margin-bottom: 12px;
}

body.dark-theme .pro-upgrade-card {
    background: rgba(99, 102, 241, 0.1);
    border-color: rgba(99, 102, 241, 0.2);
}

.pro-upgrade-card h4 {
    font-size: 0.85rem;
    font-weight: 700;
    color: #4c1d95;
    margin-bottom: 4px;
}

body.dark-theme .pro-upgrade-card h4 {
    color: #cbd5e1;
}

.pro-upgrade-card p {
    font-size: 0.75rem;
    color: #6d28d9;
    line-height: 1.4;
    margin-bottom: 14px;
}

body.dark-theme .pro-upgrade-card p {
    color: #94a3b8;
}

.btn-pro-action {
    display: flex;
    align-items: center;
    gap: 4px;
    background: #ffffff;
    border: 1px solid #ddd6fe;
    border-radius: 8px;
    padding: 6px 12px;
    font-size: 0.75rem;
    font-weight: 700;
    color: #4c1d95;
    cursor: pointer;
    transition: var(--transition);
}

.btn-pro-action:hover {
    background: #f5f3ff;
    transform: translateX(1px);
}

/* Sidebar Profile Footer */
.sidebar-bottom {
    padding: 16px 20px;
    border-top: 1px solid var(--border-color);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    padding: 6px;
    border-radius: 10px;
    transition: var(--transition);
}

.user-info:hover {
    background: var(--bg-main);
}

.user-avatar {
    width: 36px;
    height: 36px;
    background: #e2e8f0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--text-main);
    flex-shrink: 0;
}

.user-details {
    flex: 1;
    min-width: 0;
}

.user-name {
    font-weight: 700;
    font-size: 0.825rem;
    color: var(--text-main);
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-email {
    font-size: 0.72rem;
    color: var(--text-muted);
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-caret {
    color: var(--text-muted);
    flex-shrink: 0;
}

/* ==========================================================================
   APP MAIN & HEADER
   ========================================================================== */
.app-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--bg-main);
    min-height: 0;
}

.app-header {
    height: 64px;
    padding: 0 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-main);
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}

.header-dropdown-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    background: transparent;
    border: none;
    color: var(--text-main);
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    padding: 6px 12px;
    border-radius: 8px;
    transition: var(--transition);
}

.header-dropdown-btn:hover {
    background: var(--border-color);
}

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

.btn-icon {
    width: 36px;
    height: 36px;
    background: transparent;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    color: var(--text-secondary);
}

.btn-icon:hover {
    background: var(--border-color);
    color: var(--text-main);
}

.header-avatar {
    width: 32px;
    height: 32px;
    background: #e2e8f0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.8rem;
    color: var(--text-main);
}

/* ==========================================================================
   CHAT CONTENT & WELCOME SCREEN
   ========================================================================== */
.chat-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    min-height: 0;
    scroll-behavior: smooth;
}

.chat-content::-webkit-scrollbar {
    width: 6px;
}
.chat-content::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

/* Greeting Section */
.greeting-section {
    width: 100%;
    max-width: 760px;
    margin: auto auto; /* Centered in workspace */
    padding: 40px 24px;
    text-align: center;
}

.welcome-heading {
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--text-main);
    letter-spacing: -1px;
    margin-bottom: 8px;
}

.greeting-subtitle {
    font-size: 1.05rem;
    color: var(--text-secondary);
    font-weight: 500;
    margin-bottom: 40px;
}

/* 4 Recommendation Cards Grid */
.quick-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 40px;
    text-align: left;
}

.q-card {
    background: var(--bg-sidebar);
    border: 1px solid var(--border-color);
    padding: 20px;
    border-radius: 16px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    gap: 14px;
    box-shadow: var(--card-shadow);
}

.q-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(0,0,0,0.03);
    border-color: var(--text-muted);
}

.q-card-icon-container {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cap-green { background: #ecfdf5; }
.file-purple { background: #f5f3ff; }
.bulb-blue { background: #eff6ff; }
.code-orange { background: #fff7ed; }

.q-card-content h4 {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-main);
    line-height: 1.35;
    margin-bottom: 4px;
}

.q-card-content p {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* Welcome Recent Chats */
.recent-chats-welcome-section {
    text-align: left;
    margin-top: 20px;
    border-top: 1px solid var(--border-color);
    padding-top: 30px;
}

.recent-chats-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.recent-chats-header h3 {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-main);
}

.btn-see-all {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: var(--transition);
}

.btn-see-all:hover {
    color: var(--primary);
}

.recent-chats-welcome-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.recent-chat-row {
    background: var(--bg-sidebar);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 14px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--card-shadow);
}

.recent-chat-row:hover {
    border-color: var(--text-muted);
}

.recent-chat-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-main);
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-right: 16px;
}

.recent-chat-date {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-right: 16px;
}

.recent-chat-more {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.1rem;
    cursor: pointer;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 6px;
}

.recent-chat-more:hover {
    color: #ef4444;
    background: #fef2f2;
}

.empty-recent {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-style: italic;
}

/* ==========================================================================
   CHAT MESSAGES & BUBBLES
   ========================================================================== */
.chat-messages {
    flex: 1;
    padding: 30px 40px;
    display: flex;
    flex-direction: column;
    gap: 24px;
    max-width: 800px;
    margin: 0 auto;
    width: 100%;
}

.message {
    display: flex;
    gap: 16px;
    max-width: 85%;
    animation: fadeUp 0.3s ease;
}

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

.message.user-message {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.message.assistant-message {
    align-self: flex-start;
}

.message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.8rem;
    color: var(--text-main);
    flex-shrink: 0;
}

.message-content {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.message-text {
    padding: 14px 20px;
    border-radius: 18px;
    font-size: 0.92rem;
    line-height: 1.6;
}

.message-text h1, .message-text h2, .message-text h3, .message-text h4 {
    color: var(--text-main);
    font-weight: 800;
    margin-top: 18px;
    margin-bottom: 8px;
    letter-spacing: -0.3px;
    line-height: 1.35;
}

.message-text h1 { font-size: 1.3rem; }
.message-text h2 { font-size: 1.15rem; }
.message-text h3 { font-size: 1.05rem; }
.message-text h4 { font-size: 0.95rem; }

.message-text p {
    margin-bottom: 12px;
}
.message-text p:last-child {
    margin-bottom: 0;
}

.message-text ul, .message-text ol {
    margin-left: 20px;
    margin-bottom: 14px;
}

.message-text li {
    margin-bottom: 6px;
    line-height: 1.55;
}

.message-text strong, .message-text b {
    font-weight: 700;
    color: var(--text-main);
}

.user-message .message-text strong, .user-message .message-text b {
    color: #ffffff;
}

.user-message .message-text {
    background: var(--text-main);
    color: #ffffff;
    border-top-right-radius: 4px;
}

.assistant-message .message-text {
    background: var(--bg-sidebar);
    color: var(--text-main);
    border-top-left-radius: 4px;
    border: 1px solid var(--border-color);
    box-shadow: var(--card-shadow);
}

.message-text p {
    margin-bottom: 8px;
}
.message-text p:last-child {
    margin-bottom: 0;
}

.message-actions {
    display: flex;
    gap: 8px;
    margin-top: 4px;
}

.btn-action {
    display: flex;
    align-items: center;
    gap: 4px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 0.72rem;
    font-weight: 600;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    transition: var(--transition);
}

.btn-action:hover {
    color: var(--text-main);
    background: var(--border-color);
}

/* Typing Indicator */
.typing-indicator {
    display: flex;
    gap: 4px;
    align-items: center;
    padding: 4px 0;
}

.typing-indicator span {
    width: 6px;
    height: 6px;
    background: var(--text-muted);
    border-radius: 50%;
    animation: typing 1s infinite alternate;
}

.typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing {
    0% { transform: translateY(0); }
    100% { transform: translateY(-4px); }
}

/* ==========================================================================
   INPUT AREA (Floating Minimal)
   ========================================================================== */
.input-area-wrapper {
    width: 100%;
    max-width: 760px;
    margin: 0 auto;
    padding: 12px 24px 24px;
    flex-shrink: 0;
    background: var(--bg-main);
}

.enhanced-input-container {
    background: var(--bg-sidebar);
    border-radius: 20px;
    border: 1px solid var(--border-color);
    padding: 14px 18px 10px;
    box-shadow: var(--input-shadow);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.enhanced-input-container:focus-within {
    border-color: var(--text-muted);
}

.input-row {
    width: 100%;
}

#chat-input {
    width: 100%;
    border: none;
    background: transparent;
    color: var(--text-main);
    font-size: 0.95rem;
    resize: none;
    min-height: 24px;
    max-height: 120px;
    line-height: 1.45;
}

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

/* Input Row Actions (Pills and Action buttons inside) */
.input-row-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 4px;
}

.input-actions-left, .input-actions-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-action-minimal {
    width: 32px;
    height: 32px;
    background: transparent;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    transition: var(--transition);
}

.btn-action-minimal:hover {
    background: var(--bg-main);
    color: var(--text-main);
}

.btn-pill-tools {
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--bg-main);
    border: 1px solid var(--border-color);
    border-radius: 30px;
    padding: 6px 12px;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
}

.btn-pill-tools:hover {
    border-color: var(--text-muted);
}

#voice-lang-select {
    background: transparent;
    border: none;
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 700;
    cursor: pointer;
    margin-right: 4px;
}

.btn-send-black {
    width: 34px;
    height: 34px;
    background: var(--text-main);
    color: #ffffff;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.btn-send-black:hover {
    opacity: 0.9;
    transform: scale(1.02);
}

/* File previews inside input container */
.file-preview-container {
    display: flex;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
}

.file-preview-chip {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-main);
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.btn-remove-file {
    background: transparent;
    border: none;
    cursor: pointer;
    display: flex;
    color: var(--text-muted);
}

.btn-remove-file:hover {
    color: #ef4444;
}

/* ==========================================================================
   MODAL WINDOWS
   ========================================================================== */
.modal {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.3);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.modal-content {
    position: relative;
    z-index: 1;
    background: var(--bg-sidebar);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    max-height: 90vh;
    overflow-y: auto;
}

.modal-medium { width: 480px; }
.modal-small { width: 340px; }
.modal-large { width: 680px; }

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.modal-header h2 {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--text-main);
}

.modal-close {
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    display: flex;
}

.modal-close:hover {
    color: var(--text-main);
}

.modal-footer {
    margin-top: 24px;
    display: flex;
    justify-content: flex-end;
}

.form-row {
    display: flex;
    gap: 16px;
}

.form-row .form-group {
    flex: 1;
}

/* Live Call Styling */
.modal-live {
    width: 320px;
    text-align: center;
    background: #0f172a;
    border-color: #1e293b;
    color: #ffffff;
}

.live-orb-container {
    position: relative;
    width: 140px;
    height: 140px;
    margin: 40px auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

.live-ai-orb {
    width: 80px;
    height: 80px;
    background: radial-gradient(circle, #6366f1 0%, #a855f7 100%);
    border-radius: 50%;
    z-index: 2;
    box-shadow: 0 0 30px rgba(99, 102, 241, 0.5);
    animation: orbPulse 3s infinite alternate;
}

@keyframes orbPulse {
    0% { transform: scale(1); }
    100% { transform: scale(1.15); }
}

.live-rings .ring {
    position: absolute;
    border: 2px solid rgba(99, 102, 241, 0.2);
    border-radius: 50%;
    width: 140px;
    height: 140px;
    animation: ripple 2s infinite linear;
}

.live-rings .r2 { animation-delay: 0.6s; }
.live-rings .r3 { animation-delay: 1.2s; }

@keyframes ripple {
    0% { transform: scale(0.6); opacity: 1; }
    100% { transform: scale(1.4); opacity: 0; }
}

.live-status-text {
    font-size: 0.9rem;
    color: #94a3b8;
    margin-bottom: 30px;
}

.btn-end-call {
    width: 100%;
    padding: 12px;
    background: #ef4444;
    color: #ffffff;
    border: none;
    border-radius: 10px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
}

.btn-end-call:hover {
    background: #dc2626;
}

/* ==========================================================================
   MOBILE ADAPTIVITY & OVERLAY SYSTEM
   ========================================================================== */

@media (max-width: 768px) {
    .mobile-only {
        display: flex !important;
    }

    .screen {
        flex-direction: column;
    }

    /* Off-canvas menu navigation */
    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        width: 280px;
        height: 100vh;
        z-index: 9999;
        transform: translateX(-100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: 20px 0 30px rgba(0, 0, 0, 0.1);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    /* Blur Backdrop when open */
    #chat-screen::before {
        content: '';
        position: fixed;
        inset: 0;
        background: rgba(15, 23, 42, 0.15);
        backdrop-filter: blur(4px);
        -webkit-backdrop-filter: blur(4px);
        z-index: 9998;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.3s ease;
    }

    #chat-screen:has(.sidebar.open)::before {
        opacity: 1;
        pointer-events: auto;
    }

    /* Close Button Inside Sidebar Logo */
    .sidebar-close-btn {
        background: transparent !important;
        border: none !important;
        color: var(--text-secondary) !important;
        cursor: pointer;
        padding: 4px;
        border-radius: 8px;
        display: flex !important;
        align-items: center;
        justify-content: center;
    }

    /* Main Workspace margins */
    .app-main {
        width: 100%;
        height: 100vh;
    }

    .app-header {
        height: 60px;
        padding: 0 16px;
    }

    /* Centered Text Sizing */
    .greeting-section {
        padding: 30px 16px;
    }

    .welcome-heading {
        font-size: 1.8rem;
    }

    .greeting-subtitle {
        font-size: 0.95rem;
        margin-bottom: 30px;
    }

    /* Cards stack to 1 column */
    .quick-cards {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    /* Input area adjustments */
    .input-area-wrapper {
        padding: 10px 14px 16px;
    }

    .enhanced-input-container {
        border-radius: 18px;
    }

    /* Modal boxes */
    .modal-content {
        width: 94% !important;
        padding: 24px 18px !important;
    }

    .form-row {
        flex-direction: column;
        gap: 0;
    }
}
