﻿/* WhatsApp Widget Styles */
.whatsapp-widget {
    position: fixed;
    bottom: 90px;
    right: 20px;
    z-index: 1000;
}

@media (max-width: 768px) {
    .whatsapp-widget {
        bottom: 90px; /* Bottom nav üstünde */
        right: 16px;
    }
}

/* Main WhatsApp Button */
.whatsapp-main-btn {
    position: relative;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #25d366 0%, #128c7e 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(37, 211, 102, 0.4);
    transition: all 0.3s ease;
    animation: whatsapp-bounce 2s infinite ease-in-out;
}

    .whatsapp-main-btn:hover {
        transform: scale(1.1);
        box-shadow: 0 6px 25px rgba(37, 211, 102, 0.6);
    }

    .whatsapp-main-btn i {
        color: white;
        font-size: 32px;
        animation: whatsapp-icon-pulse 2s infinite;
    }

.whatsapp-pulse {
    position: absolute;
    width: 60px;
    height: 60px;
    border: 2px solid #25d366;
    border-radius: 50%;
    animation: whatsapp-pulse 2s infinite;
}

/* Quick Actions */
.whatsapp-quick-actions {
    position: absolute;
    bottom: 75px;
    right: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s ease;
}

.whatsapp-widget.active .whatsapp-quick-actions {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.quick-action-item {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    animation: fadeInUp 0.3s ease forwards;
}

    .quick-action-item:nth-child(1) {
        animation-delay: 0.1s;
    }

    .quick-action-item:nth-child(2) {
        animation-delay: 0.2s;
    }

    .quick-action-item:nth-child(3) {
        animation-delay: 0.3s;
    }

.action-btn {
    width: 45px;
    height: 45px;
    background: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
    transition: all 0.2s ease;
}

    .action-btn:hover {
        background: #25d366;
        transform: scale(1.1);
    }

        .action-btn:hover i {
            color: white;
        }

    .action-btn i {
        font-size: 20px;
        color: #25d366;
        transition: color 0.2s ease;
    }

.action-label {
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
    opacity: 0;
    transform: translateX(10px);
    transition: all 0.2s ease;
}

.quick-action-item:hover .action-label {
    opacity: 1;
    transform: translateX(0);
}

/* Chat Preview */
.whatsapp-chat-preview {
    position: absolute;
    bottom: 75px;
    right: 70px;
    width: 320px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.9);
    transition: all 0.3s ease;
    overflow: hidden;
}

@media (max-width: 768px) {
    .whatsapp-chat-preview {
        right: -250px;
        width: 280px;
    }
}

.whatsapp-widget.preview-active .whatsapp-chat-preview {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.chat-header {
    background: #25d366;
    color: white;
    padding: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.chat-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.chat-info h6 {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
}

.chat-info .status {
    font-size: 12px;
    opacity: 0.9;
}

.chat-close {
    background: none;
    border: none;
    color: white;
    font-size: 20px;
    margin-left: auto;
    padding: 5px;
    border-radius: 50%;
    transition: background 0.2s ease;
}

    .chat-close:hover {
        background: rgba(255, 255, 255, 0.2);
    }

.chat-body {
    padding: 15px;
    max-height: 150px;
    overflow-y: auto;
}

.message {
    margin-bottom: 10px;
}

    .message.received .message-content {
        background: #f0f0f0;
        color: #333;
        padding: 10px 12px;
        border-radius: 0 12px 12px 12px;
        max-width: 80%;
        font-size: 13px;
        line-height: 1.4;
    }

.message-time {
    font-size: 10px;
    color: #999;
    margin-top: 5px;
    margin-left: 5px;
}

.chat-footer {
    padding: 10px 15px;
    border-top: 1px solid #f0f0f0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.quick-reply-btn {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    color: #495057;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

    .quick-reply-btn:hover {
        background: #25d366;
        border-color: #25d366;
        color: white;
    }

/* Animations */
@keyframes whatsapp-bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }

    40% {
        transform: translateY(-5px);
    }

    60% {
        transform: translateY(-3px);
    }
}

@keyframes whatsapp-pulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }

    100% {
        transform: scale(1.4);
        opacity: 0;
    }
}

@keyframes whatsapp-icon-pulse {
    0%, 100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Modal Improvements */
#whatsappQuoteModal .modal-content {
    border-radius: 15px;
    overflow: hidden;
}

#whatsappQuoteModal .modal-header {
    background: linear-gradient(135deg, #25d366 0%, #128c7e 100%);
    color: white;
    border: none;
}

#whatsappQuoteModal .btn-close {
    filter: invert(1);
}

#whatsappQuoteModal .form-select,
#whatsappQuoteModal .form-control {
    border-radius: 8px;
    border: 2px solid #e9ecef;
    padding: 10px 15px;
}

    #whatsappQuoteModal .form-select:focus,
    #whatsappQuoteModal .form-control:focus {
        border-color: #25d366;
        box-shadow: 0 0 0 0.2rem rgba(37, 211, 102, 0.25);
    }

#whatsappQuoteModal .btn-success {
    background: linear-gradient(135deg, #25d366 0%, #128c7e 100%);
    border: none;
    padding: 12px 24px;
    font-weight: 600;
    border-radius: 8px;
}

    #whatsappQuoteModal .btn-success:hover {
        background: linear-gradient(135deg, #128c7e 0%, #25d366 100%);
        transform: translateY(-1px);
    }

/* Responsive Design */
@media (max-width: 768px) {
    .whatsapp-main-btn {
        width: 55px;
        height: 55px;
    }

        .whatsapp-main-btn i {
            font-size: 28px;
        }

    .action-btn {
        width: 40px;
        height: 40px;
    }

        .action-btn i {
            font-size: 18px;
        }
}

/* Accessibility */
.whatsapp-main-btn:focus,
.action-btn:focus,
.quick-reply-btn:focus {
    outline: 2px solid #25d366;
    outline-offset: 2px;
}

/* Print - Hide WhatsApp widget */
@media print {
    .whatsapp-widget {
        display: none !important;
    }
}
