/* ==========================================================================
   BIA COLLEGE AI - MODERN CHATGPT STYLING
   ========================================================================== */

:root {
    /* Color Palette - Dark Theme Default */
    --bg-primary: #121820;
    --bg-secondary: #1a222d;
    --bg-tertiary: #232d3b;
    --bg-input: #1f2834;
    --border-color: #2e3a4b;
    --border-light: rgba(255, 255, 255, 0.08);

    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;

    /* Brand Accent - Islamic Academic Emerald & Gold */
    --accent-emerald: #10b981;
    --accent-emerald-hover: #059669;
    --accent-gold: #f59e0b;
    --accent-blue: #3b82f6;
    --danger-color: #ef4444;

    /* Message Bubbles */
    --msg-user-bg: #1e3a33;
    --msg-user-text: #ecfdf5;
    --msg-bot-bg: #1c2531;
    --msg-bot-border: #2a3749;

    /* Layout & Spacing */
    --sidebar-width: 280px;
    --topbar-height: 64px;
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.25);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.35);

    /* Fonts (Self-contained system fonts - No CDNs required) */
    --font-main: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-arabic: "Amiri", "Traditional Arabic", "Segoe UI", "Tahoma", sans-serif;
    --font-tamil: "Nirmala UI", "Latha", "Vijaya", sans-serif;
    --font-sinhala: "Iskoola Pota", "Nirmala UI", sans-serif;
    --font-code: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier, monospace;
}

[data-theme="light"] {
    --bg-primary: #f8fafc;
    --bg-secondary: #ffffff;
    --bg-tertiary: #f1f5f9;
    --bg-input: #ffffff;
    --border-color: #e2e8f0;
    --border-light: rgba(0, 0, 0, 0.06);

    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;

    --msg-user-bg: #e6f4ea;
    --msg-user-text: #064e3b;
    --msg-bot-bg: #ffffff;
    --msg-bot-border: #e2e8f0;
}

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

html, body {
    height: 100%;
    width: 100%;
    font-family: var(--font-main);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    overflow: hidden;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* Arabic, Tamil & Sinhala script font optimization */
[lang="ar"], .arabic-text, [dir="rtl"] {
    font-family: var(--font-arabic);
    line-height: 1.9;
    letter-spacing: 0.01em;
}

/* APP LAYOUT */
.app-layout {
    display: flex;
    height: 100vh;
    width: 100vw;
    overflow: hidden;
    position: relative;
}

/* SIDEBAR */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    z-index: 100;
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

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

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

.brand-icon {
    width: 38px;
    height: 38px;
    background: linear-gradient(135deg, #10b981 0%, #047857 100%);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.brand-icon svg {
    width: 22px;
    height: 22px;
}

.brand-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
    display: block;
    line-height: 1.2;
}

.brand-sub {
    font-size: 0.75rem;
    color: var(--accent-emerald);
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.new-chat-btn {
    margin: 14px 16px 8px 16px;
    padding: 11px 16px;
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.new-chat-btn:hover {
    background-color: var(--accent-emerald);
    color: #ffffff;
    border-color: var(--accent-emerald);
    transform: translateY(-1px);
}

.new-chat-btn svg {
    width: 18px;
    height: 18px;
}

.sidebar-section {
    padding: 12px 16px 6px 16px;
}

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

.section-title {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 700;
    color: var(--text-muted);
}

.clear-history-text-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 0.75rem;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    transition: color 0.2s ease;
}

.clear-history-text-btn:hover {
    color: var(--danger-color);
}

.quick-tags {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.tag-btn {
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-secondary);
    font-size: 0.82rem;
    padding: 7px 10px;
    border-radius: var(--radius-sm);
    text-align: left;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

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

.tag-icon {
    font-size: 0.95rem;
    flex-shrink: 0;
}

/* Chat History List */
.chat-history-section {
    flex: 1;
    overflow-y: auto;
    padding-bottom: 12px;
}

.chat-history-section::-webkit-scrollbar {
    width: 4px;
}

.chat-history-section::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

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

.chat-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 10px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.84rem;
    cursor: pointer;
    transition: all 0.15s ease;
    border: 1px solid transparent;
}

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

.chat-item.active {
    border-color: var(--accent-emerald);
}

.chat-item-title {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
}

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

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

.chat-delete-btn:hover {
    color: var(--danger-color);
}

.sidebar-footer {
    padding: 12px 16px;
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.78rem;
    color: var(--text-muted);
}

.privacy-note {
    display: flex;
    align-items: center;
    gap: 6px;
}

.privacy-note svg {
    width: 14px;
    height: 14px;
    color: var(--accent-emerald);
}

/* MAIN CONTENT */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100vh;
    background-color: var(--bg-primary);
    position: relative;
    overflow: hidden;
}

/* TOPBAR */
.topbar {
    height: var(--topbar-height);
    border-bottom: 1px solid var(--border-color);
    background-color: var(--bg-secondary);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    z-index: 50;
    gap: 16px;
}

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

.active-chat-title {
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 280px;
}

/* USAGE METER WIDGET */
.usage-meter-widget {
    flex: 1;
    max-width: 440px;
    background-color: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 7px 14px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.usage-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.75rem;
}

.usage-badge {
    background-color: rgba(16, 185, 129, 0.15);
    color: var(--accent-emerald);
    padding: 2px 7px;
    border-radius: 4px;
    font-weight: 700;
    font-size: 0.68rem;
    letter-spacing: 0.04em;
}

.usage-text {
    color: var(--text-secondary);
    font-weight: 500;
}

.usage-progress-container {
    width: 100%;
    height: 6px;
    background-color: var(--bg-secondary);
    border-radius: 10px;
    overflow: hidden;
}

.usage-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #10b981 0%, #f59e0b 80%, #ef4444 100%);
    border-radius: 10px;
    transition: width 0.4s ease;
}

.usage-reset-countdown {
    font-size: 0.68rem;
    color: var(--text-muted);
    text-align: right;
}

.usage-reset-countdown strong {
    color: var(--text-secondary);
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Icon Buttons */
.icon-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

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

.icon-btn svg {
    width: 19px;
    height: 19px;
}

.mobile-menu-btn, .mobile-close-btn {
    display: none;
}

/* Theme Toggle Icons */
[data-theme="dark"] .sun-icon { display: block; }
[data-theme="dark"] .moon-icon { display: none; }
[data-theme="light"] .sun-icon { display: none; }
[data-theme="light"] .moon-icon { display: block; }

/* MESSAGES SCROLL CONTAINER */
.messages-container {
    flex: 1;
    overflow-y: auto;
    padding: 24px 20px;
    display: flex;
    flex-direction: column;
}

.messages-container::-webkit-scrollbar {
    width: 6px;
}

.messages-container::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 6px;
}

/* WELCOME SCREEN */
.welcome-screen {
    max-width: 760px;
    margin: auto;
    text-align: center;
    padding: 20px 10px;
}

.welcome-emblem {
    width: 68px;
    height: 68px;
    background: linear-gradient(135deg, #10b981 0%, #047857 100%);
    border-radius: var(--radius-lg);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    margin-bottom: 16px;
    box-shadow: 0 4px 18px rgba(16, 185, 129, 0.35);
}

.welcome-emblem svg {
    width: 38px;
    height: 38px;
}

.welcome-heading {
    font-size: 1.85rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.welcome-greeting-ar {
    font-size: 1.25rem;
    font-family: var(--font-arabic);
    color: var(--accent-emerald);
    margin-bottom: 12px;
}

.welcome-desc {
    color: var(--text-secondary);
    font-size: 0.95rem;
    max-width: 620px;
    margin: 0 auto 20px auto;
}

.language-chips {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin-bottom: 30px;
}

.chip {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

.sample-cards-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
    text-align: left;
}

.sample-card {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.sample-card:hover {
    border-color: var(--accent-emerald);
    background-color: var(--bg-tertiary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.card-icon {
    font-size: 1.3rem;
    margin-bottom: 6px;
}

.card-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.card-desc {
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

/* CHAT MESSAGES LIST */
.messages-list {
    max-width: 820px;
    width: 100%;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.message-row {
    display: flex;
    gap: 14px;
    width: 100%;
}

.message-avatar {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    flex-shrink: 0;
    margin-top: 2px;
}

.user-avatar {
    background-color: var(--accent-emerald);
    color: #ffffff;
    font-weight: 700;
}

.bot-avatar {
    background: linear-gradient(135deg, #047857 0%, #10b981 100%);
    color: #ffffff;
}

.message-content-wrapper {
    flex: 1;
    overflow-x: auto;
}

.message-sender {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text-muted);
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.message-bubble {
    padding: 14px 18px;
    border-radius: var(--radius-md);
    font-size: 0.94rem;
    line-height: 1.7;
    position: relative;
    word-break: break-word;
}

.user-row .message-bubble {
    background-color: var(--msg-user-bg);
    color: var(--msg-user-text);
    border: 1px solid rgba(16, 185, 129, 0.25);
}

.bot-row .message-bubble {
    background-color: var(--msg-bot-bg);
    color: var(--text-primary);
    border: 1px solid var(--msg-bot-border);
}

/* RTL Auto direction styling */
.message-bubble[dir="rtl"], .rtl-text {
    direction: rtl;
    text-align: right;
    font-family: var(--font-arabic);
}

/* Markdown Formatted Elements */
.message-bubble p {
    margin-bottom: 12px;
}

.message-bubble p:last-child {
    margin-bottom: 0;
}

.message-bubble h1, .message-bubble h2, .message-bubble h3 {
    margin: 14px 0 8px 0;
    color: var(--text-primary);
    font-weight: 700;
}

.message-bubble h1 { font-size: 1.25rem; }
.message-bubble h2 { font-size: 1.15rem; }
.message-bubble h3 { font-size: 1.05rem; }

.message-bubble ul, .message-bubble ol {
    margin: 8px 0 12px 24px;
}

.message-bubble[dir="rtl"] ul, .message-bubble[dir="rtl"] ol {
    margin: 8px 24px 12px 0;
}

.message-bubble li {
    margin-bottom: 4px;
}

.message-bubble blockquote {
    border-left: 3px solid var(--accent-emerald);
    padding: 6px 14px;
    margin: 10px 0;
    color: var(--text-secondary);
    background-color: var(--bg-tertiary);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.message-bubble[dir="rtl"] blockquote {
    border-left: none;
    border-right: 3px solid var(--accent-emerald);
    border-radius: var(--radius-sm) 0 0 var(--radius-sm);
}

/* Code Blocks */
.code-block-container {
    background-color: #0d1117;
    border: 1px solid #30363d;
    border-radius: var(--radius-md);
    margin: 12px 0;
    overflow: hidden;
    direction: ltr !important;
    text-align: left !important;
}

.code-header {
    background-color: #161b22;
    padding: 6px 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.75rem;
    color: #8b949e;
    border-bottom: 1px solid #30363d;
}

.code-lang {
    font-weight: 600;
    text-transform: uppercase;
}

.copy-code-btn {
    background: transparent;
    border: none;
    color: #8b949e;
    cursor: pointer;
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    transition: color 0.15s, background 0.15s;
}

.copy-code-btn:hover {
    color: #f0f6fc;
    background-color: #21262d;
}

.code-block-container pre {
    padding: 12px 14px;
    overflow-x: auto;
    font-family: var(--font-code);
    font-size: 0.86rem;
    color: #e6edf3;
    line-height: 1.5;
}

.inline-code {
    background-color: var(--bg-tertiary);
    color: var(--accent-gold);
    font-family: var(--font-code);
    font-size: 0.88em;
    padding: 2px 5px;
    border-radius: 4px;
    border: 1px solid var(--border-light);
}

/* Tables */
.markdown-table {
    width: 100%;
    border-collapse: collapse;
    margin: 12px 0;
    font-size: 0.88rem;
}

.markdown-table th, .markdown-table td {
    border: 1px solid var(--border-color);
    padding: 8px 12px;
    text-align: left;
}

.message-bubble[dir="rtl"] .markdown-table th,
.message-bubble[dir="rtl"] .markdown-table td {
    text-align: right;
}

.markdown-table th {
    background-color: var(--bg-tertiary);
    font-weight: 700;
    color: var(--text-primary);
}

.markdown-table tr:nth-child(even) {
    background-color: rgba(255, 255, 255, 0.02);
}

/* Grounding Web Sources Badge */
.grounding-sources {
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px dashed var(--border-color);
    font-size: 0.78rem;
    color: var(--text-muted);
}

.sources-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 4px;
}

.source-item {
    background-color: var(--bg-tertiary);
    padding: 2px 8px;
    border-radius: 4px;
    color: var(--accent-emerald);
    font-size: 0.72rem;
    border: 1px solid var(--border-color);
    text-decoration: none;
}

/* Typing Indicator Animation */
.typing-dots {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 10px;
}

.typing-dot {
    width: 7px;
    height: 7px;
    background-color: var(--accent-emerald);
    border-radius: 50%;
    animation: typingBounce 1.4s infinite ease-in-out both;
}

.typing-dot:nth-child(1) { animation-delay: -0.32s; }
.typing-dot:nth-child(2) { animation-delay: -0.16s; }
.typing-dot:nth-child(3) { animation-delay: 0s; }

@keyframes typingBounce {
    0%, 80%, 100% { transform: scale(0); opacity: 0.4; }
    40% { transform: scale(1); opacity: 1; }
}

/* CHAT INPUT AREA */
.input-area {
    padding: 14px 20px 18px 20px;
    background-color: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
}

.input-container {
    max-width: 820px;
    margin: 0 auto;
    background-color: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: flex-end;
    padding: 6px 12px;
    box-shadow: var(--shadow-sm);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.input-container:focus-within {
    border-color: var(--accent-emerald);
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2);
}

.chat-textarea {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-family: var(--font-main);
    font-size: 0.95rem;
    line-height: 1.5;
    padding: 8px 4px;
    resize: none;
    max-height: 180px;
    min-height: 24px;
}

.chat-textarea::placeholder {
    color: var(--text-muted);
}

.send-btn {
    background-color: var(--accent-emerald);
    color: #ffffff;
    border: none;
    width: 38px;
    height: 38px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    margin-left: 8px;
    margin-bottom: 2px;
    transition: all 0.2s ease;
}

.send-btn:hover:not(:disabled) {
    background-color: var(--accent-emerald-hover);
    transform: scale(1.04);
}

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

.send-btn svg {
    width: 18px;
    height: 18px;
}

.input-disclaimer {
    max-width: 820px;
    margin: 6px auto 0 auto;
    font-size: 0.72rem;
    color: var(--text-muted);
    text-align: center;
}

/* MODALS */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-box {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 500px;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    transform: translateY(10px);
    transition: transform 0.2s ease;
}

.modal-overlay.active .modal-box {
    transform: translateY(0);
}

.modal-box.small-modal {
    max-width: 420px;
}

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

.modal-header h3 {
    font-size: 1.05rem;
    font-weight: 700;
}

.modal-body {
    padding: 20px;
}

.setting-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.setting-input {
    width: 100%;
    padding: 10px 12px;
    background-color: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.88rem;
    outline: none;
    margin-bottom: 6px;
}

.setting-input:focus {
    border-color: var(--accent-emerald);
}

.setting-hint {
    font-size: 0.74rem;
    color: var(--text-muted);
    margin-bottom: 12px;
    line-height: 1.4;
}

.modal-divider {
    border: none;
    border-top: 1px solid var(--border-color);
    margin: 14px 0;
}

.modal-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 18px;
}

.btn {
    padding: 9px 16px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.15s ease;
}

.primary-btn {
    background-color: var(--accent-emerald);
    color: #ffffff;
}

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

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

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

.danger-btn {
    background-color: var(--danger-color);
    color: #ffffff;
}

.danger-btn:hover {
    background-color: #dc2626;
}

/* RESPONSIVE DESIGN (DESKTOP & MOBILE) */
@media (max-width: 900px) {
    .sample-cards-grid {
        grid-template-columns: 1fr;
    }
    .usage-meter-widget {
        max-width: 280px;
    }
}

@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        transform: translateX(-100%);
        box-shadow: var(--shadow-lg);
    }

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

    .mobile-menu-btn, .mobile-close-btn {
        display: flex;
    }

    .topbar {
        padding: 0 12px;
    }

    .usage-meter-widget {
        max-width: 200px;
        padding: 4px 8px;
    }

    .usage-badge {
        display: none;
    }

    .active-chat-title {
        max-width: 140px;
    }

    .messages-container {
        padding: 16px 12px;
    }

    .input-area {
        padding: 10px 12px 14px 12px;
    }
}
