/* =============================================================================
   TelekomAI - Styles
   Modern, light theme with glassmorphism effects
   ============================================================================= */

/* -----------------------------------------------------------------------------
   CSS Variables
   ----------------------------------------------------------------------------- */
:root {
    /* Colors */
    --primary-50: #eff6ff;
    --primary-100: #dbeafe;
    --primary-200: #bfdbfe;
    --primary-300: #93c5fd;
    --primary-400: #60a5fa;
    --primary-500: #3b82f6;
    --primary-600: #2563eb;
    --primary-700: #1d4ed8;

    --accent-400: #818cf8;
    --accent-500: #6366f1;
    --accent-600: #4f46e5;

    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;

    --success-500: #22c55e;
    --error-500: #ef4444;
    --warning-500: #f59e0b;

    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #0ea5e9 0%, #6366f1 100%);
    --gradient-bg: linear-gradient(135deg, #f0f9ff 0%, #e0e7ff 50%, #fdf4ff 100%);

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);

    /* Glass Effect */
    --glass-bg: rgba(255, 255, 255, 0.8);
    --glass-border: rgba(255, 255, 255, 0.3);
    --glass-blur: blur(20px);

    /* Spacing */
    --sidebar-width: 280px;
    --header-height: 64px;

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-normal: 250ms ease;
    --transition-slow: 350ms ease;

    /* Border Radius */
    --radius-sm: 6px;
    --radius-md: 10px;
    --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;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 0.9375rem;
    line-height: 1.6;
    color: var(--gray-800);
    background: var(--gradient-bg);
    min-height: 100vh;
}

/* -----------------------------------------------------------------------------
   Utility Classes
   ----------------------------------------------------------------------------- */
.hidden {
    display: none !important;
}

.text-muted {
    color: var(--gray-500);
    font-size: 0.8125rem;
}

/* -----------------------------------------------------------------------------
   Buttons
   ----------------------------------------------------------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    font-size: 0.9375rem;
    font-weight: 500;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    transition: all var(--transition-fast);
    text-decoration: none;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    background: var(--gradient-primary);
    color: white;
    box-shadow: var(--shadow-md), 0 0 0 0 rgba(99, 102, 241, 0.3);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg), 0 0 20px 0 rgba(99, 102, 241, 0.3);
}

.btn-primary:active:not(:disabled) {
    transform: translateY(0);
}

.btn-full {
    width: 100%;
}

.btn-icon {
    width: 20px;
    height: 20px;
}

.btn-icon-only {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: var(--radius-md);
    color: var(--gray-500);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-icon-only:hover {
    background: var(--gray-100);
    color: var(--gray-700);
}

/* -----------------------------------------------------------------------------
   Form Elements
   ----------------------------------------------------------------------------- */
.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--gray-700);
}

.form-group input {
    width: 100%;
    padding: 0.875rem 1rem;
    font-size: 0.9375rem;
    font-family: inherit;
    color: var(--gray-800);
    background: var(--gray-50);
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius-md);
    outline: none;
    transition: all var(--transition-fast);
}

.form-group input::placeholder {
    color: var(--gray-400);
}

.form-group input:focus {
    border-color: var(--primary-500);
    background: white;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.error-message {
    margin-top: 1rem;
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    color: var(--error-500);
    background: rgba(239, 68, 68, 0.1);
    border-radius: var(--radius-sm);
    display: none;
}

.error-message:not(:empty) {
    display: block;
}

/* -----------------------------------------------------------------------------
   Auth Page
   ----------------------------------------------------------------------------- */
.auth-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 1.5rem;
}

.auth-container {
    position: relative;
    width: 100%;
    max-width: 420px;
}

.bg-gradient {
    position: fixed;
    inset: 0;
    background: var(--gradient-bg);
    z-index: -2;
}

.bg-blur-circle {
    position: fixed;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.6;
    z-index: -1;
}

.circle-1 {
    top: -10%;
    right: -5%;
    width: 400px;
    height: 400px;
    background: rgba(14, 165, 233, 0.3);
}

.circle-2 {
    bottom: -15%;
    left: -10%;
    width: 500px;
    height: 500px;
    background: rgba(99, 102, 241, 0.3);
}

.auth-card {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
    padding: 2.5rem;
    box-shadow: var(--shadow-xl);
}

.auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-header .logo {
    margin-bottom: 1rem;
}

.auth-title {
    font-size: 1.75rem;
    font-weight: 700;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
}

.auth-subtitle {
    color: var(--gray-500);
    font-size: 0.9375rem;
}

.auth-footer {
    margin-top: 1.5rem;
    text-align: center;
    color: var(--gray-600);
    font-size: 0.875rem;
}

.auth-footer a {
    color: var(--primary-600);
    font-weight: 500;
    text-decoration: none;
    transition: color var(--transition-fast);
}

.auth-footer a:hover {
    color: var(--primary-700);
    text-decoration: underline;
}

.version-footer {
    position: fixed;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.75rem;
    color: var(--gray-400);
}

/* -----------------------------------------------------------------------------
   Chat Page Layout
   ----------------------------------------------------------------------------- */
.chat-page {
    overflow: hidden;
}

.chat-container {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* -----------------------------------------------------------------------------
   Sidebar
   ----------------------------------------------------------------------------- */
.sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border-right: 1px solid var(--gray-200);
    transition: transform var(--transition-normal);
    z-index: 100;
}

.sidebar-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--gray-200);
}

.logo-small svg {
    display: block;
}

.logo-text {
    font-size: 1.125rem;
    font-weight: 600;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    flex: 1;
}

.sidebar-toggle {
    display: none;
}

.btn-new-chat {
    margin: 1rem 1.25rem;
    padding: 0.875rem 1rem;
    background: var(--gradient-primary);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: 0.9375rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all var(--transition-fast);
}

.btn-new-chat:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.chat-list-container {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.chat-list-header {
    padding: 0.75rem 1.25rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--gray-500);
}

.chat-list {
    flex: 1;
    overflow-y: auto;
    padding: 0 0.75rem;
}

.chat-list-empty {
    text-align: center;
    padding: 2rem 1rem;
    color: var(--gray-500);
}

.chat-list-empty p:first-child {
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.chat-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    margin-bottom: 0.25rem;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
    color: var(--gray-700);
}

.chat-item:hover {
    background: var(--gray-100);
}

.chat-item.active {
    background: var(--primary-50);
    color: var(--primary-700);
}

.chat-item-icon {
    width: 20px;
    height: 20px;
    color: var(--gray-400);
}

.chat-item.active .chat-item-icon {
    color: var(--primary-500);
}

.chat-item-title {
    flex: 1;
    font-size: 0.875rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-item-delete {
    opacity: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    color: var(--gray-400);
    transition: all var(--transition-fast);
}

.chat-item:hover .chat-item-delete {
    opacity: 1;
}

.chat-item-delete:hover {
    background: var(--gray-200);
    color: var(--error-500);
}

.sidebar-footer {
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--gray-200);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.user-avatar {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gray-100);
    border-radius: var(--radius-full);
    color: var(--gray-500);
}

.user-email {
    flex: 1;
    font-size: 0.875rem;
    color: var(--gray-600);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* -----------------------------------------------------------------------------
   Main Chat Area
   ----------------------------------------------------------------------------- */
.chat-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
    background: white;
}

/* Token Counter */
.token-counter {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.625rem;
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--gray-500);
    margin-right: 0.5rem;
}

.token-counter svg {
    color: var(--primary-500);
}

.token-counter span {
    color: var(--gray-800);
    font-weight: 600;
}

.message-tokens {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.7rem;
    color: var(--gray-400);
    margin-top: 0.375rem;
    padding: 0 0.5rem;
}

.message-tokens svg {
    width: 12px;
    height: 12px;
}

.chat-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0 1.5rem;
    height: var(--header-height);
    background: white;
    border-bottom: 1px solid var(--gray-200);
}

.mobile-menu-btn {
    display: none;
}

.chat-header-title {
    flex: 1;
}

.chat-header-title h1 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--gray-800);
}

/* Custom Model Selector */
.model-selector-custom {
    position: relative;
    margin-right: 0.5rem;
}

.model-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    color: var(--gray-600);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.model-btn:hover {
    background: var(--gray-100);
    color: var(--gray-800);
}

.model-btn.active {
    background: var(--primary-50);
    color: var(--primary-600);
}

.model-current-name {
    font-weight: 500;
    font-size: 0.875rem;
}

.chevron-icon {
    transition: transform var(--transition-fast);
}

.model-btn.open .chevron-icon {
    transform: rotate(180deg);
}

.model-menu {
    position: absolute;
    bottom: 100%;
    left: 0;
    margin-bottom: 0.5rem;
    width: 280px;
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 0.5rem;
    z-index: 50;
    animation: slideUp 0.2s ease-out;
}

.model-menu-title {
    padding: 0.5rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.model-option {
    width: 100%;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.75rem;
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    text-align: left;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.model-option:hover {
    background: var(--gray-50);
}

.model-option.active {
    background: var(--primary-50);
    border-color: var(--primary-100);
}

.model-icon-wrapper {
    padding: 0.5rem;
    border-radius: var(--radius-md);
    background: var(--gray-100);
    color: var(--gray-600);
    flex-shrink: 0;
}

.model-icon-wrapper.telecom {
    background: #e0f2fe;
    /* sky-100 */
    color: #0284c7;
    /* sky-600 */
}

.model-icon-wrapper.turkmen {
    background: #fdf2f8;
    /* pink-100 */
    color: #db2777;
    /* pink-600 */
}

/* Easter Egg: WarexAI - Special purple theme */
.model-icon-wrapper.warex {
    background: linear-gradient(135deg, #7c3aed 0%, #c026d3 100%);
    color: white;
}

/* Hidden model option styling */
.model-option-hidden {
    display: none;
    opacity: 0;
    transform: translateY(-10px);
}

.model-option-hidden.revealed {
    display: flex;
    opacity: 1;
    transform: translateY(0);
    animation: revealModel 0.5s ease-out forwards;
}

@keyframes revealModel {
    0% {
        opacity: 0;
        transform: translateY(-10px);
        background: linear-gradient(135deg, #7c3aed 0%, #c026d3 100%);
    }

    50% {
        background: linear-gradient(135deg, #7c3aed 0%, #c026d3 100%);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
        background: transparent;
    }
}

.model-info {
    flex: 1;
}

.model-option-name {
    display: block;
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--gray-800);
    margin-bottom: 0.125rem;
}

.model-desc {
    font-size: 0.75rem;
    color: var(--gray-500);
    line-height: 1.4;
}

.check-icon {
    color: var(--primary-600);
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.model-option.active .check-icon {
    opacity: 1;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* -----------------------------------------------------------------------------
   Messages Container
   ----------------------------------------------------------------------------- */
.messages-container {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
}

.welcome-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 3rem 1.5rem;
    min-height: 100%;
}

.welcome-logo {
    margin-bottom: 1.5rem;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

.welcome-screen h2 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--gray-800);
    margin-bottom: 0.5rem;
}

.welcome-screen>p {
    color: var(--gray-500);
    font-size: 1rem;
    margin-bottom: 2rem;
}

.welcome-suggestions {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    width: 100%;
    max-width: 500px;
}

.suggestion-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 1rem;
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    color: var(--gray-700);
    cursor: pointer;
    transition: all var(--transition-fast);
    text-align: left;
}

.suggestion-btn:hover {
    background: var(--gray-100);
    border-color: var(--gray-300);
    transform: translateY(-1px);
}

.suggestion-btn svg {
    color: var(--primary-500);
    flex-shrink: 0;
}

/* Messages */
.messages {
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
}

.message {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1rem;
    animation: fadeIn var(--transition-normal);
    max-width: 85%;
}

/* User messages - aligned right */
.message-user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

/* Assistant messages - aligned left */
.message-assistant {
    align-self: flex-start;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message-avatar {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.message-user .message-avatar {
    background: var(--primary-500);
    color: white;
}

.message-assistant .message-avatar {
    background: var(--gradient-primary);
    color: white;
}

.message-content {
    padding: 0.875rem 1rem;
    border-radius: var(--radius-lg);
    line-height: 1.7;
    max-width: 100%;
    word-wrap: break-word;
}

.message-user .message-content {
    background: var(--primary-500);
    color: white;
    border-bottom-right-radius: var(--radius-sm);
}

.message-user .message-content a {
    color: white;
    text-decoration: underline;
}

.message-assistant .message-content {
    background: var(--gray-100);
    color: var(--gray-800);
    border-bottom-left-radius: var(--radius-sm);
}

/* Markdown styles in messages */
.message-content p {
    margin-bottom: 0.75rem;
}

.message-content p:last-child {
    margin-bottom: 0;
}

.message-content code {
    background: rgba(0, 0, 0, 0.06);
    padding: 0.125rem 0.375rem;
    border-radius: var(--radius-sm);
    font-family: 'SF Mono', Monaco, Consolas, monospace;
    font-size: 0.875em;
}

.message-content pre {
    background: var(--gray-800);
    color: var(--gray-100);
    padding: 1rem;
    border-radius: var(--radius-md);
    overflow-x: auto;
    margin: 0.75rem 0;
}

.message-content pre code {
    background: none;
    padding: 0;
    color: inherit;
}

.message-content ul,
.message-content ol {
    margin: 0.75rem 0;
    padding-left: 1.5rem;
}

.message-content li {
    margin-bottom: 0.25rem;
}

.message-content a {
    color: var(--primary-600);
    text-decoration: none;
}

.message-content a:hover {
    text-decoration: underline;
}

/* Typing indicator */
.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 0.5rem;
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    background: var(--gray-400);
    border-radius: 50%;
    animation: bounce 1.4s ease-in-out infinite both;
}

.typing-indicator span:nth-child(1) {
    animation-delay: -0.32s;
}

.typing-indicator span:nth-child(2) {
    animation-delay: -0.16s;
}

.typing-indicator span:nth-child(3) {
    animation-delay: 0s;
}

@keyframes bounce {

    0%,
    80%,
    100% {
        transform: scale(0);
    }

    40% {
        transform: scale(1);
    }
}

/* -----------------------------------------------------------------------------
   Input Area
   ----------------------------------------------------------------------------- */
.input-container {
    padding: 1rem 1.5rem 1.5rem;
    background: white;
    border-top: 1px solid var(--gray-100);
}

.input-form {
    max-width: 800px;
    margin: 0 auto;
}

.input-wrapper {
    display: flex;
    align-items: flex-end;
    gap: 0.75rem;
    padding: 0.75rem;
    background: var(--gray-50);
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius-lg);
    transition: all var(--transition-fast);
}

.input-wrapper:focus-within {
    border-color: var(--primary-500);
    background: white;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.input-wrapper textarea {
    flex: 1;
    padding: 0.5rem;
    min-height: 24px;
    max-height: 150px;
    font-size: 0.9375rem;
    font-family: inherit;
    color: var(--gray-800);
    background: transparent;
    border: none;
    outline: none;
    resize: none;
    line-height: 1.5;
}

.input-wrapper textarea::placeholder {
    color: var(--gray-400);
}

.btn-send {
    width: 40px;
    height: 40px;
    padding: 0;
    background: var(--gradient-primary);
    border: none;
    border-radius: var(--radius-md);
    color: white;
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-send:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.btn-send:not(:disabled):hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-md);
}

.input-hint {
    margin-top: 0.5rem;
    text-align: center;
    font-size: 0.75rem;
    color: var(--gray-400);
}

/* -----------------------------------------------------------------------------
   Version Footer (Chat)
   ----------------------------------------------------------------------------- */
.chat-version-footer {
    position: fixed;
    bottom: 0.5rem;
    right: 1rem;
    font-size: 0.6875rem;
    color: var(--gray-400);
    z-index: 50;
}

/* -----------------------------------------------------------------------------
   Mobile Overlay
   ----------------------------------------------------------------------------- */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 90;
}

/* -----------------------------------------------------------------------------
   Delete Button Styling
   ----------------------------------------------------------------------------- */
.chat-item-delete {
    opacity: 0;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    color: var(--gray-400);
    background: transparent;
    border: none;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.chat-item:hover .chat-item-delete {
    opacity: 1;
}

.chat-item-delete:hover {
    background: var(--gray-200);
    color: var(--error-500);
}

/* -----------------------------------------------------------------------------
   Toast Notifications
   ----------------------------------------------------------------------------- */
.toast-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-width: 400px;
    pointer-events: none;
}

.toast {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    background: white;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg), 0 0 0 1px rgba(0, 0, 0, 0.05);
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: auto;
}

.toast-show {
    opacity: 1;
    transform: translateX(0);
}

.toast-icon {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.toast-message {
    flex: 1;
    font-size: 0.875rem;
    color: var(--gray-700);
    line-height: 1.4;
}

.toast-close {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    color: var(--gray-400);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.toast-close:hover {
    background: var(--gray-100);
    color: var(--gray-600);
}

/* Toast Types */
.toast-success .toast-icon {
    color: var(--success-500);
}

.toast-error {
    border-left: 3px solid var(--error-500);
}

.toast-error .toast-icon {
    color: var(--error-500);
}

.toast-warning {
    border-left: 3px solid var(--warning-500);
}

.toast-warning .toast-icon {
    color: var(--warning-500);
}

.toast-info {
    border-left: 3px solid var(--primary-500);
}

.toast-info .toast-icon {
    color: var(--primary-500);
}

/* -----------------------------------------------------------------------------
   Responsive Design
   ----------------------------------------------------------------------------- */
@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        transform: translateX(-100%);
        width: 280px;
        box-shadow: var(--shadow-xl);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .sidebar-overlay.visible {
        display: block;
    }

    .mobile-menu-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 40px;
        height: 40px;
        padding: 0;
        background: transparent;
        border: none;
        border-radius: var(--radius-md);
        color: var(--gray-600);
        cursor: pointer;
        transition: all var(--transition-fast);
    }

    .mobile-menu-btn:hover {
        background: var(--gray-100);
    }

    .welcome-suggestions {
        grid-template-columns: 1fr;
    }

    .auth-card {
        padding: 1.5rem;
    }

    .messages-container {
        padding: 1rem;
    }

    .input-container {
        padding: 0.75rem 1rem 1rem;
    }

    .message {
        flex-direction: column;
        gap: 0.5rem;
    }

    .message-avatar {
        width: 28px;
        height: 28px;
    }

    .message-content {
        padding: 0.875rem 1rem;
    }

    .chat-header {
        padding: 0 1rem;
    }

    .chat-header-title h1 {
        font-size: 1rem;
    }

    .welcome-screen h2 {
        font-size: 1.5rem;
    }

    /* Toast on mobile */
    .toast-container {
        left: 1rem;
        right: 1rem;
        max-width: none;
    }

    .toast {
        transform: translateY(-100%);
    }

    .toast-show {
        transform: translateY(0);
    }

    /* Show delete button on mobile always */
    .chat-item-delete {
        opacity: 0.7;
    }
}

@media (max-width: 480px) {
    .auth-container {
        padding: 0;
    }

    .auth-card {
        border-radius: var(--radius-lg);
        padding: 1.25rem;
    }

    .auth-title {
        font-size: 1.5rem;
    }

    .form-group input {
        padding: 0.75rem;
    }

    .btn {
        padding: 0.75rem 1rem;
    }

    .input-wrapper {
        padding: 0.5rem;
    }

    .input-wrapper textarea {
        font-size: 0.875rem;
    }
}

/* -----------------------------------------------------------------------------
   Scrollbar Styling
   ----------------------------------------------------------------------------- */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--gray-300);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--gray-400);
}