/* Site İçi Mesajlaşma Chat Widget Styles */

#siteChatWidget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 10001; /* Bottom nav ve cookie consent'in üzerinde */
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* Mobilde bottom navigation üzerinde olması için */
@media (max-width: 991.98px) {
    #siteChatWidget {
        bottom: 90px; /* Bottom nav'in üstünde (72px + 18px boşluk) */
        right: 15px;
    }
}

/* Chat Button */
.site-chat-button {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    color: white;
    font-size: 24px;
}

.site-chat-button:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 25px rgba(102, 126, 234, 0.5);
}

.site-chat-button.active {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.site-chat-button.new-message {
    animation: pulseChatButton 2s ease-in-out infinite;
}

@keyframes pulseChatButton {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 4px 20px rgba(102, 126, 234, 0.4);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 6px 30px rgba(102, 126, 234, 0.6);
    }
}

.site-chat-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ff4757;
    color: white;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    border: 2px solid white;
}

/* Chat Window */
.site-chat-window {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 380px;
    height: 600px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.95);
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    overflow: hidden;
}

.site-chat-window.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

/* Chat Header */
.site-chat-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.site-chat-header-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    font-size: 16px;
}

.site-chat-header-title i {
    font-size: 20px;
}

.site-chat-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s;
    font-size: 16px;
}

.site-chat-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Chat Body */
.site-chat-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #f8f9fa;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.site-chat-welcome {
    text-align: center;
    padding: 40px 20px;
    color: #6c757d;
}

.site-chat-welcome i {
    font-size: 48px;
    color: #dee2e6;
    margin-bottom: 15px;
    display: block;
}

.site-chat-welcome p {
    margin: 0;
    font-size: 14px;
}

/* Messages */
.site-chat-message {
    display: flex;
    flex-direction: column;
    max-width: 75%;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.site-chat-message.user {
    align-self: flex-end;
    align-items: flex-end;
}

.site-chat-message.admin {
    align-self: flex-start;
    align-items: flex-start;
}

.site-chat-message-content {
    padding: 12px 16px;
    border-radius: 18px;
    word-wrap: break-word;
    line-height: 1.4;
    font-size: 14px;
}

.site-chat-message.user .site-chat-message-content {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-bottom-right-radius: 4px;
}

.site-chat-message.admin .site-chat-message-content {
    background: white;
    color: #2c3e50;
    border: 1px solid #e9ecef;
    border-bottom-left-radius: 4px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.site-chat-message-time {
    font-size: 11px;
    color: #6c757d;
    margin-top: 4px;
    padding: 0 4px;
}

/* Chat Footer */
.site-chat-footer {
    padding: 16px;
    background: white;
    border-top: 1px solid #e9ecef;
    flex-shrink: 0;
}

.site-chat-input-container {
    display: flex;
    align-items: flex-end;
    gap: 8px;
}

.site-chat-input {
    flex: 1;
    border: 1px solid #dee2e6;
    border-radius: 20px;
    padding: 10px 16px;
    font-size: 14px;
    resize: none;
    max-height: 120px;
    font-family: inherit;
    transition: border-color 0.2s;
}

.site-chat-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.site-chat-send {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
    font-size: 16px;
}

.site-chat-send:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.site-chat-send:active {
    transform: scale(0.95);
}

/* Scrollbar Styling */
.site-chat-body::-webkit-scrollbar {
    width: 6px;
}

.site-chat-body::-webkit-scrollbar-track {
    background: transparent;
}

.site-chat-body::-webkit-scrollbar-thumb {
    background: #dee2e6;
    border-radius: 3px;
}

.site-chat-body::-webkit-scrollbar-thumb:hover {
    background: #adb5bd;
}

/* Responsive */
@media (max-width: 768px) {
    #siteChatWidget {
        bottom: 15px;
        right: 15px;
    }

    .site-chat-button {
        width: 56px;
        height: 56px;
        font-size: 22px;
    }

    .site-chat-window {
        width: calc(100vw - 30px);
        max-width: 380px;
        height: calc(100vh - 100px);
        max-height: 600px;
        bottom: 76px;
    }

    .site-chat-message {
        max-width: 85%;
    }
}

@media (max-width: 480px) {
    .site-chat-window {
        width: calc(100vw - 20px);
        height: calc(100vh - 80px);
    }
}
