/* Chat Sistemi CSS */

/* Chat Butonu (Sağ Alt Köşe) */
.chat-button {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    background: #333;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 1000;
    transition: all 0.3s ease;
}

.chat-button:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0,0,0,0.2);
}

.chat-button i {
    font-size: 24px;
}

.chat-button .unread-count {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #e74c3c;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
}

/* Chat Overlay (Arka Plan) */
.chat-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: flex-start;
    justify-content: center;
    padding-top: 20px;
    z-index: 9999;
}

.chat-overlay.open {
    display: flex;
}

/* Chat Penceresi */
.chat-window {
    width: 400px;
    max-width: 90%;
    height: 600px;
    max-height: 90vh;
    background: white;
    border-radius: 15px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.3);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Chat Header */
.chat-header {
    background: #333;
    color: white;
    padding: 15px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.chat-header-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.chat-header-avatar {
    width: 40px;
    height: 40px;
    background: #555;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-header-avatar i {
    font-size: 20px;
}

.chat-header-text h4 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.chat-header-text p {
    margin: 0;
    font-size: 12px;
    color: #ddd;
}

.chat-close {
    background: none;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    padding: 5px;
}

.chat-close:hover {
    opacity: 0.8;
}

/* Chat Body (Mesajlar) */
.chat-body {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background: #f5f5f5;
}

.chat-message {
    margin-bottom: 15px;
    display: flex;
    flex-direction: column;
}

.chat-message.user {
    align-items: flex-end;
}

.chat-message.admin {
    align-items: flex-start;
}

.message-bubble {
    max-width: 70%;
    padding: 10px 15px;
    border-radius: 15px;
    word-wrap: break-word;
}

.chat-message.user .message-bubble {
    background: #333;
    color: white;
    border-bottom-right-radius: 5px;
}

.chat-message.admin .message-bubble {
    background: white;
    color: #333;
    border-bottom-left-radius: 5px;
}

.message-time {
    font-size: 11px;
    color: #999;
    margin-top: 5px;
}

/* Yazıyor animasyonu */
.typing-indicator {
    display: none;
    padding: 10px 15px;
    background: white;
    border-radius: 15px;
    width: fit-content;
}

.typing-indicator.show {
    display: flex;
    align-items: center;
    gap: 5px;
}

.typing-dot {
    width: 8px;
    height: 8px;
    background: #999;
    border-radius: 50%;
    animation: typing 1.4s infinite;
}

.typing-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {
    0%, 60%, 100% {
        transform: translateY(0);
    }
    30% {
        transform: translateY(-10px);
    }
}

/* Chat Footer (Input) */
.chat-footer {
    padding: 15px;
    background: white;
    border-top: 1px solid #eee;
}

.chat-input-container {
    display: flex;
    gap: 10px;
    align-items: center;
}

.chat-attach-btn {
    background: transparent;
    color: #666;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.chat-attach-btn:hover {
    background: #f0f0f0;
    color: #333;
}

.chat-attach-btn i {
    font-size: 18px;
}

.chat-input {
    flex: 1;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 20px;
    font-size: 14px;
    outline: none;
}

.chat-input:focus {
    border-color: #333;
}

.chat-send-btn {
    background: #333;
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s;
}

.chat-send-btn:hover {
    background: #555;
}

.chat-send-btn i {
    font-size: 16px;
}

/* Resim Önizleme */
.chat-image-preview {
    margin-top: 10px;
    padding: 10px;
    background: #f5f5f5;
    border-radius: 10px;
    position: relative;
}

.chat-image-preview img {
    max-height: 100px;
    object-fit: cover;
    border-radius: 8px;
}

.remove-preview {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.remove-preview:hover {
    background: rgba(0, 0, 0, 0.9);
}

/* Mesajdaki Resim */
.message-image {
    margin-top: 8px;
    border-radius: 10px;
    overflow: hidden;
    max-width: 200px;
    cursor: pointer;
    margin-bottom: 10px;
}

.message-image img {
    width: 100%;
    display: block;
}

/* Boş Chat Durumu */
.chat-empty {
    text-align: center;
    padding: 40px 20px;
    color: #999;
}

.chat-empty i {
    font-size: 48px;
    margin-bottom: 15px;
    color: #ddd;
}

.chat-empty h4 {
    margin: 0 0 10px 0;
    color: #666;
}

.chat-empty p {
    margin: 0;
    font-size: 14px;
}



/* Mobil için yükseklik ayarı */
@media (max-width: 768px) {
    .chat-overlay {
        padding-top: 20px;
    }
    
    .chat-window {
        max-height: calc(100vh - 40px);
    }
}

/* Scroll Bar */
.chat-body::-webkit-scrollbar {
    width: 6px;
}

.chat-body::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.chat-body::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

.chat-body::-webkit-scrollbar-thumb:hover {
    background: #999;
}
