/**
 * Gilavar AI Chat - Grok-style Design
 * Enterprise-level design matching Softyu branding
 */

/* ============================================
   CSS Variables & Theme
   ============================================ */
:root {
    /* Primary Colors */
    --primary: #C4FFA0;
    --primary-rgb: 196, 255, 160;
    --primary-foreground: #000000;

    /* Background Colors */
    --background: #000000;
    --background-secondary: #0a0a0a;
    --background-tertiary: #141414;

    /* Text Colors */
    --foreground: #ffffff;
    --foreground-muted: #a1a1aa;
    --foreground-dim: #71717a;

    /* Border Colors */
    --border: rgba(255, 255, 255, 0.1);
    --border-hover: rgba(255, 255, 255, 0.2);

    /* Status Colors */
    --success: #22c55e;
    --warning: #f59e0b;
    --error: #ef4444;
    --info: #3b82f6;

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 30px rgba(196, 255, 160, 0.15);

    /* Typography */
    --font-sans: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-heading: 'Inter Tight', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;

    /* Spacing */
    --icon-sidebar-width: 60px;
    --history-sidebar-width: 280px;

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-normal: 300ms ease;
    --transition-smooth: 400ms cubic-bezier(0.4, 0, 0.2, 1);

    /* Border Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;
}

/* ============================================
   Reset & Base
   ============================================ */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-sans);
    background-color: var(--background);
    color: var(--foreground);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: 1.2;
}

a {
    color: inherit;
    text-decoration: none;
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
}

input,
textarea,
select {
    font-family: inherit;
    font-size: inherit;
}

img {
    max-width: 100%;
    height: auto;
}

/* ============================================
   Utility Classes
   ============================================ */
.container {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* ============================================
   Buttons
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    border-radius: var(--radius-full);
    transition: all var(--transition-smooth);
    white-space: nowrap;
    outline: none;
}

.btn:focus-visible {
    box-shadow: 0 0 0 3px rgba(196, 255, 160, 0.3);
}

.btn-primary {
    background: var(--primary);
    color: var(--primary-foreground);
}

.btn-primary:hover {
    background: rgba(196, 255, 160, 0.9);
    box-shadow: var(--shadow-glow);
    transform: translateY(-2px);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: var(--foreground);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: var(--border-hover);
}

.btn-ghost {
    color: var(--foreground-muted);
}

.btn-ghost:hover {
    color: var(--foreground);
    background: rgba(255, 255, 255, 0.05);
}

.btn-google {
    background: #fff;
    color: #333;
    border: 1px solid #ddd;
    font-weight: 500;
}

.btn-google:hover {
    background: #f5f5f5;
    box-shadow: var(--shadow-md);
}

.btn-google svg {
    width: 20px;
    height: 20px;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1.125rem;
}

/* ============================================
   Icon Button
   ============================================ */
.icon-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    color: var(--foreground-muted);
    transition: all var(--transition-fast);
}

.icon-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--foreground);
}

.icon-btn svg {
    width: 20px;
    height: 20px;
}

/* ============================================
   Form Elements
   ============================================ */
.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--foreground);
    font-size: 0.875rem;
}

.form-input {
    width: 100%;
    padding: 0.875rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--foreground);
    transition: all var(--transition-normal);
}

.form-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(196, 255, 160, 0.1);
    background: rgba(255, 255, 255, 0.08);
}

.form-input::placeholder {
    color: var(--foreground-dim);
}

.form-error {
    color: var(--error);
    font-size: 0.875rem;
    margin-top: 0.5rem;
}

.form-divider {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 1.5rem 0;
    color: var(--foreground-dim);
    font-size: 0.875rem;
}

.form-divider::before,
.form-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

/* ============================================
   Auth Pages
   ============================================ */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    position: relative;
    overflow: hidden;
}

.auth-container {
    width: 100%;
    max-width: 420px;
    position: relative;
    z-index: 10;
}

.auth-card {
    background: rgba(18, 18, 18, 0.8);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 2.5rem;
    box-shadow: var(--shadow-lg);
}

.auth-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 2rem;
}

.auth-logo img {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
}

.auth-logo span {
    font-family: var(--font-heading);
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--primary);
}

.auth-title {
    text-align: center;
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--foreground);
}

.auth-subtitle {
    text-align: center;
    color: var(--foreground-muted);
    margin-bottom: 2rem;
    font-size: 0.95rem;
}

.auth-footer {
    text-align: center;
    margin-top: 1.5rem;
    color: var(--foreground-muted);
    font-size: 0.875rem;
}

.auth-footer a {
    color: var(--primary);
    font-weight: 600;
    transition: opacity var(--transition-fast);
}

.auth-footer a:hover {
    opacity: 0.8;
}

/* Background Effects */
.bg-grid {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    opacity: 0.02;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.3) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.3) 1px, transparent 1px);
    background-size: 60px 60px;
}

.floating-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    pointer-events: none;
    animation: float 20s ease-in-out infinite;
}

.floating-orb-1 {
    width: 400px;
    height: 400px;
    background: rgba(196, 255, 160, 0.08);
    top: -100px;
    left: -100px;
}

.floating-orb-2 {
    width: 300px;
    height: 300px;
    background: rgba(196, 255, 160, 0.05);
    bottom: -50px;
    right: -50px;
    animation-delay: -5s;
}

.floating-orb-3 {
    width: 250px;
    height: 250px;
    background: rgba(196, 255, 160, 0.04);
    top: 50%;
    left: 50%;
    animation-delay: -10s;
}

/* ============================================
   Chat Layout - Grok Style
   ============================================ */
.chat-app {
    display: flex;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
    position: relative;
    background: var(--background);
}

/* ============================================
   Icon Sidebar (Left)
   ============================================ */
.icon-sidebar {
    width: var(--icon-sidebar-width);
    height: 100vh;
    height: 100dvh;
    background: var(--background);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1rem 0;
    position: relative;
    z-index: 50;
}

.icon-sidebar-logo {
    margin-bottom: 2rem;
}

.icon-sidebar-logo img {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
}

.icon-sidebar-main {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex: 1;
}

.icon-sidebar-bottom {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    align-items: center;
}

.user-avatar-small {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), rgba(196, 255, 160, 0.5));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.75rem;
    color: var(--primary-foreground);
    cursor: pointer;
    overflow: hidden;
    transition: all var(--transition-fast);
}

.user-avatar-small:hover {
    transform: scale(1.1);
}

.user-avatar-small img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.collapse-btn svg {
    transition: transform var(--transition-normal);
}

/* ============================================
   History Sidebar
   ============================================ */
.history-sidebar {
    width: 0;
    height: 100vh;
    height: 100dvh;
    background: var(--background-secondary);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: width var(--transition-smooth);
    z-index: 40;
}

.history-sidebar.open {
    width: var(--history-sidebar-width);
}

.history-sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    border-bottom: 1px solid var(--border);
}

.history-sidebar-header h3 {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--foreground);
    white-space: nowrap;
}

.history-sidebar-search {
    padding: 0.75rem 1rem;
}

.history-sidebar-search input {
    width: 100%;
    padding: 0.625rem 0.875rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--foreground);
    font-size: 0.875rem;
}

.history-sidebar-search input:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.2);
}

.history-sidebar-list {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem;
}

.history-sidebar-list::-webkit-scrollbar {
    width: 4px;
}

.history-sidebar-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
}

/* History Items */
.history-section {
    margin-bottom: 1rem;
}

.history-section-title {
    padding: 0.5rem 0.75rem;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--foreground-dim);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.history-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 0.75rem;
    border-radius: var(--radius-sm);
    color: var(--foreground-muted);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.history-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--foreground);
}

.history-item.active {
    background: rgba(196, 255, 160, 0.1);
    color: var(--primary);
}

.history-item svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.history-item-title {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.85rem;
}

.history-item-delete {
    opacity: 0;
    padding: 0.25rem;
    border-radius: var(--radius-sm);
    transition: opacity var(--transition-fast);
}

.history-item:hover .history-item-delete {
    opacity: 1;
}

.history-item-delete:hover {
    background: rgba(239, 68, 68, 0.2);
    color: var(--error);
}

/* ============================================
   Search Panel
   ============================================ */
.search-panel {
    position: fixed;
    top: 0;
    left: var(--icon-sidebar-width);
    right: 0;
    height: 60px;
    background: var(--background);
    border-bottom: 1px solid var(--border);
    display: none;
    align-items: center;
    padding: 0 1.5rem;
    z-index: 100;
}

.search-panel.open {
    display: flex;
}

.search-panel-content {
    display: flex;
    align-items: center;
    gap: 1rem;
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
}

.search-panel-content input {
    flex: 1;
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--foreground);
    font-size: 1rem;
}

.search-panel-content input:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.2);
}

/* ============================================
   User Menu
   ============================================ */
.user-menu {
    position: fixed;
    bottom: 70px;
    left: 10px;
    background: var(--background-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 0.5rem;
    min-width: 200px;
    z-index: 1000;
    display: none;
    box-shadow: var(--shadow-lg);
}

.user-menu.open {
    display: block;
    animation: fadeIn 0.2s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.user-menu-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    border-bottom: 1px solid var(--border);
    margin-bottom: 0.5rem;
}

.user-menu-info {
    flex: 1;
    min-width: 0;
}

.user-menu-name {
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--foreground);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-menu-plan {
    font-size: 0.75rem;
    color: var(--foreground-dim);
}

.user-menu-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    border-radius: var(--radius-sm);
    color: var(--foreground-muted);
    font-size: 0.875rem;
    transition: all var(--transition-fast);
}

.user-menu-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--foreground);
}

.user-menu-item.upgrade {
    color: var(--primary);
}

.user-menu-item.upgrade:hover {
    background: rgba(196, 255, 160, 0.1);
}

.user-menu-item svg {
    width: 18px;
    height: 18px;
}

/* ============================================
   Main Chat Area
   ============================================ */
.chat-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    position: relative;
    height: 100vh;
    height: 100dvh;
}

/* ============================================
   Messages Area
   ============================================ */
.messages-container {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    padding-bottom: 180px;
}

.messages-container::-webkit-scrollbar {
    width: 6px;
}

.messages-container::-webkit-scrollbar-track {
    background: transparent;
}

.messages-container::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

/* Welcome Screen - Centered */
.welcome-screen {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    min-height: 50vh;
}

.welcome-logo-container {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.welcome-logo {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
}

.welcome-brand {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--foreground);
}

/* Messages */
.messages-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    max-width: 800px;
    margin: 0 auto;
    width: 100%;
    padding: 2rem;
}

.message {
    display: flex;
    gap: 1rem;
    animation: message-fade-in 0.3s ease-out;
}

@keyframes message-fade-in {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message-avatar {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-weight: 600;
    font-size: 0.75rem;
}

.message.user .message-avatar {
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    color: #fff;
}

.message.assistant .message-avatar {
    background: linear-gradient(135deg, var(--primary), rgba(196, 255, 160, 0.6));
    color: var(--primary-foreground);
}

.message-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: var(--radius-sm);
}

.message-content {
    flex: 1;
    min-width: 0;
}

.message-role {
    font-weight: 600;
    font-size: 0.85rem;
    margin-bottom: 0.25rem;
    color: var(--foreground);
}

.message-text {
    color: var(--foreground-muted);
    line-height: 1.7;
    font-size: 0.95rem;
}

.message-text p {
    margin-bottom: 0.75rem;
}

.message-text p:last-child {
    margin-bottom: 0;
}

.message-text code {
    font-family: var(--font-mono);
    background: rgba(255, 255, 255, 0.08);
    padding: 0.125rem 0.375rem;
    border-radius: 4px;
    font-size: 0.875em;
}

.message-text pre {
    background: var(--background-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1rem;
    overflow-x: auto;
    margin: 1rem 0;
}

.message-text pre code {
    background: none;
    padding: 0;
}

/* Thinking indicator */
.thinking-container {
    margin-bottom: 0.75rem;
}

.thinking-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: rgba(196, 255, 160, 0.08);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    color: var(--primary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.thinking-toggle:hover {
    background: rgba(196, 255, 160, 0.12);
}

.thinking-toggle svg {
    width: 14px;
    height: 14px;
    transition: transform var(--transition-fast);
}

.thinking-toggle.expanded svg {
    transform: rotate(180deg);
}

.thinking-content {
    margin-top: 0.75rem;
    padding: 0.75rem 1rem;
    background: rgba(196, 255, 160, 0.03);
    border-left: 2px solid var(--primary);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    font-size: 0.85rem;
    color: var(--foreground-dim);
    display: none;
}

.thinking-content.visible {
    display: block;
}

/* Typing indicator */
.typing-indicator {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 0.5rem 0;
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    background: var(--primary);
    border-radius: 50%;
    animation: typing-bounce 1.4s ease-in-out infinite;
}

.typing-indicator span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-indicator span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing-bounce {

    0%,
    60%,
    100% {
        transform: translateY(0);
        opacity: 0.4;
    }

    30% {
        transform: translateY(-6px);
        opacity: 1;
    }
}

/* Typewriter cursor */
.typewriter-cursor {
    display: inline-block;
    width: 2px;
    height: 1em;
    background: var(--primary);
    margin-left: 2px;
    animation: blink 1s step-end infinite;
    vertical-align: text-bottom;
}

@keyframes blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }
}

/* ============================================
   Chat Input - Grok Style
   ============================================ */
.chat-input-container {
    position: fixed;
    bottom: 0;
    left: var(--icon-sidebar-width);
    right: 0;
    padding: 1.5rem 2rem 2rem;
    background: linear-gradient(to top, var(--background) 60%, transparent);
    z-index: 30;
}

.chat-input-wrapper {
    max-width: 700px;
    margin: 0 auto;
}

.chat-input-box {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: var(--background-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    padding: 0.5rem 0.75rem 0.5rem 1rem;
    transition: all var(--transition-normal);
}

.chat-input-box:focus-within {
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.1);
}

.input-icon {
    color: var(--foreground-dim);
}

.input-icon svg {
    width: 20px;
    height: 20px;
}

.chat-input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--foreground);
    font-size: 0.95rem;
    line-height: 1.5;
    resize: none;
    max-height: 150px;
    min-height: 24px;
    padding: 0.5rem 0;
}

.chat-input:focus {
    outline: none;
}

.chat-input::placeholder {
    color: var(--foreground-dim);
}

.input-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Mode Selector */
.mode-selector {
    position: relative;
}

.mode-btn {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 0.75rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    color: var(--foreground-muted);
    font-size: 0.8rem;
    font-weight: 500;
    transition: all var(--transition-fast);
}

.mode-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--foreground);
}

.mode-btn .mode-icon {
    width: 16px;
    height: 16px;
}

.mode-btn .chevron {
    width: 14px;
    height: 14px;
    transition: transform var(--transition-fast);
}

.mode-selector.open .mode-btn .chevron {
    transform: rotate(180deg);
}

.mode-dropdown {
    position: absolute;
    bottom: 100%;
    right: 0;
    margin-bottom: 0.5rem;
    background: var(--background-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 0.5rem;
    min-width: 180px;
    display: none;
    box-shadow: var(--shadow-lg);
}

.mode-selector.open .mode-dropdown {
    display: block;
    animation: fadeIn 0.2s ease-out;
}

.mode-option {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    width: 100%;
    padding: 0.75rem;
    border-radius: var(--radius-md);
    color: var(--foreground-muted);
    text-align: left;
    transition: all var(--transition-fast);
}

.mode-option:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--foreground);
}

.mode-option.active {
    background: rgba(196, 255, 160, 0.1);
    color: var(--primary);
}

.mode-option svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    margin-top: 0.125rem;
}

.mode-option span {
    font-weight: 500;
    font-size: 0.875rem;
    display: block;
}

.mode-option small {
    font-size: 0.75rem;
    color: var(--foreground-dim);
    font-weight: 400;
}

/* Send Button */
.send-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--foreground);
    color: var(--background);
    border-radius: 50%;
    transition: all var(--transition-normal);
}

.send-btn:hover:not(:disabled) {
    transform: scale(1.05);
    background: var(--primary);
}

.send-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.send-btn svg {
    width: 18px;
    height: 18px;
}

/* Input Options (Web Search) */
.input-options {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.option-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    color: var(--foreground-muted);
    font-size: 0.8rem;
    font-weight: 500;
    transition: all var(--transition-fast);
}

.option-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--border-hover);
    color: var(--foreground);
}

.option-btn.active {
    background: rgba(196, 255, 160, 0.1);
    border-color: var(--primary);
    color: var(--primary);
}

.option-btn svg {
    width: 16px;
    height: 16px;
}

/* ============================================
   Sidebar Overlay
   ============================================ */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 35;
    opacity: 0;
    transition: opacity var(--transition-normal);
}

.sidebar-overlay.visible {
    display: block;
    opacity: 1;
}

/* ============================================
   Pricing Page
   ============================================ */
.pricing-page {
    min-height: 100vh;
    padding: 4rem 2rem;
    position: relative;
}

.pricing-header {
    text-align: center;
    margin-bottom: 4rem;
}

.pricing-header h1 {
    font-size: 2.5rem;
    color: var(--primary);
    margin-bottom: 1rem;
}

.pricing-header p {
    font-size: 1.125rem;
    color: var(--foreground-muted);
    max-width: 600px;
    margin: 0 auto;
}

.pricing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
    max-width: 900px;
    margin: 0 auto;
}

.pricing-card {
    background: rgba(18, 18, 18, 0.8);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 2.5rem;
    position: relative;
    transition: all var(--transition-smooth);
}

.pricing-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-glow);
    border-color: var(--border-hover);
}

.pricing-card.featured {
    border-color: var(--primary);
    background: rgba(196, 255, 160, 0.03);
}

.pricing-card.featured::before {
    content: 'Tövsiyə edilir';
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--primary);
    color: var(--primary-foreground);
    padding: 0.375rem 1rem;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
}

.pricing-name {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--foreground);
}

.pricing-price {
    margin-bottom: 1.5rem;
}

.pricing-amount {
    font-size: 3rem;
    font-weight: 800;
    color: var(--primary);
}

.pricing-period {
    font-size: 1rem;
    color: var(--foreground-dim);
}

.pricing-features {
    list-style: none;
    margin-bottom: 2rem;
}

.pricing-features li {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 0;
    color: var(--foreground-muted);
    font-size: 0.95rem;
}

.pricing-features li svg {
    width: 18px;
    height: 18px;
    color: var(--primary);
    flex-shrink: 0;
}

.pricing-cta {
    width: 100%;
}

.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 2rem;
    color: var(--foreground-muted);
    font-size: 0.95rem;
    transition: color var(--transition-fast);
}

.back-btn:hover {
    color: var(--primary);
}

.back-btn svg {
    width: 20px;
    height: 20px;
}

/* ============================================
   Error Page
   ============================================ */
.error-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    text-align: center;
}

.error-content h1 {
    font-size: 6rem;
    color: var(--primary);
    margin-bottom: 1rem;
}

.error-content p {
    font-size: 1.25rem;
    color: var(--foreground-muted);
    margin-bottom: 2rem;
}

/* ============================================
   Toast Notifications
   ============================================ */
.toast-container {
    position: fixed;
    top: 1.5rem;
    right: 1.5rem;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.toast {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    background: var(--background-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    animation: toast-in 0.3s ease-out;
    max-width: 400px;
}

.toast.success {
    border-color: var(--success);
}

.toast.error {
    border-color: var(--error);
}

.toast.warning {
    border-color: var(--warning);
}

.toast svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.toast.success svg {
    color: var(--success);
}

.toast.error svg {
    color: var(--error);
}

.toast.warning svg {
    color: var(--warning);
}

.toast-message {
    flex: 1;
    font-size: 0.9rem;
    color: var(--foreground);
}

.toast-close {
    padding: 0.25rem;
    color: var(--foreground-dim);
    cursor: pointer;
}

.toast-close:hover {
    color: var(--foreground);
}

@keyframes toast-in {
    from {
        opacity: 0;
        transform: translateX(100%);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Spinner */
.spinner {
    width: 24px;
    height: 24px;
    border: 2px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ============================================
   Animations
   ============================================ */
@keyframes float {

    0%,
    100% {
        transform: translate(0, 0) scale(1);
    }

    33% {
        transform: translate(30px, -30px) scale(1.05);
    }

    66% {
        transform: translate(-20px, 20px) scale(0.95);
    }
}

/* ============================================
   Responsive Design
   ============================================ */
@media (max-width: 768px) {
    .icon-sidebar {
        position: fixed;
        left: 0;
        top: 0;
        z-index: 60;
    }

    .history-sidebar {
        position: fixed;
        left: var(--icon-sidebar-width);
        top: 0;
        z-index: 55;
    }

    .history-sidebar.open {
        width: calc(100vw - var(--icon-sidebar-width));
    }

    .chat-main {
        margin-left: var(--icon-sidebar-width);
        width: calc(100vw - var(--icon-sidebar-width));
    }

    .chat-input-container {
        left: var(--icon-sidebar-width);
        padding: 1rem;
        padding-bottom: max(1rem, env(safe-area-inset-bottom));
    }

    .chat-input-box {
        padding: 0.375rem 0.5rem 0.375rem 0.75rem;
    }

    .input-icon {
        display: none;
    }

    .chat-input {
        font-size: 16px;
        /* Prevents zoom on iOS */
    }

    .mode-btn span {
        display: none;
    }

    .messages-container {
        padding-bottom: 160px;
    }

    .messages-list {
        padding: 1rem;
    }

    .welcome-brand {
        font-size: 1.75rem;
    }

    .search-panel {
        left: var(--icon-sidebar-width);
    }

    .user-menu {
        bottom: auto;
        top: 60px;
        left: 10px;
    }
}

@media (max-width: 480px) {
    :root {
        --icon-sidebar-width: 50px;
    }

    .icon-btn {
        width: 36px;
        height: 36px;
    }

    .icon-btn svg {
        width: 18px;
        height: 18px;
    }

    .auth-card {
        padding: 1.5rem;
        border-radius: var(--radius-lg);
    }

    .pricing-grid {
        grid-template-columns: 1fr;
    }
}

/* iOS Safari fixes */
@supports (-webkit-touch-callout: none) {
    .chat-app {
        height: -webkit-fill-available;
    }

    .chat-input-container {
        padding-bottom: max(1.5rem, env(safe-area-inset-bottom));
    }
}

/* ============================================
   Print Styles
   ============================================ */
@media print {

    .icon-sidebar,
    .history-sidebar,
    .chat-input-container {
        display: none;
    }

    .chat-main {
        margin-left: 0;
        width: 100%;
    }
}