/* Chat Widget Styles */

/* Chat Button (Sol Alt Köşe) */
.chat-widget-button {
    position: fixed;
    bottom: 20px;
    left: 20px;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #00B4DB 0%, #0083B0 100%);
    border-radius: 50%;
    box-shadow: 0 4px 12px rgba(0, 180, 219, 0.4);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9998;
    transition: all 0.3s ease;
}

.chat-widget-button:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 180, 219, 0.6);
}

.chat-widget-button i {
    color: white;
    font-size: 28px;
}

.chat-widget-button.active {
    transform: rotate(90deg);
}

/* Unread Badge */
.chat-widget-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #e74c3c;
    color: white;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
}

/* Chat Window */
.chat-widget-window {
    position: fixed;
    bottom: 90px;
    left: 20px;
    width: 400px;
    height: 550px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    display: none;
    flex-direction: column;
    z-index: 9999;
    overflow: hidden;
}

.chat-widget-window.active {
    display: flex;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Chat Header */
.chat-widget-header {
    background: linear-gradient(135deg, #00B4DB 0%, #0083B0 100%);
    color: white;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.chat-widget-header-info h4 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.chat-widget-header-info p {
    margin: 4px 0 0 0;
    font-size: 12px;
    opacity: 0.9;
}

.chat-widget-header-actions button {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    font-size: 20px;
    padding: 4px 8px;
    transition: opacity 0.2s;
}

.chat-widget-header-actions button:hover {
    opacity: 0.8;
}

/* Chat Messages */
.chat-widget-messages {
    flex: 1;
    padding: 16px 14px;
    overflow-y: auto;
    background: #f5f5f5;
}

.chat-message {
    margin-bottom: 16px;
    display: flex;
    align-items: flex-end;
    width: 100%;
}

.chat-message.bot,
.chat-message.admin {
    justify-content: flex-start;
}

.chat-message.visitor {
    justify-content: flex-end;
}

/* Parent div içindeki wrapper */
.chat-message > div {
    max-width: 75%;
    display: flex;
    flex-direction: column;
}

.chat-message-bubble {
    padding: 10px 14px;
    border-radius: 18px;
    font-size: 14px;
    line-height: 1.4;
    word-wrap: break-word;
    word-break: break-word;
    overflow-wrap: break-word;
}

.chat-message-bubble a {
    color: inherit;
    text-decoration: underline;
    font-weight: 600;
    transition: opacity 0.2s;
}

.chat-message-bubble a:hover {
    opacity: 0.8;
}

.chat-message.bot .chat-message-bubble,
.chat-message.admin .chat-message-bubble {
    background: white;
    color: #333;
    border-bottom-left-radius: 4px;
}

.chat-message.visitor .chat-message-bubble {
    background: linear-gradient(135deg, #00B4DB 0%, #0083B0 100%);
    color: white;
    border-bottom-right-radius: 4px;
}

.chat-message-time {
    font-size: 11px;
    color: #999;
    margin-top: 4px;
    padding: 0 2px;
}

.chat-message.bot .chat-message-time,
.chat-message.admin .chat-message-time {
    text-align: left;
}

.chat-message.visitor .chat-message-time {
    text-align: right;
}

/* Typing Indicator */
.chat-typing {
    display: none;
    align-items: center;
    padding: 10px 14px;
    background: white;
    border-radius: 18px;
    border-bottom-left-radius: 4px;
    width: fit-content;
    margin-bottom: 16px;
}

.chat-typing.active {
    display: flex;
}

.chat-typing-dot {
    width: 8px;
    height: 8px;
    background: #999;
    border-radius: 50%;
    margin-right: 4px;
    animation: typing 1.4s infinite;
}

.chat-typing-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.chat-typing-dot:nth-child(3) {
    animation-delay: 0.4s;
    margin-right: 0;
}

@keyframes typing {
    0%, 60%, 100% {
        transform: translateY(0);
    }
    30% {
        transform: translateY(-10px);
    }
}

/* Quick Replies */
.chat-quick-replies {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 10px 0;
}

.chat-quick-reply {
    background: white;
    border: 1px solid #00B4DB;
    color: #00B4DB;
    padding: 8px 14px;
    border-radius: 18px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}

.chat-quick-reply:hover {
    background: #00B4DB;
    color: white;
}

/* Live Support Button */
.chat-live-support-btn {
    background: #27ae60;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    margin-top: 10px;
    transition: background 0.2s;
}

.chat-live-support-btn:hover {
    background: #229954;
}

/* Chat Input */
.chat-widget-input {
    padding: 16px;
    background: white;
    border-top: 1px solid #e0e0e0;
}

.chat-widget-input.disabled {
    opacity: 0.6;
    pointer-events: none;
}

.chat-input-form {
    display: flex;
    gap: 10px;
}

.chat-input-field {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid #ddd;
    border-radius: 20px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

.chat-input-field:focus {
    border-color: #00B4DB;
}

.chat-send-btn {
    background: linear-gradient(135deg, #00B4DB 0%, #0083B0 100%);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
}

.chat-send-btn:hover {
    transform: scale(1.05);
}

.chat-send-btn i {
    font-size: 16px;
}

/* Contact Form Modal */
.chat-contact-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    backdrop-filter: blur(4px);
}

.chat-contact-modal.active {
    display: flex;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.chat-contact-form-wrapper {
    background: white;
    border-radius: 16px;
    padding: 0;
    width: 90%;
    max-width: 450px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideInUp 0.3s ease;
    overflow: hidden;
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.chat-contact-form-header {
    background: linear-gradient(135deg, #00B4DB 0%, #0083B0 100%);
    color: white;
    padding: 24px;
    text-align: center;
    position: relative;
}

.chat-contact-form-header h3 {
    margin: 0 0 8px 0;
    font-size: 22px;
    font-weight: 700;
}

.chat-contact-form-header p {
    margin: 0;
    font-size: 14px;
    opacity: 0.95;
}

.chat-contact-form-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.chat-contact-form-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

.chat-contact-form-body {
    padding: 24px;
}

.chat-form-icon {
    text-align: center;
    margin-bottom: 20px;
}

.chat-form-icon i {
    font-size: 48px;
    color: #00B4DB;
}

.chat-form-group {
    margin-bottom: 16px;
}

.chat-form-group label {
    display: block;
    font-size: 14px;
    color: #333;
    margin-bottom: 8px;
    font-weight: 600;
}

.chat-form-group label .required {
    color: #e74c3c;
    margin-left: 2px;
}

.chat-form-group input,
.chat-form-group textarea {
    width: 100%;
    padding: 12px 14px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 14px;
    outline: none;
    transition: all 0.3s;
    font-family: inherit;
}

.chat-form-group input:focus,
.chat-form-group textarea:focus {
    border-color: #00B4DB;
    box-shadow: 0 0 0 3px rgba(0, 180, 219, 0.1);
}

.chat-form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.chat-form-note {
    font-size: 12px;
    color: #999;
    margin-top: 6px;
    font-style: italic;
}

.chat-form-buttons {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

.chat-form-submit {
    flex: 1;
    background: linear-gradient(135deg, #00B4DB 0%, #0083B0 100%);
    color: white;
    border: none;
    padding: 14px 24px;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.chat-form-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 180, 219, 0.4);
}

.chat-form-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.chat-form-cancel {
    padding: 14px 24px;
    background: #f5f5f5;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    color: #666;
    cursor: pointer;
    transition: all 0.3s;
}

.chat-form-cancel:hover {
    background: #e0e0e0;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .chat-contact-form-wrapper {
        width: 95%;
        max-width: none;
    }

    .chat-contact-form-header h3 {
        font-size: 20px;
    }

    .chat-contact-form-body {
        padding: 20px;
    }

    .chat-form-buttons {
        flex-direction: column;
    }

    .chat-form-cancel {
        order: 2;
    }
}

/* Scrollbar */
.chat-widget-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-widget-messages::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.chat-widget-messages::-webkit-scrollbar-thumb {
    background: #c0c0c0;
    border-radius: 3px;
}

.chat-widget-messages::-webkit-scrollbar-thumb:hover {
    background: #a0a0a0;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .chat-widget-window {
        width: calc(100% - 20px);
        height: calc(100% - 90px);
        left: 10px;
        bottom: 80px;
        border-radius: 12px 12px 0 0;
    }

    .chat-widget-button {
        bottom: 10px;
        left: 10px;
    }

    .chat-widget-messages {
        padding: 12px 6px;
    }

    .chat-message > div {
        max-width: 85%;
    }

    .chat-message-bubble {
        font-size: 12px;
        padding: 8px 10px;
    }
}

/* Hidden class */
.hidden {
    display: none !important;
}
