/* Chatbot Styles */

/* Chat Launcher Button */
.chat-launcher {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 65px;
    height: 65px;
    background: #2563eb;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(37, 99, 235, 0.3);
    z-index: 9998;
    transition: all 0.3s;
    /* Animation to draw attention */
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        box-shadow: 0 4px 15px rgba(37, 99, 235, 0.3);
    }
    50% {
        transform: scale(1.15);
        box-shadow: 0 12px 24px rgba(37, 99, 235, 0.5);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 4px 15px rgba(37, 99, 235, 0.3);
    }
}

.chat-launcher:hover {
    animation: none;
    transform: scale(1.1) !important;
    background: #1d4ed8;
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.4);
}

.chat-launcher:active {
    transform: scale(0.95) !important;
}

/* Floating Chat Container */
.floating-chat {
    position: fixed;
    bottom: 110px; /* Position above the chat button */
    right: 30px;
    top: auto; /* Ensure it's positioned from bottom, not top */
    width: 400px; /* Orta seviye genişlik */
    height: 700px; /* Yükseklik - ARTTIRILDI */
    max-height: 90vh; /* Viewport yüksekliğinin %90'ı kadar - ARTTIRILDI */
    background-color: #ffffff;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
    z-index: 9999;
    display: none; /* Hidden by default */
    flex-direction: column;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    border-radius: 20px;
    opacity: 0;
    transform: scale(0.8);
    transform-origin: bottom right; /* Start transformation from bottom right */
}

.floating-chat.open {
    display: flex !important;
    opacity: 1 !important;
    transform: scale(1) !important;
    animation: chatOpen 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes chatOpen {
    0% {
        opacity: 0;
        transform: scale(0.8);
        transform-origin: bottom right;
    }
    100% {
        opacity: 1; 
        transform: scale(1);
        transform-origin: bottom right;
    }
}

/* Chat Header */
.chat-header {
    padding: 18px 20px;
    background: linear-gradient(to right, #2563eb, #3b82f6);
    color: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    height: 68px; /* Biraz daha yüksek başlık */
}

.chat-header h5 {
    margin: 0;
    font-weight: 600;
    font-size: 1.2rem; /* Başlık daha büyük */
    display: flex;
    align-items: center;
    gap: 10px;
}

.chat-header h5 i {
    font-size: 1.3rem; /* İkon daha büyük */
}

.chat-close {
    background: transparent;
    color: white;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.8;
    transition: all 0.2s;
}

.chat-close:hover {
    opacity: 1;
}

/* Chat Messages Area */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background-color: #f8fafc;
}

.message {
    margin-bottom: 15px;
    display: flex;
    flex-direction: column;
}

.message.user {
    align-items: flex-end;
}

.message.bot {
    align-items: flex-start;
}

.message-content {
    padding: 14px 20px;
    border-radius: 18px;
    max-width: 85%;
    word-wrap: break-word;
    line-height: 1.6;
    font-size: 16px; /* Daha büyük yazı tipi boyutu */
}

.message.user .message-content {
    background-color: #2563eb;
    color: white;
    border-bottom-right-radius: 4px;
}

.message.bot .message-content {
    background-color: #e2e8f0;
    color: #334155;
    border-bottom-left-radius: 4px;
}

.message.bot .message-content p {
    margin-bottom: 0.5rem;
}

.message.bot .message-content p:last-child {
    margin-bottom: 0;
}

/* Chat Input Area */
.chat-input {
    padding: 15px;
    background-color: #ffffff;
    border-top: 1px solid #e5e7eb;
}

.input-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 0 10px 0;
}

.input-wrapper input {
    flex: 1;
    border: 1px solid #e5e7eb;
    border-radius: 24px;
    padding: 14px 20px; /* Daha büyük padding */
    font-size: 16px; /* Daha büyük yazı tipi */
    outline: none;
    transition: border 0.2s ease;
}

.input-wrapper input:focus {
    border-color: #2563eb;
}

.input-wrapper button {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    border: none;
    background-color: #2563eb;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.2s ease;
    font-size: 18px;
}

.input-wrapper button:hover {
    background-color: #1d4ed8;
}

/* Photo Preview */
#photo-preview-container {
    margin-top: 10px;
    background: #f0f7ff;
    border-radius: 12px;
    padding: 10px;
}

.photo-preview {
    position: relative;
    width: 100px;
    height: 100px;
    margin-right: 10px;
    display: inline-block;
}

.photo-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
}

#remove-photo {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #ff4444;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    cursor: pointer;
    font-size: 12px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.photo-preview-text {
    display: inline-block;
    vertical-align: top;
    margin-top: 8px;
    color: #2563eb;
    font-size: 14px;
}

/* Typing Indicator */
.typing-indicator {
    display: inline-flex;
    align-items: center;
}

.typing-indicator span {
    height: 8px;
    width: 8px;
    background: #606060;
    display: block;
    border-radius: 50%;
    margin-right: 5px;
    animation: typing 1s infinite;
}

.typing-indicator span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-indicator span:nth-child(3) {
    animation-delay: 0.4s;
    margin-right: 0;
}

@keyframes typing {
    0% { transform: translateY(0); }
    30% { transform: translateY(-5px); }
    60% { transform: translateY(0); }
}

/* Suggested Questions */
.suggested-questions {
    padding: 8px 15px; /* Reduced padding */
    border-top: 1px solid #e5e7eb;
    background-color: #f9fafb;
    max-height: 110px; /* Limit height for the section */
    overflow-y: auto; /* Add scroll if questions exceed max-height */
}

.suggested-question {
    font-size: 13px; /* Reduced font size */
    margin-right: 8px;
    margin-bottom: 8px; /* Reduced bottom margin */
    padding: 6px 12px; /* Reduced padding */
    background-color: #e2e8f0;
    border-radius: 25px; /* More rounded corners */
    display: inline-block;
    cursor: pointer;
    color: #334155;
    white-space: nowrap;
    transition: all 0.2s ease;
    border: 1px solid #cbd5e1; /* Add border for better visibility */
}

.suggested-question:hover {
    transform: translateY(-2px);
    background-color: #cbd5e1;
}

/* Chat connector - adds a visual cue connecting button and chat window */
.floating-chat.open::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    background-color: #ffffff;
    bottom: -10px;
    right: 32px; /* Position toward the right where chat button is */
    transform: rotate(45deg);
    box-shadow: 4px 4px 8px rgba(0, 0, 0, 0.1);
    z-index: -1;
}

@media (min-width: 768px) {
    .floating-chat.open::after {
        display: block;
    }
}

/* Responsive styles for the chat */
@media (max-width: 992px) {
    .floating-chat {
        width: 90%;
        max-width: 500px;
        height: 680px; /* Sabit yükseklik - ARTTIRILDI */
        right: 5%;
        bottom: 100px;
        top: auto; /* Ensure it's positioned from bottom, not top */
    }
}

@media (max-width: 768px) {
    .floating-chat {
        width: 90%;
        height: 90vh; /* Ekran yüksekliğinin %90'ı - ARTTIRILDI */
        max-height: 700px; /* Maksimum yükseklik - ARTTIRILDI */
        bottom: 90px;
    }
}

@media (max-width: 576px) {
    .floating-chat {
        width: 100%;
        height: 90%; /* Increased height for mobile */
        left: 0;
        right: 0;
        bottom: 0;
        top: auto; /* Ensure it's not positioned from the top */
        border-radius: 20px 20px 0 0;
        transform-origin: bottom center;
        max-height: 95vh; /* Increased maximum height */
    }
    
    @keyframes chatOpen {
        0% {
            opacity: 0;
            transform: scale(0.8);
            transform-origin: bottom center;
            bottom: -100px;
        }
        100% {
            opacity: 1;
            transform: scale(1);
            transform-origin: bottom center;
            bottom: 0;
        }
    }
    
    /* Mobil görünümde alt ok kaldırılıyor */
    .floating-chat.open::after {
        display: none;
    }
    
    .chat-messages {
        padding: 15px;
    }
    
    .message-content {
        max-width: 85%;
        padding: 10px 15px;
    }
    
    .input-wrapper {
        padding: 12px;
    }
    
    .chat-launcher {
        bottom: 20px;
        right: 20px;
    }
}
