/* Genel Stiller */
@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@300;400;500;600;700;800&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    --primary-color: #4776E6;
    --primary-light: #e8f0ff; /* Mesajlar için biraz daha açık */
    --primary-dark: #3264d0;
    --secondary-color: #FF5E62;
    --secondary-light: #fff5f5;
    --text-color: #333;
    --text-light: #6c757d;
    --bg-color: #f8f9fa; /* Ana arka plan */
    --border-radius: 12px;
    --card-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
    --transition: all 0.3s ease;
    --gradient-primary: linear-gradient(135deg, #4776E6, #8E54E9);
    --gradient-secondary: linear-gradient(135deg, #FF5E62, #FF9966);
    --box-shadow-hover: 0 10px 30px rgba(71, 118, 230, 0.2);
    --box-shadow-light: 0 5px 15px rgba(0, 0, 0, 0.05);
    --round-button-radius: 50%;
    --circle-dimension: 50px;

    /* Sohbet Özel Renkleri */
    --user-message-bg: var(--primary-light);
    --user-message-text: var(--primary-dark);
    --bot-message-bg: #ffffff;
    --bot-message-text: var(--text-color);
    --input-bg: #ffffff;
}

body, html {
    background-color: var(--bg-color) !important;
    color: var(--text-color) !important;
    font-family: 'Nunito', sans-serif;
    overflow-x: hidden; /* Sadece yatay kaydırmayı engelle */
    line-height: 1.6;
    font-weight: 400;
    height: 100%;
}

/* YÜKLEME EKRANI STILLERİ */
#loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background-color: #f7f9fc;
    z-index: 10000;
    opacity: 1;
    visibility: visible;
    transition: opacity 0.5s ease, visibility 0s 0.5s; /* opacity 0.5s'de kaybolur, 0.5s sonra visibility gizlenir */
}

.loading-hidden {
    opacity: 0 !important;
    pointer-events: none;
    visibility: hidden !important;
    /* transition-delay: 0s !important; -- BU SATIR KALDIRILDI */
}

/* İçeriği başlangıçta gizle, JS ile göstereceğiz */
#content {
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s ease, visibility 0s 0.5s; /* opacity 0.5s'de görünür olur, 0.5s sonra visibility görünür yapılır */
}

.content-visible {
    opacity: 1 !important;
    visibility: visible !important;
    /* transition-delay: 0.5s !important; -- BU SATIR KALDIRILDI */
}

/* Özel kaydırma çubuğu */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}
::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: #aaa;
}

/* Sarıcı (Wrapper) */
.wrapper {
    display: flex;
    width: 100%;
    align-items: stretch;
    position: relative;
    min-height: 100vh;
}

/* İçerik - Tam genişlik ve flexbox container */
#content {
    width: 100%;
    min-height: 100vh;
    transition: var(--transition);
    margin-left: 0;
    background-color: #f7f9fc !important;
    background-image: 
        radial-gradient(circle at 10% 20%, rgba(71, 118, 230, 0.05) 0%, transparent 20%),
        radial-gradient(circle at 90% 80%, rgba(142, 84, 233, 0.07) 0%, transparent 25%),
        linear-gradient(135deg, rgba(255, 255, 255, 0.9) 0%, rgba(240, 247, 255, 0.9) 100%);
    background-attachment: fixed;
    color: var(--text-color) !important;
}

/* Kullanıcı bilgisinin yeni konumu (sağ üst) */
/* User Profile Component stilleri artık user_component/user-profile.css dosyasında */

/* User info */
.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-left: auto;
}

/* Glass card styling */
.glass-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: var(--border-radius);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.glass-card:hover {
    box-shadow: var(--box-shadow-hover);
    transform: translateY(-3px);
}

/* Chat Card Styling */
.chat-card {
    border-radius: var(--border-radius) !important;
    overflow: hidden;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    margin-bottom: 0 !important;
}

.chat-card .card-body {
    padding: 1.25rem !important;
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* Chat card header with info button */
.chat-card .card-body h5 {
    color: var(--primary-color);
    font-weight: 600;
    font-size: 1.1rem;
}

.chat-card .card-body h5 i {
    color: var(--primary-color);
}

#infoButton {
    border-radius: 50px;
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
    transition: all 0.3s ease;
}

#infoButton:hover {
    background-color: var(--primary-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.1);
}

#chat-box {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    margin-bottom: 1rem;
    background-color: rgba(255, 255, 255, 0.7);
    border-radius: 12px;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.02);
}

/* Chat Intro Styles */
.chat-intro {
    text-align: center;
    padding: 1.5rem;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
    margin-bottom: 1rem;
}

.intro-icon {
    margin-bottom: 1rem;
    font-size: 2.5rem;
    width: 70px;
    height: 70px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-light);
    border-radius: 50%;
    color: var(--primary-color);
    margin: 0 auto 1rem;
}

.intro-features {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin: 1rem 0;
}

.feature {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0.5rem 0.8rem;
    background: white;
    border-radius: 10px;
    border: 1px solid #f0f0f0;
    transition: var(--transition);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
    font-size: 0.9rem;
}

.feature i {
    font-size: 1rem;
}

/* Suggestion buttons */
.suggestion-buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
    margin-top: 10px;
}

.suggestion-btn {
    background-color: white;
    border: 1px solid #e2e8f0;
    font-size: 0.85rem;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.04);
    transition: all 0.2s ease;
    white-space: normal;
    text-align: left;
    padding: 6px 12px;
}

/* Enhanced chat message styling */
.message {
    padding: 1rem;
    margin-bottom: 0.75rem;
    border-radius: 12px;
    position: relative;
    max-width: 85%;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
    line-height: 1.5;
    font-size: 0.95rem;
}

.user-message {
    background-color: var(--primary-light);
    color: var(--text-color);
    margin-left: auto;
    border-bottom-right-radius: 4px;
}

.bot-message {
    background-color: white;
    color: var(--text-color);
    border-bottom-left-radius: 4px;
    margin-right: auto;
}

.ai-message-header {
    display: flex;
    align-items: center;
    margin-bottom: 6px;
    font-weight: 600;
    color: var(--primary-color);
    font-size: 0.9rem;
}

.ai-message-header i {
    margin-right: 6px;
    font-size: 1rem;
}

/* Rounded inputs */
.form-control.rounded-pill {
    padding-left: 1.2rem;
    height: 45px;
}

.btn.rounded-pill {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
}

/* Loading effect */
@keyframes thinking {
    0% { opacity: 0.5; }
    50% { opacity: 1; }
    100% { opacity: 0.5; }
}

.thinking-message {
    display: flex;
    align-items: center;
    animation: thinking 1.5s infinite;
}

.loading-spinner {
    width: 20px;
    height: 20px;
    border: 3px solid rgba(13, 110, 253, 0.3);
    border-radius: 50%;
    border-top-color: #0d6efd;
    animation: spin 1s ease-in-out infinite;
    margin-left: 10px;
}

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

/* Improve copy button style */
.copy-button {
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: #f8fafc;
    border: none;
    border-radius: 20px;
    padding: 5px 10px;
    font-size: 0.75rem;
    opacity: 0;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 5px;
    color: var(--text-light);
}

.message:hover .copy-button {
    opacity: 1;
}

.copy-button:hover {
    background-color: var(--primary-light);
    color: var(--primary-color);
}

.copy-button.copied {
    color: #198754;
}

/* Input Area Styling */
.input-container {
    margin-top: auto;
    background-color: white;
    border-radius: 12px;
    padding: 0.75rem;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.03);
}

.input-fields {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
}

#user-input {
    background-color: #f8fafc;
    border: 1px solid #e2e8f0;
    padding: 10px 15px;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

#user-input:focus {
    background-color: white;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(93, 108, 255, 0.15);
}

/* Improved File Upload Styles */
.file-upload-container {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    position: relative;
}

/* Custom File Upload Button */
.custom-file-upload-btn {
    width: 40px;
    height: 40px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f8fafc;
    border: 1px solid #e2e8f0;
    transition: all 0.3s ease;
}

.custom-file-upload-btn:hover {
    background-color: var(--primary-light);
    border-color: var(--primary-color);
}

.custom-file-upload-btn i {
    font-size: 1rem;
}

/* Hide default input */
#image-input {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* File Preview Area */
.file-preview {
    position: relative;
    margin-left: 10px;
    display: none; /* Hide initially */
}

.file-preview.active {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.selected-file-container {
    display: flex;
    align-items: center;
    background-color: var(--primary-light);
    padding: 4px 10px;
    border-radius: 12px;
    max-width: 200px;
    margin-bottom: 0;
}

.selected-file-name {
    font-size: 0.8rem;
    color: var(--primary-dark);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 150px;
    font-weight: 500;
}

.clear-file {
    font-size: 0.7rem;
    margin-left: 5px;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.clear-file:hover {
    opacity: 1;
}

.preview-image-container {
    position: relative;
    max-width: 100px;
    max-height: 100px;
    overflow: hidden;
    border-radius: 8px;
    border: 2px solid var(--primary-light);
    display: none; /* Hide initially */
}

.preview-image-container.active {
    display: block;
}

#preview-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

#send-btn {
    background: var(--gradient-primary);
    border: none;
    padding: 10px 15px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(71, 118, 230, 0.2);
    font-size: 0.9rem;
}

#send-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(71, 118, 230, 0.3);
}

#send-btn:active {
    transform: translateY(0);
}

/* Image Message Container */
.image-container {
    margin: 10px 0;
    position: relative;
    max-width: 300px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    margin-left: auto;
    border-bottom-right-radius: 4px;
    background-color: var(--primary-light);
}

.image-container img {
    max-width: 100%;
    height: auto;
    display: block;
    transition: transform 0.3s ease;
}

.image-container:hover img {
    transform: scale(1.02);
}

/* Add caption for image */
.image-container::before {
    content: "Gönderilen Görsel";
    display: block;
    font-size: 0.8rem;
    color: var(--primary-dark);
    padding: 8px 12px 4px;
    font-weight: 500;
    border-bottom: 1px solid rgba(93, 108, 255, 0.2);
}

/* User and bot image containers to ensure proper alignment */
.user-image-container {
    margin-left: auto;
    margin-right: 0;
}

.bot-image-container {
    margin-left: 0;
    margin-right: auto; 
    background-color: white;
    border-bottom-left-radius: 4px;
    border-bottom-right-radius: 12px;
}

.bot-image-container::before {
    content: "AI Analizi";
    color: var(--primary-color);
}

/* Image Modal */
.image-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.85);
    z-index: 1055;
    justify-content: center;
    align-items: center;
    cursor: zoom-out;
    opacity: 0;
    transition: opacity 0.3s ease;
    padding: 20px;
    box-sizing: border-box;
}
.image-modal.active {
    display: flex;
    opacity: 1;
}
.image-modal img {
    max-width: 90vw;
    max-height: 90vh;
    width: auto;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
    transform: scale(0.95);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    object-fit: contain;
}
.image-modal.active img {
    transform: scale(1);
}

/* Background Accents */
.accent-circle {
    position: fixed;
    width: 300px;
    height: 300px;
    border-radius: 50%;
    z-index: -1;
    animation: pulse 15s infinite alternate ease-in-out;
    opacity: 0.4;
    filter: blur(70px);
}

.accent-circle-1 {
    top: -150px;
    left: -150px;
    background: var(--gradient-primary);
    transform-origin: center;
}

.accent-circle-2 {
    bottom: -150px;
    right: -150px;
    background: var(--gradient-secondary);
    transform-origin: center;
}

@keyframes pulse {
    0% { transform: scale(1) rotate(0deg); opacity: 0.3; }
    50% { transform: scale(1.2) rotate(15deg); opacity: 0.5; }
    100% { transform: scale(1) rotate(0deg); opacity: 0.3; }
}

/* Media Queries */
@media (max-width: 991.98px) {
    .chat-card {
        margin-left: 0;
        margin-right: 0;
        border-radius: var(--border-radius);
    }
}

@media (max-width: 767.98px) {
    #chat-box {
        padding: 8px;
        gap: 10px;
    }
    .message {
        max-width: 85%;
        font-size: 0.9rem;
        padding: 8px 12px;
    }
    .input-container {
        padding: 8px;
    }
    #user-input {
        padding: 8px 12px;
        font-size: 0.9rem;
    }
    #send-btn {
        padding: 8px 15px;
        font-size: 0.9rem;
    }
    .custom-file-upload-btn {
        padding: 0.4rem 0.7rem;
    }
    .custom-file-upload-btn i {
        font-size: 1rem;
    }
    .chat-intro {
        padding: 1rem;
    }
    .intro-icon { font-size: 2rem; }
    .chat-intro h3 { font-size: 1.1rem; }
    .chat-intro p { font-size: 0.85rem; }
    .feature { padding: 0.4rem 0.7rem; }
    .feature i { font-size: 1rem; }
    .feature span { font-size: 0.8rem; }

    .chat-card {
        border-radius: 15px;
        height: calc(100vh - 100px);
        max-height: calc(100vh - 100px);
    }
    .card-body.p-4 {
        padding: 0.8rem;
    }
}

@media (max-width: 575.98px) {
   .user-info {
       margin-left: auto;
   }
   .accent-circle {
       width: 200px;
       height: 200px;
       filter: blur(40px);
   }
   .accent-circle-1 { top: -100px; left: -100px; }
   .accent-circle-2 { bottom: -80px; right: -80px; }
   
   .container-fluid.mt-4 {
       margin-top: 0.5rem !important;
   }
   .chat-card {
       height: calc(100vh - 85px);
       max-height: calc(100vh - 85px);
       margin-bottom: 0.5rem !important;
   }
   .card-body.p-4 {
       padding: 0.8rem !important;
   }
}

/* Additional animations */
@keyframes pulse-light {
    0% { box-shadow: 0 0 0 0 rgba(93, 108, 255, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(93, 108, 255, 0); }
    100% { box-shadow: 0 0 0 0 rgba(93, 108, 255, 0); }
}

.input-container:focus-within {
    animation: pulse-light 1.5s infinite;
}

/* Container fluid margin fix */
.container-fluid.mt-3 {
    margin-top: 0.75rem !important;
}

.row.g-2 {
    gap: 0 !important;
    margin: 0 !important;
}

/* Sol Üst Geri Butonu Stili */
.back-button {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    padding: 0;
    box-shadow: 0 4px 10px rgba(220, 53, 69, 0.2);
    transition: all 0.3s ease;
}

.back-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(220, 53, 69, 0.3);
}