/* تصميم زر فتح الـ Popup */
.popup-trigger-btn {
    background: linear-gradient(135deg, #667eea 0%, #132e5d 100%);
    color: white;
    border: none;
    padding: 15px 30px;
    font-size: 16px;
    font-weight: bold;
    border-radius: 50px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    transition: all 0.3s ease;
    font-family: 'Arial', sans-serif;
}

.popup-trigger-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
    background: linear-gradient(135deg, #132e5d 0%, #667eea 100%);
}

/* تصميم الـ Popup Modal - مخفي بشكل افتراضي */
.popup-modal {
    display: none !important; /* مخفي بشكل افتراضي */
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

/* عند إظهار الـ popup */
.popup-modal.show {
    display: flex !important;
    align-items: center;
    justify-content: center;
    opacity: 1;
    visibility: visible;
    animation: fadeInPopup 0.3s ease forwards;
}

@keyframes fadeInPopup {
    from { 
        opacity: 0;
        transform: scale(0.8);
    }
    to { 
        opacity: 1;
        transform: scale(1);
    }
}

.popup-content {
    background: white;
    margin: 5% auto;
    padding: 30px;
    border-radius: 15px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    position: relative;
    animation: slideIn 0.3s ease;
    direction: rtl;
    text-align: right;
}

@keyframes slideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* زر الإغلاق */
.popup-close {
    color: #aaa;
    float: left;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    position: absolute;
    top: 15px;
    left: 20px;
    transition: color 0.3s ease;
}

.popup-close:hover {
    color: #000;
}

/* عنوان الـ Popup */
.popup-content h2 {
    color: #333;
    margin-bottom: 25px;
    font-size: 24px;
    text-align: center;
    border-bottom: 2px solid #667eea;
    padding-bottom: 10px;
}

/* تصميم النموذج */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #333;
    font-weight: bold;
    font-size: 14px;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s ease;
    box-sizing: border-box;
    font-family: 'Arial', sans-serif;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    transform: translateY(-1px);
}

/* تصميم حقل الهاتف */
.phone-input-container {
    display: flex;
    gap: 10px;
}

.phone-input-container select {
    width: 30%;
    min-width: 120px;
}

.phone-input-container input {
    width: 70%;
}

/* زر الإرسال */
#submit-customer-form {
    background: linear-gradient(135deg, #667eea 0%, #132e5d 100%);
    color: white;
    border: none;
    padding: 15px 30px;
    width: 100%;
    border-radius: 8px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 10px;
}

#submit-customer-form:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
    background: linear-gradient(135deg, #132e5d 0%, #667eea 100%);
}

#submit-customer-form:active {
    transform: translateY(0);
}

/* رسائل النظام */
#form-messages {
    margin-top: 15px;
    padding: 10px;
    border-radius: 5px;
    text-align: center;
    font-weight: bold;
    display: none;
}

#form-messages.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    display: block;
}

#form-messages.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    display: block;
}

/* Loading State */
.loading {
    opacity: 0.7;
    pointer-events: none;
}

.loading #submit-customer-form {
    background: #ccc;
    cursor: not-allowed;
}

.loading #submit-customer-form::after {
    content: "";
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #fff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 1s linear infinite;
    margin-left: 10px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Responsive Design */
@media (max-width: 600px) {
    .popup-content {
        margin: 10% auto;
        padding: 20px;
        width: 95%;
    }
    
    .phone-input-container {
        flex-direction: column;
    }
    
    .phone-input-container select,
    .phone-input-container input {
        width: 100%;
    }
    
    .popup-trigger-btn {
        padding: 12px 25px;
        font-size: 14px;
    }
}

/* تأثيرات إضافية */
.form-group input:valid {
    border-color: #28a745;
}

.form-group input:invalid:not(:focus):not(:placeholder-shown) {
    border-color: #dc3545;
}

/* تحسين النص العربي */
.popup-content {
    font-family: 'Segoe UI', Tahoma, Arial, sans-serif;
}

input, select, button {
    font-family: inherit;
}