/* ==========================================================================
   HUKUK ASİSTANI — Modern & Minimalist Açık Tema
   Renk Paleti: Safir Mavisi (#1d4ed8 / #2563eb), Koyu Zümrüt (#059669),
                Slate Beyaz/Gri Zemin (#ffffff / #f8fafc / #f1f5f9)
   ========================================================================== */

:root {
    --font-sans: 'Plus Jakarta Sans', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, Courier, monospace;

    /* Light Theme (Default) */
    --bg-page: #f8fafc;
    --bg-sidebar: #ffffff;
    --bg-card: #ffffff;
    --bg-card-hover: #f8fafc;
    --bg-input: #ffffff;
    --bg-bubble-ai: #ffffff;
    --bg-bubble-user: linear-gradient(135deg, #1d4ed8 0%, #2563eb 100%);
    
    --border-subtle: #e2e8f0;
    --border-hover: #cbd5e1;
    --border-active: #93c5fd;

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

    --sapphire-50: #eff6ff;
    --sapphire-100: #dbeafe;
    --sapphire-500: #3b82f6;
    --sapphire-600: #2563eb;
    --sapphire-700: #1d4ed8;
    --sapphire-900: #1e3a8a;

    --emerald-50: #ecfdf5;
    --emerald-100: #d1fae5;
    --emerald-500: #10b981;
    --emerald-600: #059669;
    --emerald-700: #047857;

    --shadow-xs: 0 1px 2px 0 rgba(15, 23, 42, 0.05);
    --shadow-sm: 0 2px 4px -1px rgba(15, 23, 42, 0.06), 0 1px 2px -1px rgba(15, 23, 42, 0.04);
    --shadow-md: 0 8px 16px -4px rgba(15, 23, 42, 0.07), 0 4px 6px -2px rgba(15, 23, 42, 0.03);
    --shadow-lg: 0 20px 25px -5px rgba(15, 23, 42, 0.08), 0 8px 10px -6px rgba(15, 23, 42, 0.03);
    --shadow-input: 0 10px 30px -5px rgba(37, 99, 235, 0.08), 0 4px 6px -2px rgba(15, 23, 42, 0.03);

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-full: 9999px;

    --sidebar-width: 290px;
    --header-height: 68px;
}

/* Dark Theme overrides if toggled */
body.dark-theme {
    --bg-page: #0b1120;
    --bg-sidebar: #0f172a;
    --bg-card: #1e293b;
    --bg-card-hover: #334155;
    --bg-input: #1e293b;
    --bg-bubble-ai: #1e293b;
    --bg-bubble-user: linear-gradient(135deg, #1e40af 0%, #3b82f6 100%);
    --border-subtle: #334155;
    --border-hover: #475569;
    --border-active: #60a5fa;
    --text-primary: #f8fafc;
    --text-secondary: #cbd5e1;
    --text-muted: #64748b;
}

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

html, body {
    height: 100%;
    font-family: var(--font-sans);
    background-color: var(--bg-page);
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow: hidden;
}

/* Layout */
.app-layout {
    display: flex;
    height: 100vh;
    width: 100vw;
    background-color: var(--bg-page);
    position: relative;
}

/* ==========================================================================
   SIDEBAR
   ========================================================================== */
.app-sidebar {
    width: var(--sidebar-width);
    height: 100%;
    background-color: var(--bg-sidebar);
    border-right: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    z-index: 100;
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

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

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

.brand-icon {
    width: 38px;
    height: 38px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    color: var(--sapphire-600);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(59, 130, 246, 0.2);
    box-shadow: 0 2px 4px rgba(37, 99, 235, 0.08);
}

.brand-text {
    display: flex;
    flex-direction: column;
}

.brand-title {
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text-primary);
}

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

.new-chat-btn {
    margin: 16px 16px 8px 16px;
    padding: 12px 16px;
    background: linear-gradient(135deg, var(--sapphire-600) 0%, var(--sapphire-700) 100%);
    color: #ffffff;
    border: none;
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 0.92rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
    transition: all 0.2s ease;
}

.new-chat-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.35);
    background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
}

.sidebar-section {
    padding: 14px 16px 8px 16px;
}

.section-title, .section-title-row {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-bottom: 8px;
}

.section-title-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.clear-history-btn {
    background: none;
    border: none;
    font-size: 0.72rem;
    color: var(--text-muted);
    cursor: pointer;
    font-family: inherit;
    transition: color 0.15s;
}

.clear-history-btn:hover {
    color: #ef4444;
}

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

.template-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    background: transparent;
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.template-item:hover {
    background-color: var(--sapphire-50);
    color: var(--sapphire-700);
    border-color: var(--sapphire-100);
}

.template-icon {
    font-size: 1rem;
    flex-shrink: 0;
}

.template-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.history-section {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.chat-history-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    overflow-y: auto;
    max-height: 230px;
    padding-right: 4px;
}

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

.history-item:hover, .history-item.active {
    background-color: var(--bg-page);
    border-color: var(--border-subtle);
    color: var(--sapphire-700);
}

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

.history-del-btn {
    opacity: 0;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 2px;
    transition: opacity 0.15s, color 0.15s;
}

.history-item:hover .history-del-btn {
    opacity: 1;
}

.history-del-btn:hover {
    color: #ef4444;
}

.sidebar-footer {
    padding: 14px 16px;
    border-top: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: var(--bg-sidebar);
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: var(--radius-full);
    background-color: var(--emerald-500);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
}

.status-text {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--emerald-700);
}

.settings-trigger-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: 1px solid var(--border-subtle);
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s;
}

.settings-trigger-btn:hover {
    background-color: var(--bg-page);
    color: var(--sapphire-600);
    border-color: var(--sapphire-500);
}

/* ==========================================================================
   MAIN CONTENT & HEADER
   ========================================================================== */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
    min-width: 0;
    position: relative;
    background-color: var(--bg-page);
}

.app-header {
    height: var(--header-height);
    background-color: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    z-index: 10;
}

body.dark-theme .app-header {
    background-color: rgba(15, 23, 42, 0.85);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 14px;
}

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

.close-sidebar-btn {
    display: none;
}

.icon-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px;
    border-radius: var(--radius-sm);
    transition: all 0.15s;
}

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

.header-title-box {
    display: flex;
    flex-direction: column;
}

.header-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

.header-subtitle {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-muted);
}

/* Domain Pills */
.domain-pills {
    display: flex;
    align-items: center;
    gap: 6px;
    background-color: var(--bg-page);
    padding: 4px;
    border-radius: var(--radius-full);
    border: 1px solid var(--border-subtle);
}

.domain-pill {
    background: transparent;
    border: none;
    padding: 6px 12px;
    border-radius: var(--radius-full);
    font-family: inherit;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
}

.domain-pill:hover {
    color: var(--text-primary);
}

.domain-pill.active {
    background-color: #ffffff;
    color: var(--sapphire-600);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

body.dark-theme .domain-pill.active {
    background-color: var(--sapphire-900);
    color: #ffffff;
}

.action-btn-secondary {
    display: flex;
    align-items: center;
    gap: 6px;
    background-color: #ffffff;
    border: 1px solid var(--border-subtle);
    padding: 8px 14px;
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    box-shadow: var(--shadow-xs);
    transition: all 0.15s;
}

.action-btn-secondary:hover {
    border-color: var(--sapphire-500);
    color: var(--sapphire-600);
    box-shadow: var(--shadow-sm);
}

/* ==========================================================================
   CHAT MESSAGES AREA
   ========================================================================== */
.chat-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: calc(100% - var(--header-height));
    position: relative;
    overflow: hidden;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 24px 20px 160px 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    max-width: 920px;
    width: 100%;
    margin: 0 auto;
    scroll-behavior: smooth;
}

/* Welcome Hero */
.welcome-hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 40px 16px 20px 16px;
    margin: auto 0;
    animation: fadeIn 0.4s ease-out;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    border-radius: var(--radius-full);
    background-color: var(--sapphire-50);
    border: 1px solid var(--sapphire-100);
    color: var(--sapphire-700);
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 20px;
}

.badge-dot {
    width: 6px;
    height: 6px;
    border-radius: var(--radius-full);
    background-color: var(--emerald-500);
}

.hero-title {
    font-size: 2.3rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.2;
    color: var(--text-primary);
    margin-bottom: 14px;
}

.gradient-text {
    background: linear-gradient(135deg, var(--sapphire-600) 0%, var(--emerald-600) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-desc {
    font-size: 1.05rem;
    color: var(--text-secondary);
    max-width: 620px;
    line-height: 1.6;
    margin-bottom: 36px;
}

.suggestion-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
    width: 100%;
    max-width: 820px;
    margin-bottom: 36px;
}

.suggestion-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 16px 18px;
    display: flex;
    align-items: center;
    gap: 14px;
    text-align: left;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.suggestion-card:hover {
    transform: translateY(-2px);
    border-color: var(--sapphire-500);
    box-shadow: var(--shadow-md);
    background-color: var(--bg-card-hover);
}

.card-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

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

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

.card-arrow {
    margin-left: auto;
    font-size: 1.1rem;
    color: var(--text-muted);
    transition: transform 0.2s, color 0.2s;
}

.suggestion-card:hover .card-arrow {
    transform: translateX(4px);
    color: var(--sapphire-600);
}

.trust-features {
    display: flex;
    align-items: center;
    gap: 24px;
    color: var(--text-muted);
    font-size: 0.82rem;
    font-weight: 500;
}

.trust-item {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
}

.trust-item svg {
    color: var(--emerald-600);
}

/* ==========================================================================
   CHAT BUBBLES
   ========================================================================== */
.message-row {
    display: flex;
    gap: 14px;
    width: 100%;
    animation: slideUp 0.25s ease-out;
}

.message-row.user-row {
    justify-content: flex-end;
}

.message-avatar {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 0.9rem;
    font-weight: 700;
}

.user-avatar {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    color: #ffffff;
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.2);
}

.ai-avatar {
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
    color: var(--emerald-700);
    border: 1px solid rgba(16, 185, 129, 0.3);
    box-shadow: 0 2px 6px rgba(16, 185, 129, 0.15);
}

.message-body {
    max-width: 82%;
    display: flex;
    flex-direction: column;
}

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

.message-author {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-primary);
}

.message-time {
    font-size: 0.72rem;
    color: var(--text-muted);
}

.message-bubble {
    border-radius: var(--radius-lg);
    padding: 16px 20px;
    font-size: 0.95rem;
    line-height: 1.65;
    position: relative;
    word-break: break-word;
}

.user-bubble {
    background: var(--bg-bubble-user);
    color: #ffffff;
    border-bottom-right-radius: 4px;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
}

.ai-bubble {
    background: var(--bg-bubble-ai);
    color: var(--text-primary);
    border: 1px solid var(--border-subtle);
    border-bottom-left-radius: 4px;
    box-shadow: var(--shadow-sm);
}

/* Rich Formatting inside AI Bubble */
.ai-bubble h1, .ai-bubble h2, .ai-bubble h3, .ai-bubble h4 {
    color: var(--text-primary);
    margin: 16px 0 8px 0;
    font-weight: 700;
}

.ai-bubble h2 {
    font-size: 1.15rem;
    border-bottom: 1px solid var(--border-subtle);
    padding-bottom: 6px;
}

.ai-bubble h3 {
    font-size: 1.02rem;
}

.ai-bubble p {
    margin-bottom: 10px;
}

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

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

.ai-bubble li {
    margin-bottom: 6px;
}

.ai-bubble strong {
    font-weight: 700;
    color: var(--sapphire-700);
}

body.dark-theme .ai-bubble strong {
    color: #93c5fd;
}

/* Legal Badges / Citations */
.legal-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 6px;
    background-color: var(--sapphire-50);
    border: 1px solid var(--sapphire-100);
    color: var(--sapphire-700);
    font-size: 0.78rem;
    font-weight: 600;
    font-family: var(--font-mono);
}

body.dark-theme .legal-badge {
    background-color: rgba(59, 130, 246, 0.15);
    border-color: rgba(59, 130, 246, 0.3);
    color: #93c5fd;
}

/* Petition / Code Block Format */
.petition-block {
    background-color: #f1f5f9;
    border-left: 4px solid var(--sapphire-600);
    border-radius: 6px;
    padding: 14px 18px;
    margin: 14px 0;
    font-family: 'Times New Roman', Times, serif;
    font-size: 0.98rem;
    line-height: 1.6;
    white-space: pre-wrap;
    color: #0f172a;
    border: 1px solid var(--border-subtle);
    border-left-width: 4px;
}

body.dark-theme .petition-block {
    background-color: #0f172a;
    color: #e2e8f0;
}

/* Message Actions Bar */
.message-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 10px;
    padding-top: 8px;
}

.action-chip {
    background: transparent;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: 4px 10px;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: all 0.15s ease;
}

.action-chip:hover {
    background-color: var(--sapphire-50);
    color: var(--sapphire-700);
    border-color: var(--sapphire-100);
}

.action-chip.copied {
    background-color: var(--emerald-50);
    color: var(--emerald-700);
    border-color: var(--emerald-500);
}

/* ==========================================================================
   FLOATING INPUT WRAPPER
   ========================================================================== */
.chat-input-wrapper {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 12px 24px 20px 24px;
    background: linear-gradient(180deg, rgba(248, 250, 252, 0) 0%, rgba(248, 250, 252, 0.95) 40%, rgba(248, 250, 252, 1) 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 20;
}

body.dark-theme .chat-input-wrapper {
    background: linear-gradient(180deg, rgba(11, 17, 32, 0) 0%, rgba(11, 17, 32, 0.95) 40%, rgba(11, 17, 32, 1) 100%);
}

.typing-indicator {
    display: none;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    background-color: #ffffff;
    border: 1px solid var(--border-subtle);
    padding: 6px 14px;
    border-radius: var(--radius-full);
    box-shadow: var(--shadow-sm);
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary);
    animation: fadeIn 0.2s ease-out;
}

body.dark-theme .typing-indicator {
    background-color: var(--bg-card);
}

.typing-indicator.active {
    display: flex;
}

.pulse-dots {
    display: flex;
    gap: 4px;
}

.pulse-dots span {
    width: 6px;
    height: 6px;
    border-radius: var(--radius-full);
    background-color: var(--sapphire-600);
    animation: bounce 1.4s infinite ease-in-out both;
}

.pulse-dots span:nth-child(1) { animation-delay: -0.32s; }
.pulse-dots span:nth-child(2) { animation-delay: -0.16s; }

.chat-input-form {
    width: 100%;
    max-width: 900px;
}

.input-box {
    background-color: var(--bg-input);
    border: 1.5px solid var(--border-subtle);
    border-radius: var(--radius-xl);
    padding: 10px 14px 10px 20px;
    display: flex;
    align-items: flex-end;
    gap: 12px;
    box-shadow: var(--shadow-input);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.input-box:focus-within {
    border-color: var(--sapphire-500);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.12), var(--shadow-md);
}

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

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

.input-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.tool-btn {
    background-color: var(--bg-page);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-full);
    padding: 6px 12px;
    font-family: inherit;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s;
}

.tool-btn:hover {
    border-color: var(--sapphire-500);
    color: var(--sapphire-600);
}

.send-btn {
    width: 42px;
    height: 42px;
    border-radius: var(--radius-full);
    background: linear-gradient(135deg, var(--sapphire-600) 0%, var(--sapphire-700) 100%);
    border: none;
    color: #ffffff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
    transition: all 0.2s ease;
}

.send-btn:hover:not(:disabled) {
    transform: scale(1.05);
    background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
}

.send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.disclaimer-text {
    font-size: 0.72rem;
    color: var(--text-muted);
    text-align: center;
    margin-top: 8px;
    max-width: 800px;
    line-height: 1.4;
}

/* ==========================================================================
   MODAL (SETTINGS)
   ========================================================================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.2s ease-out;
}

.modal-overlay.active {
    display: flex;
}

.modal-card {
    background-color: var(--bg-card);
    width: 100%;
    max-width: 520px;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-subtle);
    overflow: hidden;
    animation: zoomIn 0.25s ease-out;
}

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

.modal-title-box {
    display: flex;
    align-items: center;
    gap: 12px;
}

.modal-icon {
    font-size: 1.4rem;
}

.modal-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
}

.modal-subtitle {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 2px;
}

.modal-body {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.setting-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.setting-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
}

.setting-input, .setting-select {
    padding: 10px 14px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-subtle);
    background-color: var(--bg-page);
    font-family: inherit;
    font-size: 0.9rem;
    color: var(--text-primary);
    outline: none;
    transition: all 0.15s;
}

.setting-input:focus, .setting-select:focus {
    border-color: var(--sapphire-500);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

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

.theme-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.theme-option {
    padding: 10px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-subtle);
    background-color: var(--bg-page);
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s;
}

.theme-option.active {
    border-color: var(--sapphire-600);
    background-color: var(--sapphire-50);
    color: var(--sapphire-700);
}

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

.btn-cancel {
    padding: 9px 16px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-subtle);
    background-color: #ffffff;
    font-family: inherit;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s;
}

.btn-cancel:hover {
    background-color: var(--bg-page);
}

.btn-save {
    padding: 9px 20px;
    border-radius: var(--radius-md);
    border: none;
    background: linear-gradient(135deg, var(--sapphire-600) 0%, var(--sapphire-700) 100%);
    font-family: inherit;
    font-size: 0.88rem;
    font-weight: 600;
    color: #ffffff;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.25);
    transition: all 0.15s;
}

.btn-save:hover {
    background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
}

/* ==========================================================================
   ANIMATIONS & RESPONSIVE
   ========================================================================== */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

@keyframes zoomIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes bounce {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1.0); }
}

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

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

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

    .close-sidebar-btn {
        display: flex;
    }

    .domain-pills {
        display: none;
    }

    .suggestion-grid {
        grid-template-columns: 1fr;
    }

    .hero-title {
        font-size: 1.8rem;
    }

    .message-body {
        max-width: 92%;
    }
}
