/* Reset ve Temel Ayarlar */
* { 
    margin: 0; 
    padding: 0; 
    box-sizing: border-box; 
    -webkit-tap-highlight-color: transparent; 
}

body { 
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif; 
    background: #0a0a0f; 
    color: #e8edf5; 
    height: 100vh; 
    overflow: hidden; 
    position: fixed; 
    width: 100%; 
}

/* Premium Arka Plan */
.premium-bg { 
    position: fixed; 
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%; 
    z-index: 0; 
    background: 
        radial-gradient(ellipse at 20% 30%, rgba(99,102,241,0.15), transparent 50%),
        radial-gradient(ellipse at 80% 70%, rgba(139,92,246,0.1), transparent 50%); 
}

/* Hareketli Küreler */
.orb { 
    position: absolute; 
    border-radius: 50%; 
    filter: blur(80px); 
    animation: orbFloat 20s ease-in-out infinite; 
    will-change: transform, opacity;
}

.orb-1 { 
    top: -200px; 
    left: -200px; 
    width: 400px; 
    height: 400px; 
    background: radial-gradient(circle, rgba(99,102,241,0.3), transparent); 
}

.orb-2 { 
    bottom: -200px; 
    right: -200px; 
    width: 500px; 
    height: 500px; 
    background: radial-gradient(circle, rgba(139,92,246,0.25), transparent); 
    animation-delay: 10s; 
}

.orb-3 { 
    top: 50%; 
    left: 50%; 
    width: 300px; 
    height: 300px; 
    background: radial-gradient(circle, rgba(245,158,11,0.15), transparent); 
    animation-delay: 5s; 
    transform: translate(-50%, -50%); 
}

@keyframes orbFloat { 
    0%, 100% { 
        transform: translate(0, 0) scale(1); 
        opacity: 0.5; 
    }
    50% { 
        transform: translate(50px, 50px) scale(1.1); 
        opacity: 0.8; 
    }
}

/* Parçacıklar */
.particles { 
    position: fixed; 
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%; 
    z-index: 0; 
    pointer-events: none; 
}

.particle { 
    position: absolute; 
    background: rgba(99,102,241,0.4); 
    border-radius: 50%; 
    animation: particleFloat 15s infinite linear; 
    will-change: transform, opacity;
}

@keyframes particleFloat { 
    0% { 
        transform: translateY(100vh) rotate(0deg); 
        opacity: 0; 
    }
    10% { opacity: 1; }
    90% { opacity: 1; }
    100% { 
        transform: translateY(-100vh) rotate(360deg); 
        opacity: 0; 
    }
}

/* Ana Konteynır */
.app-container { 
    display: flex; 
    height: 100vh; 
    width: 100%; 
    position: relative; 
    z-index: 1; 
    overflow: hidden; 
}

/* Sidebar */
.sidebar { 
    width: 320px; 
    background: rgba(15, 23, 42, 0.95); 
    backdrop-filter: blur(20px); 
    -webkit-backdrop-filter: blur(20px);
    border-right: 1px solid rgba(255,255,255,0.08); 
    display: flex; 
    flex-direction: column; 
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1); 
    z-index: 100; 
    flex-shrink: 0; 
}

/* Ana Sohbet */
.main-chat { 
    flex: 1; 
    display: flex; 
    flex-direction: column; 
    background: rgba(10,10,15,0.2); 
    min-width: 0; 
    position: relative; 
}

/* Sidebar Header */
.sidebar-header { 
    padding: 1.5rem; 
    border-bottom: 1px solid rgba(255,255,255,0.08); 
}

.logo { 
    display: flex; 
    align-items: center; 
    gap: 12px; 
}

.logo-icon { 
    width: 52px; 
    height: 52px; 
    background: linear-gradient(135deg, #6366f1, #8b5cf6); 
    border-radius: 18px; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    font-size: 1.6rem; 
    position: relative; 
    overflow: hidden; 
    box-shadow: 0 10px 25px -5px rgba(99,102,241,0.4); 
    flex-shrink: 0;
}

.logo-icon::before { 
    content: ''; 
    position: absolute; 
    inset: -2px; 
    background: linear-gradient(135deg, #6366f1, #8b5cf6, #06b6d4); 
    border-radius: 20px; 
    opacity: 0.5; 
    filter: blur(8px); 
    animation: pulseGlow 2s infinite; 
}

@keyframes pulseGlow { 
    0%, 100% { 
        opacity: 0.3; 
        transform: scale(1); 
    }
    50% { 
        opacity: 0.8; 
        transform: scale(1.05); 
    }
}

.logo-icon i { 
    position: relative; 
    z-index: 1; 
}

.logo-text h2 { 
    font-size: 1.3rem; 
    font-weight: 800; 
    background: linear-gradient(135deg, #fff, #a78bfa, #6366f1); 
    -webkit-background-clip: text; 
    -webkit-text-fill-color: transparent; 
    background-clip: text;
}

.logo-text p { 
    font-size: 0.7rem; 
    color: rgba(255,255,255,0.45); 
    letter-spacing: 0.5px; 
}

/* Yeni Sohbet Butonu */
.new-chat-btn { 
    margin: 1rem; 
    background: linear-gradient(135deg, #6366f1, #8b5cf6); 
    border: none; 
    color: white; 
    padding: 0.9rem; 
    border-radius: 16px; 
    font-weight: 600; 
    cursor: pointer; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    gap: 0.6rem; 
    transition: all 0.2s; 
    box-shadow: 0 4px 15px rgba(99,102,241,0.3); 
}

.new-chat-btn:hover { 
    transform: translateY(-2px); 
    box-shadow: 0 6px 25px rgba(99,102,241,0.4); 
}

.new-chat-btn:active { 
    transform: scale(0.97); 
}

/* Geçmiş Listesi */
.history-list { 
    flex: 1; 
    overflow-y: auto; 
    padding: 0 0.75rem; 
}

.history-list::-webkit-scrollbar { 
    width: 4px; 
}

.history-list::-webkit-scrollbar-track { 
    background: rgba(255,255,255,0.05); 
    border-radius: 10px; 
}

.history-list::-webkit-scrollbar-thumb { 
    background: linear-gradient(135deg, #6366f1, #8b5cf6); 
    border-radius: 10px; 
}

.history-item { 
    padding: 0.9rem; 
    border-radius: 14px; 
    margin-bottom: 0.6rem; 
    cursor: pointer; 
    transition: all 0.2s; 
    border: 1px solid rgba(255,255,255,0.05); 
    background: rgba(255,255,255,0.02); 
}

.history-item:hover { 
    background: rgba(99,102,241,0.12); 
    border-color: rgba(99,102,241,0.3); 
    transform: translateX(4px); 
}

.history-item:active { 
    transform: scale(0.98); 
}

.history-item.active { 
    background: rgba(99,102,241,0.18); 
    border-color: #6366f1; 
}

.history-message { 
    font-size: 0.8rem; 
    font-weight: 500; 
    white-space: nowrap; 
    overflow: hidden; 
    text-overflow: ellipsis; 
    margin-bottom: 0.25rem; 
}

.history-date { 
    font-size: 0.6rem; 
    color: rgba(255,255,255,0.4); 
}

.history-files { 
    display: inline-flex; 
    align-items: center; 
    gap: 0.2rem; 
    font-size: 0.6rem; 
    color: #f59e0b; 
    margin-top: 0.2rem; 
}

/* Sidebar Navigasyon */
.sidebar-nav { 
    padding: 0 0.75rem 1rem; 
    border-top: 1px solid rgba(255,255,255,0.08); 
    margin-top: 1rem; 
}

.nav-item { 
    display: flex; 
    align-items: center; 
    gap: 12px; 
    padding: 0.7rem 1rem; 
    border-radius: 12px; 
    color: rgba(255,255,255,0.6); 
    text-decoration: none; 
    transition: all 0.2s; 
}

.nav-item:hover { 
    background: rgba(99,102,241,0.15); 
    color: #818cf8; 
    transform: translateX(4px); 
}

.nav-item:active { 
    transform: scale(0.98); 
}

.nav-item i { 
    width: 24px; 
    font-size: 1.1rem; 
}

/* Kullanıcı Bilgisi */
.user-info { 
    padding: 1rem; 
    border-top: 1px solid rgba(255,255,255,0.08); 
    display: flex; 
    align-items: center; 
    gap: 12px; 
    background: rgba(0,0,0,0.25); 
    backdrop-filter: blur(10px); 
    -webkit-backdrop-filter: blur(10px);
}

.user-avatar { 
    width: 44px; 
    height: 44px; 
    background: linear-gradient(135deg, #10b981, #059669); 
    border-radius: 50%; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    font-weight: 700; 
    font-size: 1.1rem; 
    position: relative; 
    box-shadow: 0 4px 12px rgba(16,185,129,0.3); 
    flex-shrink: 0;
}

.user-avatar::after { 
    content: ''; 
    position: absolute; 
    bottom: 2px; 
    right: 2px; 
    width: 10px; 
    height: 10px; 
    background: #10b981; 
    border-radius: 50%; 
    border: 2px solid rgba(15,23,42,0.8); 
    animation: pulse 1.5s infinite; 
}

@keyframes pulse { 
    0%, 100% { 
        transform: scale(1); 
        opacity: 1; 
    }
    50% { 
        transform: scale(1.2); 
        opacity: 0.7; 
    }
}

.user-details { 
    flex: 1; 
    min-width: 0; 
}

.user-name { 
    font-size: 0.85rem; 
    font-weight: 600; 
    white-space: nowrap; 
    overflow: hidden; 
    text-overflow: ellipsis; 
}

.user-credits { 
    font-size: 0.7rem; 
    color: #f59e0b; 
    display: inline-flex; 
    align-items: center; 
    gap: 5px; 
    background: rgba(245,158,11,0.15); 
    padding: 0.25rem 0.7rem; 
    border-radius: 20px; 
    margin-top: 4px; 
}

/* Chat Header */
.chat-header { 
    padding: 1rem 1.5rem; 
    border-bottom: 1px solid rgba(255,255,255,0.06); 
    background: rgba(10,10,15,0.5); 
    backdrop-filter: blur(10px); 
    -webkit-backdrop-filter: blur(10px);
    display: flex; 
    align-items: center; 
    justify-content: space-between; 
    flex-wrap: wrap; 
    gap: 10px; 
    flex-shrink: 0;
}

.menu-toggle { 
    display: none; 
    background: rgba(255,255,255,0.08); 
    border: 1px solid rgba(255,255,255,0.1); 
    width: 44px; 
    height: 44px; 
    border-radius: 14px; 
    color: white; 
    cursor: pointer; 
    transition: all 0.2s; 
    align-items: center;
    justify-content: center;
}

.menu-toggle:hover { 
    background: rgba(99,102,241,0.2); 
    border-color: #6366f1; 
}

.menu-toggle:active { 
    transform: scale(0.95); 
}

.status-dot { 
    width: 8px; 
    height: 8px; 
    background: #10b981; 
    border-radius: 50%; 
    animation: blink 1.5s infinite; 
    display: inline-block; 
    margin-right: 8px; 
    box-shadow: 0 0 5px #10b981; 
}

@keyframes blink { 
    0%, 100% { 
        opacity: 1; 
    }
    50% { 
        opacity: 0.4; 
    }
}

.cost-badge { 
    background: rgba(245,158,11,0.15); 
    padding: 0.35rem 0.9rem; 
    border-radius: 40px; 
    font-size: 0.7rem; 
    color: #f59e0b; 
    display: flex; 
    align-items: center; 
    gap: 6px; 
    border: 1px solid rgba(245,158,11,0.2); 
    white-space: nowrap; 
}

/* Chat Messages */
.chat-messages { 
    flex: 1; 
    overflow-y: auto; 
    padding: 1.5rem; 
    scroll-behavior: smooth; 
    -webkit-overflow-scrolling: touch; 
}

.chat-messages::-webkit-scrollbar { 
    width: 5px; 
}

.chat-messages::-webkit-scrollbar-track { 
    background: rgba(255,255,255,0.05); 
    border-radius: 10px; 
}

.chat-messages::-webkit-scrollbar-thumb { 
    background: linear-gradient(135deg, #6366f1, #8b5cf6); 
    border-radius: 10px; 
}

/* Welcome Screen */
.welcome-screen { 
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    justify-content: center; 
    min-height: 60vh; 
    text-align: center; 
    padding: 1rem; 
    animation: fadeIn 0.6s ease; 
}

@keyframes fadeIn { 
    from { 
        opacity: 0; 
        transform: scale(0.95); 
    }
    to { 
        opacity: 1; 
        transform: scale(1); 
    }
}

.welcome-icon { 
    width: 110px; 
    height: 110px; 
    background: linear-gradient(135deg, rgba(99,102,241,0.2), rgba(139,92,246,0.1)); 
    border-radius: 36px; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    font-size: 3.5rem; 
    margin-bottom: 1.5rem; 
    border: 1px solid rgba(99,102,241,0.4); 
    animation: float 3s ease-in-out infinite; 
    box-shadow: 0 20px 40px rgba(0,0,0,0.2); 
}

@keyframes float { 
    0%, 100% { 
        transform: translateY(0); 
    }
    50% { 
        transform: translateY(-12px); 
    }
}

.welcome-screen h1 { 
    font-size: 2rem; 
    font-weight: 800; 
    margin-bottom: 0.5rem; 
    background: linear-gradient(135deg, #fff, #a78bfa, #6366f1); 
    -webkit-background-clip: text; 
    -webkit-text-fill-color: transparent; 
    background-clip: text;
}

.welcome-screen p { 
    color: rgba(255,255,255,0.5); 
    margin-bottom: 1.5rem; 
}

/* Suggestion Buttons */
.suggestion-buttons { 
    display: flex; 
    gap: 0.8rem; 
    justify-content: center; 
    margin-top: 1rem; 
    flex-wrap: wrap; 
}

.suggestion-btn { 
    background: rgba(26,31,45,0.8); 
    padding: 0.6rem 1.2rem; 
    border-radius: 40px; 
    cursor: pointer; 
    transition: all 0.2s; 
    font-size: 0.85rem; 
    border: 1px solid rgba(255,255,255,0.08); 
    user-select: none;
}

.suggestion-btn:hover { 
    background: #6366f1; 
    transform: translateY(-3px); 
    box-shadow: 0 5px 15px rgba(99,102,241,0.3); 
}

.suggestion-btn:active { 
    transform: scale(0.96); 
}

/* Messages */
.message { 
    display: flex; 
    gap: 0.8rem; 
    margin-bottom: 1.2rem; 
    animation: slideIn 0.3s ease; 
}

@keyframes slideIn { 
    from { 
        opacity: 0; 
        transform: translateX(-20px); 
    }
    to { 
        opacity: 1; 
        transform: translateX(0); 
    }
}

.message.user { 
    justify-content: flex-end; 
}

.message.user .message-content { 
    animation: slideInRight 0.3s ease; 
}

@keyframes slideInRight { 
    from { 
        opacity: 0; 
        transform: translateX(20px); 
    }
    to { 
        opacity: 1; 
        transform: translateX(0); 
    }
}

.message-avatar { 
    width: 42px; 
    height: 42px; 
    border-radius: 16px; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    flex-shrink: 0; 
    font-size: 1.1rem; 
}

.message-avatar.ai { 
    background: linear-gradient(135deg, #6366f1, #8b5cf6); 
    box-shadow: 0 4px 12px rgba(99,102,241,0.4); 
}

.message-avatar.user { 
    background: linear-gradient(135deg, #10b981, #059669); 
    order: 2; 
    box-shadow: 0 4px 12px rgba(16,185,129,0.3); 
}

.message-content { 
    max-width: 75%; 
    padding: 0.9rem 1.3rem; 
    border-radius: 24px; 
    line-height: 1.5; 
    font-size: 0.9rem; 
    word-wrap: break-word; 
    overflow-wrap: break-word;
}

.message.ai .message-content { 
    background: rgba(26,31,45,0.85); 
    border: 1px solid rgba(255,255,255,0.06); 
    border-top-left-radius: 6px; 
    backdrop-filter: blur(10px); 
    -webkit-backdrop-filter: blur(10px);
}

.message.user .message-content { 
    background: linear-gradient(135deg, #6366f1, #8b5cf6); 
    border-top-right-radius: 6px; 
}

.message-time { 
    font-size: 0.55rem; 
    color: rgba(255,255,255,0.4); 
    margin-top: 0.4rem; 
    display: flex; 
    align-items: center; 
    gap: 0.5rem; 
    flex-wrap: wrap; 
}

.file-attachment { 
    display: inline-flex; 
    align-items: center; 
    gap: 0.3rem; 
    background: rgba(0,0,0,0.4); 
    padding: 0.25rem 0.7rem; 
    border-radius: 20px; 
    font-size: 0.65rem; 
    margin-top: 0.4rem; 
}

.file-attachment a { 
    color: #818cf8; 
    text-decoration: none; 
}

.file-attachment a:hover { 
    text-decoration: underline; 
}

/* Typing Indicator */
.typing-indicator { 
    display: flex; 
    gap: 6px; 
    padding: 0.9rem 1.3rem; 
    background: rgba(26,31,45,0.85); 
    border-radius: 24px; 
    border-top-left-radius: 6px; 
    width: fit-content; 
    border: 1px solid rgba(255,255,255,0.06); 
}

.typing-indicator span { 
    width: 8px; 
    height: 8px; 
    background: #818cf8; 
    border-radius: 50%; 
    animation: typeBlink 1.4s infinite; 
}

.typing-indicator span:nth-child(2) { 
    animation-delay: 0.2s; 
}

.typing-indicator span:nth-child(3) { 
    animation-delay: 0.4s; 
}

@keyframes typeBlink { 
    0%, 60%, 100% { 
        transform: translateY(0); 
        opacity: 0.4; 
    }
    30% { 
        transform: translateY(-10px); 
        opacity: 1; 
    }
}

/* Chat Input */
.chat-input-area { 
    padding: 1rem 1.5rem 1.5rem; 
    border-top: 1px solid rgba(255,255,255,0.06); 
    background: rgba(10,10,15,0.7); 
    backdrop-filter: blur(20px); 
    -webkit-backdrop-filter: blur(20px);
    flex-shrink: 0;
}

.input-wrapper { 
    display: flex; 
    gap: 0.8rem; 
    align-items: flex-end; 
}

.input-wrapper textarea { 
    flex: 1; 
    background: rgba(26,31,45,0.95); 
    border: 1px solid rgba(255,255,255,0.1); 
    border-radius: 28px; 
    padding: 0.9rem 1.2rem; 
    color: #e8edf5; 
    font-family: inherit; 
    font-size: 0.9rem; 
    resize: none; 
    max-height: 120px; 
    min-height: 48px;
    transition: all 0.2s; 
    line-height: 1.5;
}

.input-wrapper textarea:focus { 
    outline: none; 
    border-color: #6366f1; 
    box-shadow: 0 0 0 4px rgba(99,102,241,0.15); 
}

.input-wrapper textarea::placeholder {
    color: rgba(255,255,255,0.3);
}

.file-btn { 
    background: rgba(255,255,255,0.06); 
    border: 1px solid rgba(255,255,255,0.1); 
    color: white; 
    width: 48px; 
    height: 48px; 
    border-radius: 50%; 
    cursor: pointer; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    transition: all 0.2s; 
    flex-shrink: 0;
}

.file-btn:hover { 
    background: rgba(99,102,241,0.2); 
    border-color: #6366f1; 
    transform: scale(1.05); 
}

.file-btn:active { 
    transform: scale(0.95); 
}

.send-btn { 
    background: linear-gradient(135deg, #6366f1, #8b5cf6); 
    border: none; 
    color: white; 
    width: 48px; 
    height: 48px; 
    border-radius: 50%; 
    cursor: pointer; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    transition: all 0.2s; 
    box-shadow: 0 4px 12px rgba(99,102,241,0.3); 
    flex-shrink: 0;
}

.send-btn:hover { 
    transform: scale(1.05); 
    box-shadow: 0 6px 20px rgba(99,102,241,0.4); 
}

.send-btn:active { 
    transform: scale(0.95); 
}

.send-btn:disabled { 
    opacity: 0.5; 
    cursor: not-allowed; 
    transform: none; 
}

/* File List */
.file-list { 
    display: flex; 
    flex-wrap: wrap; 
    gap: 0.5rem; 
    margin-top: 0.8rem; 
    padding: 0.5rem; 
    background: rgba(0,0,0,0.2); 
    border-radius: 16px; 
}

.file-preview { 
    display: inline-flex; 
    align-items: center; 
    gap: 0.5rem; 
    background: rgba(99,102,241,0.15); 
    padding: 0.35rem 0.8rem; 
    border-radius: 24px; 
    font-size: 0.7rem; 
    border: 1px solid rgba(99,102,241,0.2); 
}

.remove-file { 
    cursor: pointer; 
    margin-left: 0.4rem; 
    color: #ef4444; 
    transition: all 0.2s; 
}

.remove-file:hover { 
    transform: scale(1.1); 
}

.remove-file:active { 
    transform: scale(0.9); 
}

/* Input Info */
.input-info { 
    display: flex; 
    justify-content: space-between; 
    margin-top: 0.7rem; 
    font-size: 0.65rem; 
    color: rgba(255,255,255,0.35); 
    flex-wrap: wrap; 
    gap: 0.5rem; 
}

/* Toast Notification */
.toast-notification { 
    position: fixed; 
    bottom: 30px; 
    left: 50%; 
    transform: translateX(-50%); 
    background: linear-gradient(135deg, #1a1a2e, #16213e); 
    color: white; 
    padding: 12px 24px; 
    border-radius: 60px; 
    z-index: 9999; 
    font-size: 14px; 
    font-weight: 500; 
    box-shadow: 0 10px 25px rgba(0,0,0,0.2); 
    border: 1px solid rgba(99,102,241,0.3); 
    animation: toastSlide 0.3s ease; 
    max-width: 90vw; 
    text-align: center; 
    pointer-events: none;
}

@keyframes toastSlide { 
    from { 
        opacity: 0; 
        transform: translateX(-50%) translateY(20px); 
    }
    to { 
        opacity: 1; 
        transform: translateX(-50%) translateY(0); 
    }
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar { 
        position: fixed; 
        left: -320px; 
        top: 0; 
        bottom: 0; 
        z-index: 200; 
        box-shadow: 0 0 30px rgba(0,0,0,0.5); 
    }
    
    .sidebar.open { 
        left: 0; 
    }
    
    .menu-toggle { 
        display: flex; 
    }
    
    .chat-messages { 
        padding: 1rem; 
    }
    
    .message-content { 
        max-width: 85%; 
        font-size: 0.85rem; 
        padding: 0.7rem 1rem; 
    }
    
    .welcome-screen h1 { 
        font-size: 1.5rem; 
    }
    
    .welcome-icon { 
        width: 80px; 
        height: 80px; 
        font-size: 2.5rem; 
    }
    
    .chat-header { 
        padding: 0.8rem 1rem; 
    }
    
    .chat-input-area { 
        padding: 0.8rem 1rem 1rem; 
    }
    
    .message-avatar { 
        width: 36px; 
        height: 36px; 
        font-size: 0.9rem; 
    }
    
    .suggestion-btn { 
        padding: 0.5rem 1rem; 
        font-size: 0.75rem; 
    }
    
    .cost-badge { 
        font-size: 0.6rem; 
        padding: 0.25rem 0.7rem; 
    }
    
    .new-chat-btn { 
        margin: 0.8rem; 
        padding: 0.7rem; 
        font-size: 0.9rem; 
    }
    
    .sidebar-header { 
        padding: 1rem; 
    }
    
    .logo-icon { 
        width: 44px; 
        height: 44px; 
        font-size: 1.3rem; 
    }
    
    .logo-text h2 { 
        font-size: 1.1rem; 
    }
    
    .user-avatar { 
        width: 38px; 
        height: 38px; 
        font-size: 0.9rem; 
    }
    
    .user-name { 
        font-size: 0.75rem; 
    }
    
    .user-credits { 
        font-size: 0.6rem; 
    }
}

@media (max-width: 480px) {
    .message-avatar { 
        width: 32px; 
        height: 32px; 
        font-size: 0.8rem; 
        border-radius: 12px; 
    }
    
    .message-content { 
        max-width: 85%; 
        padding: 0.6rem 0.9rem; 
        font-size: 0.8rem; 
    }
    
    .chat-header { 
        flex-direction: row; 
        flex-wrap: wrap; 
    }
    
    .cost-badge { 
        font-size: 0.55rem; 
        padding: 0.2rem 0.6rem; 
    }
    
    .file-btn, .send-btn { 
        width: 42px; 
        height: 42px; 
    }
    
    .input-wrapper textarea { 
        font-size: 0.85rem; 
        padding: 0.7rem 1rem; 
    }
    
    .welcome-screen h1 { 
        font-size: 1.3rem; 
    }
    
    .welcome-icon { 
        width: 70px; 
        height: 70px; 
        font-size: 2rem; 
    }
    
    .suggestion-buttons { 
        gap: 0.5rem; 
    }
    
    .suggestion-btn { 
        padding: 0.4rem 0.8rem; 
        font-size: 0.7rem; 
    }
    
    .toast-notification { 
        font-size: 12px; 
        padding: 10px 18px; 
    }
}

@media (max-width: 380px) {
    .chat-header { 
        flex-direction: column; 
        align-items: flex-start; 
    }
    
    .cost-badge { 
        align-self: flex-start; 
    }
}

@media (max-height: 500px) and (orientation: landscape) {
    .welcome-screen { 
        min-height: 40vh; 
    }
    
    .welcome-icon { 
        width: 60px; 
        height: 60px; 
        font-size: 1.8rem; 
        margin-bottom: 0.8rem; 
    }
    
    .welcome-screen h1 { 
        font-size: 1.2rem; 
        margin-bottom: 0.3rem; 
    }
    
    .chat-messages { 
        padding: 0.8rem; 
    }
    
    .message { 
        margin-bottom: 0.8rem; 
    }
    
    .message-avatar { 
        width: 30px; 
        height: 30px; 
        font-size: 0.7rem; 
    }
    
    .message-content { 
        padding: 0.5rem 0.8rem; 
        font-size: 0.75rem; 
    }
    
    .sidebar { 
        width: 280px; 
    }
}

/* Touch Device Optimizations */
@media (hover: none) and (pointer: coarse) {
    .history-item, .nav-item, .suggestion-btn, .file-btn, .send-btn { 
        cursor: default; 
    }
    
    .history-item:active { 
        background: rgba(99,102,241,0.2); 
        transform: scale(0.98); 
    }
    
    .suggestion-btn:active { 
        background: #6366f1; 
        transform: scale(0.96); 
    }
    
    .send-btn:active, .file-btn:active { 
        transform: scale(0.95); 
    }
}

/* Print Styles */
@media print {
    .sidebar, .chat-input-area, .menu-toggle, .cost-badge {
        display: none !important;
    }
    
    .main-chat {
        background: white !important;
    }
    
    .message-content {
        color: black !important;
        background: #f5f5f5 !important;
    }
}