/**
 * WhatsApp FAQ Modal Styles
 * Clean, professional design without gradients
 * 
 * @author George
 * @module DecoModule
 */

/* Modal Overlay */
.whatsapp-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.whatsapp-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Modal Container */
.whatsapp-modal-container {
    background: #ffffff;
    border-radius: 16px;
    width: 90%;
    max-width: 420px;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    transform: scale(0.9) translateY(20px);
    transition: transform 0.3s ease;
}

.whatsapp-modal-overlay.active .whatsapp-modal-container {
    transform: scale(1) translateY(0);
}

/* Modal Header */
.whatsapp-modal-header {
    display: flex;
    align-items: center;
    padding: 20px;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
    position: relative;
}

.whatsapp-header-icon {
    width: 48px;
    height: 48px;
    background: #e8f5e9;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 14px;
    flex-shrink: 0;
}

.whatsapp-header-text {
    flex: 1;
}

.whatsapp-header-text h3 {
    margin: 0 0 4px 0;
    font-size: 18px;
    font-weight: 600;
    color: #1a1a2e;
}

.whatsapp-header-text p {
    margin: 0;
    font-size: 13px;
    color: #6c757d;
}

.whatsapp-modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    color: #6c757d;
    font-size: 24px;
    cursor: pointer;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    line-height: 1;
}

.whatsapp-modal-close:hover {
    background: #e9ecef;
    color: #343a40;
}

/* Modal Content */
.whatsapp-modal-content {
    padding: 20px;
    overflow-y: auto;
    max-height: calc(90vh - 160px);
}

/* Customer Greeting */
.whatsapp-greeting {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    background: #e3f2fd;
    border-left: 3px solid #2196F3;
    border-radius: 8px;
    margin-bottom: 16px;
}

.greeting-wave {
    font-size: 20px;
    margin-right: 10px;
}

.greeting-text {
    font-size: 14px;
    color: #1565c0;
}

.greeting-text strong {
    color: #0d47a1;
}

/* FAQ Buttons */
.whatsapp-faq-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.whatsapp-faq-btn {
    display: flex;
    align-items: center;
    padding: 16px;
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
    width: 100%;
}

.whatsapp-faq-btn:hover {
    border-color: #25D366;
    background: #f0fdf4;
    transform: translateX(4px);
}

.whatsapp-faq-btn .btn-icon {
    font-size: 24px;
    margin-right: 14px;
    flex-shrink: 0;
}

.whatsapp-faq-btn .btn-text {
    flex: 1;
    font-size: 15px;
    font-weight: 500;
    color: #1a1a2e;
}

.whatsapp-faq-btn .btn-arrow {
    color: #9e9e9e;
    font-size: 18px;
    transition: transform 0.2s ease;
}

.whatsapp-faq-btn:hover .btn-arrow {
    transform: translateX(4px);
    color: #25D366;
}

/* WhatsApp Button (green) */
.whatsapp-faq-btn.whatsapp-direct {
    background: #25D366;
    border-color: #25D366;
    color: white;
}

.whatsapp-faq-btn.whatsapp-direct .btn-text {
    color: white;
}

.whatsapp-faq-btn.whatsapp-direct .btn-arrow {
    color: rgba(255, 255, 255, 0.8);
}

.whatsapp-faq-btn.whatsapp-direct:hover {
    background: #1fb855;
    border-color: #1fb855;
}

/* Loading State */
.whatsapp-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 40px 20px;
    color: #6c757d;
}

.whatsapp-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid #e9ecef;
    border-top-color: #25D366;
    border-radius: 50%;
    animation: whatsapp-spin 1s linear infinite;
    margin-bottom: 12px;
}

@keyframes whatsapp-spin {
    to { transform: rotate(360deg); }
}

/* Order Selection */
.whatsapp-order-selection {
    animation: slideInRight 0.3s ease;
}

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

.order-selection-header {
    margin-bottom: 16px;
}

.order-selection-header h4 {
    margin: 12px 0 0 0;
    font-size: 15px;
    font-weight: 600;
    color: #1a1a2e;
}

.whatsapp-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-size: 13px;
    color: #495057;
    cursor: pointer;
    transition: all 0.2s ease;
}

.whatsapp-back-btn:hover {
    background: #e9ecef;
    border-color: #ced4da;
}

/* Orders List */
.whatsapp-orders-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.whatsapp-order-item {
    display: flex;
    align-items: center;
    padding: 14px 16px;
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.whatsapp-order-item:hover {
    border-color: #25D366;
    background: #f0fdf4;
}

.order-icon {
    font-size: 22px;
    margin-right: 12px;
}

.order-details {
    flex: 1;
}

.order-id {
    font-weight: 600;
    font-size: 14px;
    color: #1a1a2e;
    margin-bottom: 2px;
}

.order-date {
    font-size: 12px;
    color: #6c757d;
}

.order-status {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.order-status.processing {
    background: rgba(33, 150, 243, 0.1);
    color: #1976d2;
    border-left: 3px solid #1976d2;
}

.order-status.shipped {
    background: rgba(37, 211, 102, 0.1);
    color: #25D366;
    border-left: 3px solid #25D366;
}

.whatsapp-no-orders {
    text-align: center;
    padding: 30px 20px;
    color: #6c757d;
}

.whatsapp-no-orders.whatsapp-delivery-info {
    text-align: left;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 10px;
    max-height: 350px;
    overflow-y: auto;
}

.whatsapp-delivery-info .delivery-info-content {
    font-size: 13px;
    line-height: 1.6;
    color: #495057;
}

.whatsapp-delivery-info .delivery-info-content strong {
    color: #1a1a2e;
}

.whatsapp-back-bottom {
    margin-top: 16px;
    text-align: center;
}

.whatsapp-back-bottom .whatsapp-back-btn {
    display: inline-flex;
}

.response-back-bottom {
    margin-top: 16px;
    text-align: center;
}

.response-back-bottom .whatsapp-back-btn {
    display: inline-flex;
}

.whatsapp-no-orders .no-orders-icon {
    font-size: 48px;
    margin-bottom: 12px;
    opacity: 0.5;
}

.whatsapp-no-orders p {
    margin: 0 0 16px 0;
    font-size: 14px;
}

/* Response Display */
.whatsapp-response {
    animation: slideInRight 0.3s ease;
}

.response-header {
    margin-bottom: 16px;
}

.response-content {
    padding: 20px;
    background: #f8f9fa;
    border-radius: 12px;
    border-left: 4px solid #25D366;
    margin-bottom: 20px;
}

.response-content p {
    margin: 0;
    font-size: 14px;
    line-height: 1.6;
    color: #343a40;
    white-space: pre-line;
}

.response-actions {
    text-align: center;
}

.response-help-text {
    font-size: 13px;
    color: #6c757d;
    margin-bottom: 12px;
}

.whatsapp-contact-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: #25D366;
    color: white !important;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none !important;
    transition: all 0.2s ease;
}

.whatsapp-contact-btn:hover {
    background: #1fb855;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.3);
}

/* Modal Footer */
.whatsapp-modal-footer {
    padding: 14px 20px;
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
}

.whatsapp-footer-back-btn {
    display: none;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    font-size: 12px;
    color: #495057;
    cursor: pointer;
    transition: all 0.2s ease;
}

.whatsapp-footer-back-btn:hover {
    background: #e9ecef;
    border-color: #ced4da;
}

.whatsapp-footer-back-btn.visible {
    display: inline-flex !important;
}

.footer-text {
    font-size: 12px;
    color: #9e9e9e;
}

/* WhatsApp Group Selection */
.whatsapp-group-header {
    margin-bottom: 16px;
}

.whatsapp-group-header h4 {
    margin: 0 0 6px 0;
    font-size: 16px;
    font-weight: 600;
    color: #1a1a2e;
}

.whatsapp-group-header p {
    margin: 0;
    font-size: 13px;
    color: #6c757d;
}

.whatsapp-group-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.whatsapp-group-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    background: #fff;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
    width: 100%;
}

.whatsapp-group-item:hover {
    border-color: #25D366;
    background: #f0fdf4;
    transform: translateX(4px);
}

.whatsapp-group-icon {
    font-size: 26px;
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #e8f5e9;
    border-radius: 10px;
}

.whatsapp-group-content {
    flex: 1;
    min-width: 0;
}

.whatsapp-group-label {
    font-size: 14px;
    font-weight: 600;
    color: #1a1a2e;
    margin-bottom: 4px;
}

.whatsapp-group-number {
    font-size: 12px;
    color: #6c757d;
    font-family: 'Courier New', monospace;
}

.whatsapp-group-arrow {
    color: #9e9e9e;
    font-size: 18px;
    transition: transform 0.2s ease;
}

.whatsapp-group-item:hover .whatsapp-group-arrow {
    transform: translateX(4px);
    color: #25D366;
}

/* Responsive */
@media (max-width: 480px) {
    .whatsapp-modal-container {
        width: 95%;
        max-height: 95vh;
        border-radius: 12px;
    }
    
    .whatsapp-modal-header {
        padding: 16px;
    }
    
    .whatsapp-header-icon {
        width: 40px;
        height: 40px;
    }
    
    .whatsapp-header-text h3 {
        font-size: 16px;
    }
    
    .whatsapp-modal-content {
        padding: 16px;
    }
    
    .whatsapp-faq-btn {
        padding: 14px;
    }
    
    .whatsapp-faq-btn .btn-icon {
        font-size: 20px;
    }
    
    .whatsapp-faq-btn .btn-text {
        font-size: 14px;
    }
}

/* Hide original WhatsApp button when modal is active */
body.whatsapp-modal-active .whatsapp-floating-button,
body.whatsapp-modal-active [class*="whatsapp-button"],
body.whatsapp-modal-active [class*="wa-button"],
body.whatsapp-modal-active .wa-chat-popup {
    z-index: 1 !important;
}
