/**
 * SunixBot - Tatlı & Çekici Chat Arayüzü
 * Pastel Renkler + Yumuşak Tasarım + Sevimli Robot
 */

/* ================================================
   CSS DEĞİŞKENLERİ
   ================================================ */
:root {
    /* Ana Renkler - Daha yumuşak ve tatlı */
    --sb-primary: #103595;
    --sb-primary-light: #4f6ec7;
    --sb-primary-soft: #e8eeff;
    --sb-primary-rgb: 16, 53, 149;

    /* Pastel & Tatlı Renkler */
    --sb-pink: #fce7f3;
    --sb-pink-dark: #f9a8d4;
    --sb-blue: #dbeafe;
    --sb-blue-dark: #93c5fd;
    --sb-purple: #ede9fe;
    --sb-yellow: #fef3c7;
    --sb-yellow-dark: #fbbf24;
    --sb-mint: #d1fae5;
    --sb-peach: #ffedd5;

    /* Durumlar */
    --sb-success: #34d399;
    --sb-warning: #fbbf24;
    --sb-error: #f87171;

    /* Arka Plan & Yüzeyler */
    --sb-bg: linear-gradient(135deg, #f0f4ff 0%, #fdf2f8 50%, #f0fdf4 100%);
    --sb-surface: #ffffff;
    --sb-surface-soft: rgba(255, 255, 255, 0.9);

    /* Metin Renkleri */
    --sb-text-primary: #1e293b;
    --sb-text-secondary: #64748b;
    --sb-text-muted: #94a3b8;
    --sb-text-inverse: #ffffff;

    /* Kenarlıklar & Gölgeler */
    --sb-border: #e2e8f0;
    --sb-shadow-soft: 0 4px 20px rgba(0, 0, 0, 0.06);
    --sb-shadow-medium: 0 8px 30px rgba(0, 0, 0, 0.1);
    --sb-shadow-glow: 0 0 40px rgba(16, 53, 149, 0.15);

    /* Boyutlar */
    --sb-radius: 16px;
    --sb-radius-lg: 24px;
    --sb-radius-xl: 32px;
    --sb-radius-full: 9999px;

    /* Animasyon */
    --sb-transition: 250ms cubic-bezier(0.4, 0, 0.2, 1);

    /* Safe Area */
    --sb-safe-top: env(safe-area-inset-top, 0px);
    --sb-safe-bottom: env(safe-area-inset-bottom, 0px);
}

/* Dark Mode */
[data-theme="dark"] {
    --sb-bg: linear-gradient(135deg, #0f172a 0%, #1e1b4b 50%, #0f172a 100%);
    --sb-surface: #1e293b;
    --sb-surface-soft: rgba(30, 41, 59, 0.95);
    --sb-text-primary: #f1f5f9;
    --sb-text-secondary: #cbd5e1;
    --sb-text-muted: #64748b;
    --sb-border: #334155;
    --sb-primary-soft: #1e3a5f;
    --sb-shadow-soft: 0 4px 20px rgba(0, 0, 0, 0.3);
    --sb-shadow-glow: 0 0 40px rgba(79, 110, 199, 0.2);
}

/* ================================================
   RESET & BASE
   ================================================ */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 15px;
    line-height: 1.6;
    color: var(--sb-text-primary);
    background: var(--sb-bg);
    min-height: 100vh;
    min-height: 100dvh;
    -webkit-font-smoothing: antialiased;
    overflow: hidden;
}

/* ================================================
   ANA CONTAINER
   ================================================ */
.sunixbot-app {
    display: flex;
    flex-direction: column;
    height: 100vh;
    height: 100dvh;
    max-width: 900px;
    margin: 0 auto;
    position: relative;
}

@media (min-width: 768px) {
    .sunixbot-app {
        padding: 20px;
        height: calc(100vh - 40px);
    }
}

.chat-container {
    display: flex;
    flex-direction: column;
    flex: 1;
    background: var(--sb-surface);
    border-radius: 0;
    box-shadow: var(--sb-shadow-medium);
    overflow: hidden;
}

@media (min-width: 768px) {
    .chat-container {
        border-radius: var(--sb-radius-xl);
        box-shadow: var(--sb-shadow-glow), var(--sb-shadow-medium);
    }
}

/* ================================================
   HEADER - Tatlı & Renkli
   ================================================ */
.chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    padding-top: calc(16px + var(--sb-safe-top));
    background: linear-gradient(135deg, var(--sb-primary) 0%, var(--sb-primary-light) 100%);
    position: relative;
    overflow: hidden;
}

/* Başlangıçta header tamamen gizli */
.chat-header.header-hidden {
    display: none;
}

/* Header görünür olduğunda - animasyonlu giriş */
.chat-header.header-visible {
    display: flex;
    animation: headerSlideDown 0.4s ease-out forwards;
}

@keyframes headerSlideDown {
    0% {
        opacity: 0;
        transform: translateY(-100%);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Header gizlenirken */
.chat-header.header-hiding {
    animation: headerSlideUp 0.3s ease-in forwards;
}

@keyframes headerSlideUp {
    0% {
        opacity: 1;
        transform: translateY(0);
    }
    100% {
        opacity: 0;
        transform: translateY(-100%);
    }
}

/* Header Butonları */
.header-btn {
    height: 38px;
    padding: 0 14px;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--sb-radius);
    cursor: pointer;
    color: var(--sb-text-inverse);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    transition: var(--sb-transition);
    backdrop-filter: blur(4px);
}

.header-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-1px);
}

.header-btn:active {
    transform: translateY(0);
}

.header-btn svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.header-btn .btn-text {
    display: inline;
}

/* Tema butonu özel - sadece ikon */
.header-btn.theme-toggle {
    width: 38px;
    padding: 0;
}

.header-btn.theme-toggle .btn-text {
    display: none;
}

/* Dekoratif daireler */
.chat-header::before {
    content: '';
    position: absolute;
    top: -30px;
    right: -30px;
    width: 100px;
    height: 100px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
}

.chat-header::after {
    content: '';
    position: absolute;
    bottom: -40px;
    left: 20%;
    width: 80px;
    height: 80px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 50%;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 14px;
    position: relative;
    z-index: 1;
}

.header-avatar {
    width: 56px;
    height: 56px;
    background: linear-gradient(145deg, #ffffff 0%, #f0f4ff 100%);
    border-radius: var(--sb-radius);
    padding: 6px;
    box-shadow:
        0 4px 15px rgba(0, 0, 0, 0.15),
        0 0 0 3px rgba(255, 255, 255, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: visible;
}

.header-avatar::before {
    content: '';
    position: absolute;
    inset: -3px;
    background: linear-gradient(135deg, rgba(255,255,255,0.4), rgba(255,255,255,0.1));
    border-radius: calc(var(--sb-radius) + 3px);
    z-index: -1;
}

.header-avatar .robot-svg {
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

/* Robot Kol Animasyonu */
.header-avatar .robot-hand {
    transform-origin: 14px 89px;
    animation: robotWave 3s ease-in-out infinite;
}

@keyframes robotWave {
    0%, 100% { transform: rotate(0deg); }
    15% { transform: rotate(15deg); }
    30% { transform: rotate(-10deg); }
    45% { transform: rotate(12deg); }
    60% { transform: rotate(-5deg); }
    75% { transform: rotate(8deg); }
    90% { transform: rotate(0deg); }
}

/* Hover'da daha hızlı el sallama */
.header-avatar:hover .robot-hand {
    animation: robotWaveFast 0.6s ease-in-out infinite;
}

@keyframes robotWaveFast {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(20deg); }
    75% { transform: rotate(-15deg); }
}

.header-info h1 {
    font-size: 20px;
    font-weight: 700;
    color: var(--sb-text-inverse);
    margin-bottom: 2px;
}

.header-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.9);
}

.status-dot {
    width: 8px;
    height: 8px;
    background: var(--sb-success);
    border-radius: 50%;
    animation: pulse 2s ease-in-out infinite;
    box-shadow: 0 0 8px var(--sb-success);
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.2); opacity: 0.8; }
}

/* Yazıyor durumu */
.header-status.typing .status-dot {
    background: var(--sb-warning);
    box-shadow: 0 0 8px var(--sb-warning);
    animation: typingPulse 0.6s ease-in-out infinite;
}

.header-status.typing .status-text {
    animation: typingText 1.5s ease-in-out infinite;
}

@keyframes typingPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.3); }
}

@keyframes typingText {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    position: relative;
    z-index: 1;
}

.theme-toggle {
    /* header-btn ile birleştirildi */
    transition: var(--sb-transition);
    backdrop-filter: blur(4px);
}

.theme-toggle:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

.theme-toggle svg {
    width: 20px;
    height: 20px;
}

.theme-toggle .icon-sun { display: none; }
[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
[data-theme="dark"] .theme-toggle .icon-sun { display: block; }

.header-logo img {
    height: 34px;
    filter: brightness(0) invert(1);
    opacity: 0.9;
    transition: var(--sb-transition);
}

.header-logo:hover img {
    opacity: 1;
    transform: scale(1.05);
}

/* ================================================
   MESAJ ALANI
   ================================================ */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    scroll-behavior: smooth;
    background: linear-gradient(180deg, var(--sb-primary-soft) 0%, transparent 100px);
}

@media (min-width: 768px) {
    .chat-messages {
        padding: 32px 24px;
    }
}

/* Scrollbar */
.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
    background: transparent;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: var(--sb-border);
    border-radius: 3px;
}

/* ================================================
   WELCOME STATE - Sevimli Robot
   ================================================ */
.welcome-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 20px 15px;
    flex: 1;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.welcome-robot-container {
    position: relative;
    margin-bottom: 16px;
}

.welcome-robot {
    width: 216px;
    height: 216px;
    animation: robotFloat 3s ease-in-out infinite;
    filter: drop-shadow(0 12px 25px rgba(16, 53, 149, 0.25));
}

@keyframes robotFloat {
    0%, 100% { transform: translateY(0) rotate(-2deg); }
    50% { transform: translateY(-12px) rotate(2deg); }
}

/* Sevimli dekoratif yıldızlar */
.welcome-stars {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    pointer-events: none;
}

.star {
    position: absolute;
    font-size: 19px;
    animation: starTwinkle 2s ease-in-out infinite;
}

.star:nth-child(1) { top: 0; left: 10%; animation-delay: 0s; }
.star:nth-child(2) { top: 20%; right: 5%; animation-delay: 0.5s; }
.star:nth-child(3) { bottom: 10%; left: 0; animation-delay: 1s; }
.star:nth-child(4) { bottom: 30%; right: 10%; animation-delay: 1.5s; }

@keyframes starTwinkle {
    0%, 100% { opacity: 0.3; transform: scale(0.8); }
    50% { opacity: 1; transform: scale(1.2); }
}

.welcome-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--sb-text-primary);
    margin-bottom: 6px;
    background: linear-gradient(135deg, var(--sb-primary) 0%, var(--sb-primary-light) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.welcome-subtitle {
    font-size: 15px;
    color: var(--sb-text-secondary);
    max-width: 350px;
    line-height: 1.5;
    margin-bottom: 12px;
}

/* Quick Suggestions - Tatlı Chip'ler */
.quick-suggestions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-top: 28px;
    max-width: 450px;
}

.suggestion-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 18px;
    background: var(--sb-surface);
    border: 2px solid var(--sb-border);
    border-radius: var(--sb-radius-full);
    font-size: 14px;
    font-weight: 500;
    color: var(--sb-text-secondary);
    cursor: pointer;
    transition: var(--sb-transition);
    box-shadow: var(--sb-shadow-soft);
}

.suggestion-chip:hover {
    background: var(--sb-primary);
    border-color: var(--sb-primary);
    color: var(--sb-text-inverse);
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 8px 20px rgba(16, 53, 149, 0.25);
}

.suggestion-chip .chip-icon {
    font-size: 18px;
}

/* ================================================
   MESAJ STİLLERİ - Tatlı Balonlar
   ================================================ */
.message {
    display: flex;
    gap: 12px;
    max-width: 85%;
    animation: messageSlideIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes messageSlideIn {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Kullanıcı Mesajı */
.message.user-message {
    flex-direction: row-reverse;
    margin-left: auto;
}

/* Avatar */
.message-avatar {
    width: 40px;
    height: 40px;
    border-radius: var(--sb-radius);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--sb-surface);
    box-shadow: var(--sb-shadow-soft);
    overflow: hidden;
}

.message-avatar .mini-robot {
    width: 32px;
    height: 32px;
}

.user-message .message-avatar {
    background: linear-gradient(135deg, var(--sb-primary) 0%, var(--sb-primary-light) 100%);
    color: var(--sb-text-inverse);
    font-weight: 600;
    font-size: 15px;
}

.user-message .message-avatar .user-icon {
    width: 22px;
    height: 22px;
    color: var(--sb-text-inverse);
}

/* Mesaj İçeriği */
.message-content {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.message-bubble {
    padding: 14px 18px;
    border-radius: var(--sb-radius-lg);
    font-size: 15px;
    line-height: 1.6;
    word-wrap: break-word;
    position: relative;
}

.bot-message .message-bubble {
    background: var(--sb-surface);
    color: var(--sb-text-primary);
    border: 1px solid var(--sb-border);
    border-bottom-left-radius: 6px;
    box-shadow: var(--sb-shadow-soft);
}

.user-message .message-bubble {
    background: linear-gradient(135deg, var(--sb-primary) 0%, var(--sb-primary-light) 100%);
    color: var(--sb-text-inverse);
    border-bottom-right-radius: 6px;
    box-shadow: 0 4px 15px rgba(16, 53, 149, 0.3);
}

/* Mesaj Meta */
.message-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 4px;
}

.message-time {
    font-size: 11px;
    color: var(--sb-text-muted);
}

.user-message .message-meta {
    flex-direction: row-reverse;
}

/* Mesaj Aksiyonları */
.message-actions {
    display: flex;
    gap: 4px;
}

.action-btn {
    width: 28px;
    height: 28px;
    padding: 0;
    background: var(--sb-surface);
    border: 1px solid var(--sb-border);
    border-radius: 8px;
    cursor: pointer;
    color: var(--sb-text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--sb-transition);
}

.action-btn:hover {
    color: var(--sb-primary);
    border-color: var(--sb-primary);
    background: var(--sb-primary-soft);
}

.action-btn.active,
.action-btn.copied {
    color: var(--sb-success);
    border-color: var(--sb-success);
    background: var(--sb-mint);
}

.action-btn svg {
    width: 14px;
    height: 14px;
}

/* ================================================
   TYPING INDICATOR
   ================================================ */
.typing-indicator {
    display: flex;
    gap: 12px;
    max-width: 85%;
}

.typing-indicator .message-avatar {
    animation: avatarBounce 1s ease-in-out infinite;
}

@keyframes avatarBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

.typing-bubble {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 16px 20px;
    background: var(--sb-surface);
    border: 1px solid var(--sb-border);
    border-radius: var(--sb-radius-lg);
    border-bottom-left-radius: 6px;
    box-shadow: var(--sb-shadow-soft);
}

.typing-bubble span {
    width: 8px;
    height: 8px;
    background: var(--sb-primary);
    border-radius: 50%;
    animation: typingDot 1.4s ease-in-out infinite;
}

.typing-bubble span:nth-child(1) { animation-delay: 0s; }
.typing-bubble span:nth-child(2) { animation-delay: 0.2s; }
.typing-bubble span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingDot {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.4;
    }
    30% {
        transform: translateY(-8px);
        opacity: 1;
    }
}

/* ================================================
   HATA MESAJI
   ================================================ */
.message.error-message .message-bubble {
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
    color: #991b1b;
    border: 1px solid #fecaca;
}

[data-theme="dark"] .message.error-message .message-bubble {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.15) 0%, rgba(239, 68, 68, 0.1) 100%);
    color: #fca5a5;
    border-color: rgba(239, 68, 68, 0.3);
}

/* ================================================
   INPUT ALANI - Yumuşak & Tatlı
   ================================================ */
.chat-input-container {
    padding: 16px 20px;
    padding-bottom: calc(16px + var(--sb-safe-bottom));
    background: var(--sb-surface);
    border-top: 1px solid var(--sb-border);
}

@media (min-width: 768px) {
    .chat-input-container {
        padding: 20px 24px;
    }
}

.chat-form {
    display: flex;
    align-items: flex-end;
    gap: 12px;
}

.input-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--sb-surface);
    border: 2px solid var(--sb-border);
    border-radius: var(--sb-radius-xl);
    padding: 14px 14px 14px 22px;
    transition: var(--sb-transition);
    box-shadow: var(--sb-shadow-soft);
}

.input-wrapper:focus-within {
    border-color: var(--sb-primary);
    background: var(--sb-surface);
    box-shadow: 0 0 0 4px rgba(var(--sb-primary-rgb), 0.12), var(--sb-shadow-soft);
}

#messageInput {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 16px;
    line-height: 1.5;
    resize: none;
    max-height: 120px;
    min-height: 24px;
    font-family: inherit;
    font-weight: 500;
    color: var(--sb-text-primary);
    padding: 0;
    display: flex;
    align-items: center;
}

#messageInput::placeholder {
    color: var(--sb-text-muted);
    font-weight: 400;
}

#messageInput:focus {
    outline: none;
}

/* iOS zoom engellemesi */
@media (max-width: 768px) {
    #messageInput {
        font-size: 16px;
    }

    .input-wrapper {
        padding: 12px 12px 12px 18px;
    }
}

/* Send Button - Tatlı Gradient */
.send-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, var(--sb-primary) 0%, var(--sb-primary-light) 100%);
    color: var(--sb-text-inverse);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--sb-transition);
    flex-shrink: 0;
    box-shadow: 0 4px 15px rgba(16, 53, 149, 0.35);
}

.send-btn:hover:not(:disabled) {
    transform: scale(1.08);
    box-shadow: 0 6px 20px rgba(16, 53, 149, 0.4);
}

.send-btn:active:not(:disabled) {
    transform: scale(0.95);
}

.send-btn:disabled {
    background: var(--sb-text-muted);
    box-shadow: none;
    cursor: not-allowed;
    opacity: 0.6;
}

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

.send-btn.loading svg {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Input Footer */
.input-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 4px 0;
}

.char-counter {
    font-size: 12px;
    color: var(--sb-text-muted);
    transition: var(--sb-transition);
}

.char-counter.warning {
    color: var(--sb-warning);
}

.char-counter.danger {
    color: var(--sb-error);
}

.powered-by {
    font-size: 11px;
    color: var(--sb-text-muted);
}

.keyboard-hint {
    display: none;
    font-size: 11px;
    color: var(--sb-text-muted);
}

@media (min-width: 768px) {
    .keyboard-hint {
        display: block;
    }
}

.keyboard-hint kbd {
    padding: 2px 6px;
    background: var(--sb-primary-soft);
    border: 1px solid var(--sb-border);
    border-radius: 4px;
    font-family: inherit;
    font-size: 10px;
    margin: 0 2px;
}

/* ================================================
   MARKDOWN STİLLERİ
   ================================================ */
.message-bubble strong {
    font-weight: 600;
}

.message-bubble em {
    font-style: italic;
}

.message-bubble code {
    background: rgba(16, 53, 149, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Fira Code', 'SF Mono', Consolas, monospace;
    font-size: 13px;
}

.user-message .message-bubble code {
    background: rgba(255, 255, 255, 0.2);
}

.message-bubble pre {
    margin: 12px 0;
    padding: 16px;
    background: #1e293b;
    border-radius: var(--sb-radius);
    overflow-x: auto;
}

.message-bubble pre code {
    background: transparent;
    padding: 0;
    color: #e2e8f0;
}

.message-bubble a {
    color: var(--sb-primary);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.user-message .message-bubble a {
    color: var(--sb-text-inverse);
}

.message-bubble ul,
.message-bubble ol {
    margin: 8px 0;
    padding-left: 20px;
}

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

/* ================================================
   ROBOT SVG ANİMASYONLARI
   ================================================ */
.robot-eyes {
    animation: robotBlink 4s ease-in-out infinite;
}

@keyframes robotBlink {
    0%, 45%, 55%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

.robot-smile {
    animation: robotSmile 3s ease-in-out infinite;
}

@keyframes robotSmile {
    0%, 100% { d: path("M40 52 Q50 58 60 52"); }
    50% { d: path("M40 52 Q50 62 60 52"); }
}

.robot-hand {
    animation: robotWave 2s ease-in-out infinite;
    transform-origin: 14px 84px;
}

@keyframes robotWave {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(-5deg); }
    75% { transform: rotate(5deg); }
}

/* ================================================
   RESPONSIVE
   ================================================ */
@media (max-width: 600px) {
    /* Header kompakt */
    .chat-header {
        padding: 10px 12px;
        min-height: auto;
    }

    .header-brand {
        gap: 10px;
        flex-shrink: 1;
        min-width: 0;
    }

    .header-avatar {
        width: 40px;
        height: 40px;
        flex-shrink: 0;
    }

    .header-info {
        display: none; /* Mobilde SunixBot yazısını gizle */
    }

    .header-actions {
        gap: 6px;
        flex-shrink: 0;
    }

    .header-btn {
        height: 34px;
        padding: 0 12px;
        font-size: 12px;
        gap: 6px;
        width: auto;
    }

    .header-btn svg {
        width: 14px;
        height: 14px;
    }

    /* Mobilde "Yeni Konuşma" metni görünsün */
    .header-btn .btn-text {
        display: inline;
    }

    .header-btn.theme-toggle {
        width: 34px;
        padding: 0;
    }

    .chat-messages {
        padding: 20px 12px;
    }

    .message {
        max-width: 90%;
    }

    .message-bubble {
        padding: 12px 14px;
        font-size: 14px;
    }

    .welcome-state {
        padding: 12px 10px;
    }

    .welcome-robot-container {
        margin-bottom: 10px;
    }

    .welcome-robot {
        width: 144px;
        height: 144px;
    }

    .star {
        font-size: 16px;
    }

    .welcome-title {
        font-size: 22px;
        margin-bottom: 4px;
    }

    .welcome-subtitle {
        font-size: 13px;
        margin-bottom: 10px;
        line-height: 1.4;
    }

    .quick-suggestions {
        gap: 6px;
        padding: 0 5px;
    }

    .suggestion-chip {
        padding: 8px 12px;
        font-size: 12px;
    }
}

/* ================================================
   ACCESSIBILITY
   ================================================ */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

:focus-visible {
    outline: 2px solid var(--sb-primary);
    outline-offset: 2px;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ================================================
   CHAT BAŞLIK STİLLERİ
   ================================================ */
.chat-heading {
    margin: 12px 0 8px 0;
    font-weight: 600;
    color: var(--sb-text);
    line-height: 1.3;
}

.message-bubble h2.chat-heading {
    font-size: 1.1rem;
}

.message-bubble h3.chat-heading {
    font-size: 1rem;
}

.message-bubble h4.chat-heading {
    font-size: 0.95rem;
}

/* Ürün ayırıcı - belirgin */
.message-bubble hr {
    border: none;
    height: 2px;
    background: var(--sb-primary);
    opacity: 0.3;
    margin: 20px 0;
    border-radius: 2px;
}

/* ================================================
   CHAT RESİM STİLLERİ
   ================================================ */
.chat-image {
    max-width: 200px;
    max-height: 200px;
    border-radius: 12px;
    margin: 8px 0;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: block;
    object-fit: cover;
    border: 2px solid var(--sb-border);
}

.chat-image:hover {
    transform: scale(1.02);
    box-shadow: var(--sb-shadow-medium);
}

.message-bubble img.chat-image {
    display: block;
    margin: 10px 0;
}

/* Ürün kartı stili */
.message-bubble .product-card {
    background: var(--sb-surface);
    border-radius: 12px;
    padding: 12px;
    margin: 8px 0;
    border: 1px solid var(--sb-border);
}

.message-bubble .product-card img {
    width: 100%;
    max-width: 180px;
    border-radius: 8px;
}

/* ================================================
   RESİM MODAL
   ================================================ */
.image-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.image-modal.show {
    opacity: 1;
    visibility: visible;
}

.image-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    cursor: pointer;
}

.image-modal-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    transform: scale(0.9);
    transition: transform 0.3s ease;
    z-index: 1;
}

.image-modal.show .image-modal-content {
    transform: scale(1);
}

.image-modal-close {
    position: absolute;
    top: -40px;
    right: -10px;
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease, transform 0.2s ease;
}

.image-modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.image-modal-img {
    max-width: 100%;
    max-height: 70vh;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    object-fit: contain;
}

.image-modal-caption {
    margin-top: 16px;
    color: white;
    font-size: 14px;
    text-align: center;
    max-width: 400px;
    opacity: 0.9;
}

.image-modal-link {
    margin-top: 12px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    background: var(--sb-primary);
    color: white;
    text-decoration: none;
    border-radius: var(--sb-radius-full);
    font-size: 13px;
    font-weight: 500;
    transition: background 0.2s ease, transform 0.2s ease;
}

.image-modal-link:hover {
    background: var(--sb-primary-light);
    transform: translateY(-2px);
}

/* Chat link stili */
.message-bubble .chat-link {
    color: var(--sb-primary);
    text-decoration: none;
    font-weight: 500;
    border-bottom: 1px solid transparent;
    transition: all 0.2s ease;
}

.message-bubble .chat-link:hover {
    border-bottom-color: var(--sb-primary);
}

/* Ürüne Git butonu stili */
.message-bubble .chat-link[href*="sunix.com.tr/urun"] {
    display: inline-block;
    background: var(--sb-primary);
    color: white !important;
    padding: 6px 14px;
    border-radius: 16px;
    font-weight: 500;
    font-size: 13px;
    border: none;
    margin-top: 4px;
    margin-bottom: 16px;
    text-decoration: none;
}

.message-bubble .chat-link[href*="sunix.com.tr/urun"]:hover {
    background: var(--sb-primary-light);
    border-bottom: none;
}

.user-message .message-bubble .chat-link {
    color: var(--sb-text-inverse);
    border-bottom-color: rgba(255, 255, 255, 0.3);
}

.user-message .message-bubble .chat-link:hover {
    border-bottom-color: var(--sb-text-inverse);
}

/* Typing cursor animasyonu - Basit & Temiz */
.typing-cursor {
    display: inline;
    color: var(--sb-primary);
    font-weight: normal;
    animation: blink 1s step-end infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

.bot-message .message-bubble {
    min-height: 24px;
}

/* Telefon linki */
.chat-phone {
    color: var(--sb-primary);
    text-decoration: none;
    font-weight: 500;
    white-space: nowrap;
}

.chat-phone:hover {
    text-decoration: underline;
}

.user-message .message-bubble .chat-phone {
    color: var(--sb-text-inverse);
}
