/* ================================================= */
/* Temizlenmiş ve Düzeltilmiş Cenova AI Chat CSS      */
/* Düzenleyen: Gemini AI (Tüm düzeltmeler dahil)    */
/* ================================================= */

/* ===== 1. Global & Tema Ayarları ===== */
:root {
    --bg-primary: #1a1a1a;
    --bg-secondary: #2d2d2d;
    --bg-tertiary: #404040;
    --text-primary: #ffffff;
    --text-secondary: #b3b3b3;
    --accent: #E53935;
    --accent-hover: #C62828;
    --border: #404040;
    --shadow: rgba(0, 0, 0, 0.1);
    --gradient-primary: linear-gradient(135deg, #C62828, #E53935);
    --message-user-bg: #E53935;
    --message-bot-bg: #2d2d2d;
    --primary-color-dark: #C62828; /* Hover vb. için koyu renk */
}

[data-theme="light"] {
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --bg-tertiary: #e9ecef;
    --text-primary: #1a1a1a;
    --text-secondary: #6c757d;
    --border: #dee2e6;
    --shadow: rgba(0, 0, 0, 0.05);
    --message-bot-bg: #f8f9fa;
    --primary-color-dark: #C62828;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
   
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* iOS'ta input odaklanmasında otomatik zoom'u engelle */
input, textarea, select, .input-field, .initial-input-field {
    font-size: 16px !important;
}

/* ===== 2. Ana Yerleşim (Layout) ===== */
.main-layout {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

.sidebar {
    width: 250px;
    min-width: 250px;
    height: 100vh;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    position: relative;
    transition: left 0.3s ease, background-color 0.3s ease, border-color 0.3s ease;
    z-index: 1000;
}

.chat-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--bg-primary);
    position: relative; 
    transition: background-color 0.3s ease;
}

/* ===== 3. Kenar Çubuğu (Sidebar) ===== */
.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: border-color 0.3s ease;
}

.sidebar-header h2 {
    color: var(--text-primary);
    font-size: 18px;
    font-weight: 600;
}

.sidebar-close-btn {
    display: none;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 6px;
    border-radius: 6px;
    transition: background-color 0.2s ease, color 0.2s ease;
    font-size: 16px;
}

.sidebar-close-btn:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.sidebar-menu {
    list-style: none;
    padding: 16px;
    flex: 1;
    overflow-y: auto;
}

.sidebar-menu li {
    margin-bottom: 6px;
}

.sidebar-menu button {
    width: 100%;
    text-align: left;
    padding: 12px 16px;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: 10px;
    transition: background-color 0.2s ease, color 0.2s ease;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-menu button:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.sidebar-menu button i {
    width: 18px;
    text-align: center;
}

.sidebar-theme-toggle-container {
    padding: 16px;
    margin-top: auto;
    border-top: 1px solid var(--border);
    padding-top: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.sidebar-theme-toggle {
    width: 100%;
    background: none;
    color: var(--text-primary);
    border: 1px solid var(--border);
    padding: 10px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.sidebar-theme-toggle:hover {
    background: var(--bg-tertiary);
    color: var(--accent);
    border-color: var(--accent);
}

.whatsapp-button {
    width: 100%;
    background: #25D366;
    color: white;
    border: 1px solid #25D366;
    padding: 10px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.whatsapp-button:hover {
    background: #128C7E;
    border-color: #128C7E;
}

.whatsapp-button i {
    color: white !important;
    font-size: 16px;
}

/* ===== 4. Sohbet Alanı (Chat Area) ===== */
.chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    position: relative;
    z-index: 10;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-primary);
    padding: 12px;
    border-radius: 8px;
    transition: background-color 0.2s ease, color 0.2s ease;
    font-size: 18px;
}

.menu-toggle:hover {
    background: var(--bg-tertiary);
    color: var(--accent);
}

.header-center {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    justify-content: flex-start;
}

.bot-name {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.bot-status {
    width: 8px;
    height: 8px;
    background: #4ade80;
    border-radius: 50%;
    animation: pulse 2s infinite;
    margin-left: 8px;
}

/* chat.css dosyasında bulun */
.chat-area {
    flex: 1;
    position: relative;
    display: flex;
    flex-direction: column;
    overflow-y: auto; /* BU SATIRI EKLEYİN */
    overflow-x: hidden; /* Yatay kaydırmayı engellemek için eklendi */
}

/* ===== Dinamik ve Gizli Kaydırma Çubukları ===== */
.chat-area, .modal-scrollable-content {
    scrollbar-width: thin;
    scrollbar-color: var(--accent) transparent;
}

.chat-area::-webkit-scrollbar,
.modal-scrollable-content::-webkit-scrollbar {
    width: 8px;
}

.chat-area::-webkit-scrollbar-track,
.modal-scrollable-content::-webkit-scrollbar-track {
    background: transparent;
}

.chat-area::-webkit-scrollbar-thumb,
.modal-scrollable-content::-webkit-scrollbar-thumb {
    background-color: transparent;
    border-radius: 4px;
    border: none;
    background-clip: padding-box;
}

.chat-area:hover::-webkit-scrollbar-thumb,
.modal-scrollable-content:hover::-webkit-scrollbar-thumb,
.chat-area.scrollbar-visible::-webkit-scrollbar-thumb {
    background-color: var(--accent);
}

/* ===== 5. Başlangıç Ekranı (Initial View) ===== */
.initial-view {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    flex-grow: 1;
    padding: 20px 16px;
    width: 100%;
    box-sizing: border-box;
}

.initial-view.hidden {
    display: none !important;
}

.initial-view h1 {
    font-size: 3rem;
    font-weight: 600;
    color: var(--accent);
    margin-bottom: 20px;
    word-break: break-word;
}

.welcome-message {
    color: var(--text-secondary);
    font-size: 1.5rem;
    margin-bottom: 40px;
    max-width: 90%;
    word-break: break-word;
}

.initial-menu-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
    width: 100%;
    max-width: 800px;
    margin: 20px auto;
    overflow-x: auto;
    padding: 10px 15px;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.initial-menu-buttons::-webkit-scrollbar {
    display: none;
}

.initial-menu-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background-color: var(--bg-secondary);
    border: 2px solid transparent;
    color: var(--text-secondary);
    padding: 12px 8px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease-in-out;
    min-width: 120px;
    width: 120px;
    height: 80px;
    text-align: center;
    box-shadow: 0 2px 4px var(--shadow);
    flex-shrink: 0;
    white-space: normal;
}

.initial-menu-btn i {
    font-size: 22px;
    margin-bottom: 6px;
}

.initial-menu-btn:hover {
    transform: translateY(-2px) scale(1.01);
    color: var(--text-primary);
    border-color: var(--accent);
    box-shadow: 0 4px 8px rgba(229, 57, 53, 0.15);
}

.initial-menu-btn.selected {
    border-color: var(--accent);
    background-color: rgba(229, 57, 53, 0.08);
    transform: translateY(-2px) scale(1.01);
    box-shadow: 0 4px 8px rgba(229, 57, 53, 0.15);
    color: var(--accent);
    font-weight: 600;
}

.initial-menu-btn.selected i {
    color: var(--accent);
    transform: scale(1.05);
}

.initial-input-container {
    position: relative;
    width: 100%;
    max-width: 850px;
    margin: 20px auto;
    display: flex;
    align-items: center;
    border: 2px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    background: var(--bg-secondary);
}

.initial-input-field {
    flex: 1;
    padding: 16px 20px;
    border: none;
    background: transparent;
    color: var(--text-primary);
    outline: none;
    width: 100%;
}

.initial-send-button {
    background: var(--accent);
    color: white;
    border: none;
    padding: 0 20px;
    cursor: pointer;
    font-size: 16px;
    align-self: stretch;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease;
}

.initial-send-button:hover {
    background: var(--accent-hover);
}

.initial-send-button i {
    font-size: 16px;
    color: white;
}

/* chat.css dosyasında bulun ve DEĞİŞTİRİN */
.chat-messages {
    display: none;
    /* flex: 1;  <-- BU SATIRI SİLİN VEYA YORUMA ALIN */
    /* overflow-y: auto; <-- BU SATIRI SİLİN VEYA YORUMA ALIN */
    padding: 20px;
    scroll-behavior: smooth;
    max-width: 800px;
    margin: 0 auto;
    width: 100%;
    min-height: 0;
}
.message {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 24px;
    animation: fadeInUp 0.3s ease;
}

.message.user {
    flex-direction: row-reverse;
}

.message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-tertiary);
}

.bot-avatar-small i, .user-avatar i {
    color: #fff;
    font-size: 14px;
}

.user-avatar {
    background: var(--accent);
}

.message-content {
    flex-grow: 0;
    width: -moz-fit-content;
    width: fit-content;
    max-width: calc(100% - 44px);
    padding: 12px 16px;
    border-radius: 12px;
    line-height: 1.6;
    word-wrap: break-word;
    font-size: 15px;
    min-width: 40px;
    overflow-wrap: break-word;
    word-break: normal;
    overflow: hidden;
}

.bot-message-container {
    position: relative;
    min-width: 0;
}

.bot-message {
    background: var(--message-bot-bg);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.user-message {
    background: var(--message-user-bg);
    color: white;
}

/* Yazıyor... Göstergesi */
.typing-indicator {
    display: none;
    align-items: center;
    gap: 12px;
    padding: 0 20px 20px 20px;
    max-width: 800px;
    margin: 0 auto;
    width: 100%;
    animation: fadeInUp 0.3s ease;
}

.typing-dots {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 12px 16px;
    background: var(--message-bot-bg);
    border-radius: 12px;
    border: 1px solid var(--border);
}

.dot {
    width: 6px;
    height: 6px;
    background: var(--text-secondary);
    border-radius: 50%;
    animation: typingAnimation 1.4s infinite ease-in-out;
}
.dot:nth-child(2) { animation-delay: 0.2s; }
.dot:nth-child(3) { animation-delay: 0.4s; }


/* ===== 7. Sohbet Kontrolleri (Input Alanı) ===== */
.chat-controls {
    display: none;
    padding: 20px;
    background: var(--bg-primary);
    border-top: 1px solid var(--border);
    max-width: 800px;
    margin: 0 auto;
    width: 100%;
    position: relative;
    z-index: 10;
    flex-shrink: 0;
}

.quick-replies {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    flex-wrap: wrap;
    justify-content: center;
}

.quick-replies button {
    padding: 8px 16px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border);
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
}

.quick-replies button:hover {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
    transform: translateY(-1px);
}

.input-area {
    display: flex;
    gap: 12px;
    align-items: flex-end;
}

.input-field {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid var(--border);
    border-radius: 12px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    outline: none;
    transition: all 0.3s ease;
    resize: none;
    min-height: 48px;
    max-height: 120px;
}

.input-field:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(229, 57, 53, 0.1);
}

.input-field::placeholder {
    color: var(--text-secondary);
}

.send-button {
    background: var(--gradient-primary);
    color: white;
    border: none;
    border-radius: 12px;
    padding: 0 20px;
    height: 48px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 500;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 2px 4px var(--shadow);
}

.send-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(229, 57, 53, 0.1);
}

.send-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}


/* ===== 8. Zenginleştirilmiş İçerik Stilleri (Markdown, Kartlar vb.) ===== */
.bot-message p { margin: 10px 0; line-height: 1.6; }
.bot-message ul, .bot-message ol { margin: 15px 0; padding-left: 25px; }
.bot-message li { margin: 8px 0; line-height: 1.5; }
.bot-message h1, .bot-message h2, .bot-message h3 { margin-top: 20px; margin-bottom: 10px; }
.bot-message code { font-family: 'Courier New', monospace; background-color: rgba(0,0,0,0.1); padding: 2px 4px; border-radius: 4px; }
.bot-message a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
    border-bottom: 1px solid transparent;
    transition: all 0.2s ease;
}
.bot-message a:hover {
    border-bottom-color: var(--accent-hover);
    color: var(--accent-hover);
}
#chatMessages .message.bot .message-content img {
    width: auto; /* DÜZELTİLMİŞ SATIR */
    max-width: 100% !important;
    height: auto !important;
    display: block !important;
    border-radius: 8px !important;
    margin: 10px 0 !important;
    object-fit: contain;
}

.table-container {
    overflow-x: auto;
    margin: 15px 0;
    border-radius: 8px;
    border: 1px solid var(--border);
    box-shadow: 0 2px 8px var(--shadow);
}
.md-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}
.md-table th, .md-table td {
    padding: 10px 15px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}
.md-table th {
    background-color: var(--bg-tertiary);
    font-weight: 600;
}
.md-table tr:last-child td { border-bottom: none; }

.bot-message pre {
    background-color: rgba(0,0,0,0.2);
    border-radius: 8px;
    padding: 12px;
    overflow-x: auto;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.bot-message pre code {
    padding: 0;
    background: none;
    white-space: pre-wrap;
}

.responsive-video-container {
    position: relative;
    overflow: hidden;
    width: 100%;
    padding-top: 56.25%;
    margin: 10px 0;
    border-radius: 8px;
}
.responsive-video-container iframe,
.responsive-video-container video {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: none;
}

.message-card {
    width: 100%;
    max-width: 100%; /* DÜZELTME: Kart taşmasını önler */
    margin-top: 10px;
    border-radius: 12px;
    overflow: hidden;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border);
    font-family: 'Roboto', sans-serif;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
    transition: all 0.2s ease-in-out;
}
.message-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
}

.document-card {
    display: flex; align-items: center; padding: 15px; gap: 15px;
}
.document-card .document-preview-icon {
    flex-shrink: 0; font-size: 38px; color: var(--accent); width: 40px; text-align: center;
}
.document-card .document-card-content {
    flex-grow: 1; overflow: hidden; display: flex; flex-direction: column; gap: 12px;
}
.document-card .document-card-title {
    margin: 0; font-size: 15px; font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.document-card .document-card-link {
    display: inline-block; align-self: flex-start; text-decoration: none; font-weight: 500; color: white; background-color: var(--accent); padding: 8px 16px; border-radius: 8px; font-size: 14px; transition: background-color 0.2s ease;
}
.document-card .document-card-link:hover {
    background-color: var(--accent-hover);
}
.document-card .document-card-link .fa-external-link-alt {
    margin-left: 6px; font-size: 12px;
}

.youtube-preview-card .youtube-thumbnail {
    position: relative; width: 100%; padding-bottom: 56.25%; background-size: cover; background-position: center;
}
.youtube-preview-card .play-overlay-link {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; background-color: rgba(0, 0, 0, 0.4); transition: background-color 0.3s ease;
}
.youtube-preview-card .play-overlay-link:hover { background-color: rgba(0, 0, 0, 0.6); }
.youtube-preview-card .play-overlay {
    color: #ffffff; font-size: 48px; text-shadow: 0 2px 4px rgba(0,0,0,0.5); transition: transform 0.3s ease;
}
.youtube-preview-card .play-overlay-link:hover .play-overlay { transform: scale(1.1); }
.youtube-preview-card .youtube-info { padding: 12px 15px; border-top: 1px solid var(--border); }
.youtube-preview-card .youtube-info h4 { margin: 0 0 10px 0; font-size: 15px; font-weight: 600; color: var(--text-primary); }
.youtube-preview-card .youtube-link {
    display: inline-flex; align-items: center; text-decoration: none; color: #fff; background-color: #ff0000; padding: 8px 12px; border-radius: 20px; font-weight: 500; font-size: 13px; gap: 6px; transition: background-color 0.2s ease;
}
.youtube-preview-card .youtube-link:hover { background-color: #cc0000; }


/* ===== 9. Modallar ve Yardımcı Pencereler ===== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}
.modal.active { display: flex; }
.modal-content {
    background: var(--bg-secondary);
    border-radius: 16px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 20px 40px var(--shadow);
    animation: modalSlideIn 0.3s ease;
    border: 1px solid var(--border);
    position: relative;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.modal-close-btn {
    position: absolute; top: 16px; right: 16px; background: none; border: none; color: var(--text-secondary); cursor: pointer; font-size: 24px; width: 32px; height: 32px; line-height: 32px; text-align: center; border-radius: 50%; transition: all 0.3s ease; z-index: 10;
}
.modal-close-btn:hover {
    background: var(--bg-tertiary); color: var(--text-primary); transform: scale(1.1);
}

.modal-content h2 {
    color: var(--text-primary); font-size: 20px; font-weight: 600; text-align: center; padding: 24px 32px 16px 32px; border-bottom: 1px solid var(--border);
}
.modal-scrollable-content {
    padding: 20px 32px 32px 32px; overflow-y: auto; flex-grow: 1; max-height: calc(80vh - 80px);
}
#supportRequestForm {
    display: flex; flex-direction: column; gap: 16px;
}
#supportRequestForm label {
    color: var(--text-primary); font-weight: 500; margin-bottom: 8px; display: block;
}
#supportRequestForm input, #supportRequestForm textarea {
    width: 100%; padding: 12px 16px; border: 2px solid var(--border); border-radius: 8px; background: var(--bg-primary); color: var(--text-primary); font-size: 14px; outline: none; transition: all 0.3s ease;
}
#supportRequestForm input:focus, #supportRequestForm textarea:focus {
    border-color: var(--accent); box-shadow: 0 0 0 3px rgba(229, 57, 53, 0.1);
}
#supportRequestForm textarea { resize: vertical; min-height: 80px; }
.modal-send-button {
    background: var(--gradient-primary); color: white; border: none; border-radius: 8px; padding: 12px 20px; cursor: pointer; font-size: 15px; font-weight: 500; transition: all 0.2s ease; margin-top: 8px;
}
.modal-send-button:hover {
    transform: translateY(-1px); box-shadow: 0 4px 12px rgba(229, 57, 53, 0.4);
}
.modal-message {
    margin-top: 12px; padding: 12px; border-radius: 8px; text-align: center; font-weight: 500;
}
.modal-message.success { background: rgba(74, 222, 128, 0.1); color: #4ade80; border: 1px solid rgba(74, 222, 128, 0.3); }
.modal-message.error { background: rgba(248, 113, 113, 0.1); color: #f87171; border: 1px solid rgba(248, 113, 113, 0.3); }

.analysis-modal {
    display: none; position: fixed; z-index: 1000; left: 0; top: 0; width: 100%; height: 100%; background-color: rgba(0, 0, 0, 0.6); backdrop-filter: blur(5px); opacity: 0; transition: opacity 0.3s ease;
}
.analysis-modal.active { display: block; opacity: 1; }
.analysis-modal-content {
    background-color: #2d3748; color: #e2e8f0; margin: 5% auto; border: 1px solid #4a5568; width: 85%; max-width: 1200px; border-radius: 10px; box-shadow: 0 5px 25px rgba(0, 0, 0, 0.5); display: flex; flex-direction: column; height: 80vh;
}
.analysis-modal-header {
    padding: 15px 25px; border-bottom: 1px solid #4a5568; display: flex; justify-content: space-between; align-items: center;
}
.analysis-modal-header h3 { margin: 0; font-size: 1.2em; }
.analysis-modal-body { display: flex; flex-grow: 1; overflow: hidden; }
.analysis-sidebar {
    flex: 0 0 280px; border-right: 1px solid #4a5568; padding: 15px; overflow-y: auto; background-color: #1a202c;
}
.analysis-main-content { flex-grow: 1; padding: 25px; overflow-y: auto; }
.analysis-category-item {
    display: block; width: 100%; padding: 12px 15px; background-color: transparent; border: 1px solid transparent; color: #a0aec0; text-align: left; cursor: pointer; font-size: 15px; border-radius: 6px; margin-bottom: 5px; transition: all 0.2s ease;
}
.analysis-category-item:hover { background-color: #2d3748; color: #fff; }
.analysis-category-item.active { background-color: var(--accent); color: #fff; font-weight: bold; border-color: var(--accent); }
.analysis-main-content .placeholder {
    display: flex; justify-content: center; align-items: center; height: 100%; font-size: 1.1em; color: #718096;
}

/* ===== 10. Yardımcı Stiller & Butonlar ===== */
.overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0, 0, 0, 0.5); z-index: 999; display: none; backdrop-filter: blur(2px);
}
.overlay.active { display: block; }

.scroll-to-bottom-button {
    position: absolute;
    bottom: 125px; 
    right: 30px; 
    width: 40px;
    height: 40px;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px var(--shadow);
    transition: all 0.2s ease;
    z-index: 100;
}
.scroll-to-bottom-button.active { display: flex; }
.scroll-to-bottom-button:hover { background: var(--accent-hover); transform: translateY(-2px); }
.scroll-to-bottom-button i { font-size: 20px; }

.message-actions { display: flex; gap: 8px; margin-top: 8px; opacity: 0; transition: opacity 0.3s ease; }
.message.bot:hover .message-actions { opacity: 1; }
.action-btn {
    background: var(--bg-tertiary); border: 1px solid var(--border); color: var(--text-secondary); padding: 4px 8px; border-radius: 6px; cursor: pointer; font-size: 12px; display: flex; align-items: center; gap: 4px; transition: all 0.2s ease;
}
.action-btn:hover { background: var(--accent); color: white; border-color: var(--accent); }
.action-btn:active { transform: scale(0.95); }

.progress-update-container { width: 100%; padding: 5px 15px; box-sizing: border-box; margin-bottom: 5px; }
.progress-wrapper { background-color: var(--bg-tertiary); border-radius: 8px; padding: 12px; width: 100%; max-width: 400px; margin: 0 auto; border: 1px solid var(--border); }
.progress-container { background-color: var(--border); border-radius: 5px; height: 10px; }
.progress-bar { height: 10px; background-color: var(--accent); border-radius: 5px; width: 0%; transition: width 0.4s ease-in-out; }
.progress-text { font-size: 11px; color: var(--text-secondary); margin-top: 6px; text-align: left; }
.progress-bar.error { background-color: #ef4444; }
.progress-bar.success { background-color: #22c55e; }

.spec-table {
    width: 100%; border-collapse: collapse; font-size: 14px; margin-top: 10px; background-color: var(--message-bot-bg); border-radius: 8px; overflow: hidden;
}
.spec-table td { padding: 10px 12px; border-bottom: 1px solid var(--border); }
.spec-table tr:last-child td { border-bottom: none; }
.spec-table td:first-child strong { color: var(--text-secondary); text-transform: capitalize; }
.spec-table td:last-child { color: var(--text-primary); font-weight: 500; }

.action-button {
    background-color: var(--accent); color: white; border: none; border-radius: 6px; padding: 10px 15px; font-size: 14px; font-weight: 500; cursor: pointer; transition: background-color 0.2s; margin-top: 5px;
}
.action-button:hover { background-color: var(--accent-hover); }

.typewriter-cursor {
    display: inline-block; width: 2px; height: 1.2em; background: var(--accent); margin-left: 2px; animation: blink 1s infinite; vertical-align: text-bottom;
}


/* ===== 11. Animasyonlar (@keyframes) ===== */
@keyframes fadeInUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes modalSlideIn { from { opacity: 0; transform: scale(0.95) translateY(-10px); } to { opacity: 1; transform: scale(1) translateY(0); } }
@keyframes pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.5; transform: scale(0.8); } }
@keyframes typingAnimation { 0%, 60%, 100% { transform: translateY(0); opacity: 0.4; } 30% { transform: translateY(-8px); opacity: 1; } }
@keyframes fadeIn { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: translateY(0); } }
@keyframes blink { 0%, 50% { opacity: 1; } 51%, 100% { opacity: 0; } }


/* ===== 12. Duyarlı Tasarım (Responsive) ===== */
@media (max-width: 992px) {
    .menu-toggle, .sidebar-close-btn { display: block; }
    .sidebar { position: fixed; left: -320px; width: 320px; z-index: 1001; }
    .sidebar.active { left: 0; box-shadow: 0 0 20px rgba(0,0,0,0.2); }
}

@media (max-width: 768px) {
    body { height: 100vh; height: 100dvh; } /* DÜZELTME: .chat-container kaldırıldı */
    .chat-header { padding: 12px 16px; box-shadow: 0 2px 10px var(--shadow); }
    .chat-messages { display: block; flex: 1; overflow-y: auto; padding: 12px; }
    .initial-view { padding: 15px 10px; }
    .initial-view h1 { font-size: 2rem; }
    .welcome-message { font-size: 1rem; margin-bottom: 25px; }
    .initial-menu-buttons { gap: 8px; padding: 10px 8px; justify-content: center; }
    .initial-menu-btn { min-width: 90px; width: 90px; height: 65px; font-size: 11px; padding: 8px 4px; }
    .initial-menu-btn i { font-size: 18px; margin-bottom: 3px; }
    .initial-input-container { max-width: calc(100% - 20px); margin: 15px auto; }
    .initial-input-field { padding: 12px 15px; font-size: 14px; }
    .message-content { max-width: calc(100% - 44px); padding: 10px 14px; font-size: 15px; }
    .chat-controls { display: block; padding: 12px 16px; }
    .input-field { min-height: 48px; }
    .scroll-to-bottom-button { bottom: 115px; right: 15px; width: 36px; height: 36px; }
    .modal-content h2 { font-size: 18px; padding: 20px 24px 14px 24px; }
    .modal-scrollable-content { padding: 16px 24px 24px 24px; max-height: calc(80vh - 70px); }
}

@media (max-width: 480px) {
    .header-center .bot-name { font-size: 16px; }
    .initial-view h1 { font-size: 1.7rem; }
    .welcome-message { font-size: 0.9rem; }
    .quick-replies { 
        justify-content: flex-start;
        padding-bottom: 8px; 
        flex-wrap: wrap; /* DÜZELTME: Butonların alt satıra inmesini sağlar */
    }
    .quick-replies button { flex-shrink: 0; }
    .chat-controls { padding: 10px; }
    .input-field { min-height: 44px; }
    .send-button { height: 44px; }
    .initial-menu-buttons { gap: 6px; padding: 8px 5px; }
    .initial-menu-btn { min-width: 80px; width: 80px; height: 60px; font-size: 10px; padding: 6px 3px; }
    .initial-menu-btn i { font-size: 16px; margin-bottom: 2px; }
    .scroll-to-bottom-button { bottom: 110px; right: 12px; width: 32px; height: 32px; }
    .scroll-to-bottom-button i { font-size: 16px; }
}

.sidebar.active { z-index: 1002; }

/* ============================================= */
/* İnatçı Geniş Balonlar İçin Kararlı Çözüm    */
/* ============================================= */
.message.bot .message-content {
    width: -moz-fit-content !important;
    width: fit-content !important;
}