/* WhatsApp Popup Styles */
.whatsapp-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease-out;
}

.whatsapp-popup-content {
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideUp 0.4s ease-out;
    direction: rtl;
    font-family: 'Cairo', sans-serif;
}

.popup-header {
    background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
    color: white;
    padding: 20px 25px;
    border-radius: 20px 20px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}

.popup-header h3 {
    margin: 0;
    font-size: 1.4rem;
    font-weight: 600;
}

.popup-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 24px;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    font-weight: bold;
}

.popup-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

.popup-body {
    padding: 30px 25px;
}

.popup-body p {
    color: #333;
    font-size: 1.1rem;
    line-height: 1.6;
    margin-bottom: 20px;
    text-align: center;
}

.code-input-container {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    align-items: center;
}

#user-code-input {
    flex: 1;
    padding: 15px 20px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    font-size: 1.1rem;
    font-family: 'Cairo', sans-serif;
    text-align: center;
    letter-spacing: 2px;
    font-weight: 600;
    transition: all 0.3s ease;
    outline: none;
}

#user-code-input:focus {
    border-color: #25D366;
    box-shadow: 0 0 0 3px rgba(37, 211, 102, 0.1);
    transform: translateY(-1px);
}

#user-code-input::placeholder {
    color: #9ca3af;
    letter-spacing: normal;
    font-weight: normal;
}

.verify-btn {
    background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
    color: white;
    border: none;
    padding: 15px 25px;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Cairo', sans-serif;
    white-space: nowrap;
}

.verify-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(37, 211, 102, 0.3);
}

.verify-btn:active {
    transform: translateY(0);
}

.whatsapp-section {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 25px;
    border-radius: 15px;
    text-align: center;
    border: 2px dashed #25D366;
}

.whatsapp-section p {
    color: #666;
    font-size: 1rem;
    margin-bottom: 15px;
}

.whatsapp-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
    color: white;
    text-decoration: none;
    padding: 15px 25px;
    border-radius: 50px;
    font-weight: 600;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(37, 211, 102, 0.3);
}

.whatsapp-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(37, 211, 102, 0.4);
    color: white;
}

.whatsapp-btn i {
    font-size: 1.3rem;
    animation: bounce 2s infinite;
}

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

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

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-5px);
    }
    60% {
        transform: translateY(-3px);
    }
}

/* Success/Error States */
.code-input-success {
    border-color: #10b981 !important;
    background-color: #f0fdf4;
}

.code-input-error {
    border-color: #ef4444 !important;
    background-color: #fef2f2;
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* Loading State */
.verify-btn.loading {
    background: #9ca3af;
    cursor: not-allowed;
    position: relative;
}

.verify-btn.loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    border: 2px solid transparent;
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .whatsapp-popup-content {
        width: 95%;
        margin: 10px;
        max-height: 85vh;
    }
    
    .popup-header {
        padding: 15px 20px;
    }
    
    .popup-header h3 {
        font-size: 1.2rem;
    }
    
    .popup-body {
        padding: 20px 15px;
    }
    
    .code-input-container {
        flex-direction: column;
        gap: 15px;
    }
    
    #user-code-input {
        width: 100%;
    }
    
    .verify-btn {
        width: 100%;
        padding: 15px;
    }
    
    .whatsapp-section {
        padding: 20px 15px;
    }
    
    .whatsapp-btn {
        width: 100%;
        justify-content: center;
        padding: 15px 20px;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .whatsapp-popup-content {
        background: #1f2937;
        color: white;
    }
    
    .popup-body p {
        color: #e5e7eb;
    }
    
    #user-code-input {
        background: #374151;
        border-color: #4b5563;
        color: white;
    }
    
    #user-code-input::placeholder {
        color: #9ca3af;
    }
    
    .whatsapp-section {
        background: linear-gradient(135deg, #374151 0%, #4b5563 100%);
        border-color: #25D366;
    }
    
    .whatsapp-section p {
        color: #d1d5db;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .whatsapp-popup-overlay {
        background: rgba(0, 0, 0, 0.9);
    }
    
    .popup-header {
        background: #25D366;
    }
    
    #user-code-input {
        border-width: 3px;
    }
    
    .verify-btn,
    .whatsapp-btn {
        background: #25D366;
        border: 2px solid #128C7E;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .whatsapp-popup-overlay,
    .whatsapp-popup-content,
    .popup-close,
    .verify-btn,
    .whatsapp-btn,
    #user-code-input {
        animation: none;
        transition: none;
    }
    
    .whatsapp-btn i {
        animation: none;
    }
}

