﻿/**
 * codercrew Modal Styles - أنماط النوافذ المنبثقة الموحدة
 * Universal Modal Styles for all codercrew pages
 * Version: 2.0
 */

/* ===== منع التمرير عند فتح النافذة - Prevent Scrolling When Modal Open ===== */
body.wfx-modal-open {
    overflow: hidden !important;
    height: 100vh !important;
}

/* ===== النافذة المنبثقة الرئيسية - Main Modal Container ===== */
.wfx-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 999999;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    padding: 30px 20px;
}

.wfx-modal-overlay.wfx-active {
    display: flex !important;
    opacity: 1 !important;
}

/* إضافة CSS للتأكد من ظهور النافذة - Additional CSS to ensure modal visibility */
.wfx-modal-overlay.wfx-active {
    visibility: visible !important;
}

/* ===== محتوى النافذة - Modal Content ===== */
.wfx-modal-wrapper {
    background: linear-gradient(135deg, rgba(17, 24, 39, 0.98) 0%, rgba(31, 41, 55, 0.98) 100%);
    border-radius: 24px;
    border: 2px solid rgba(59, 130, 246, 0.3);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.6);
    max-width: 650px;
    width: 95%;
    max-height: 85vh;
    overflow: visible;
    transform: scale(0.9) translateY(30px);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
}

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

/* ===== رأس النافذة - Modal Header ===== */
.wfx-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 32px;
    border-bottom: 2px solid rgba(59, 130, 246, 0.2);
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1) 0%, rgba(147, 51, 234, 0.1) 100%);
    border-top-left-radius: 24px;
    border-top-right-radius: 24px;
}

.wfx-modal-title-wrapper {
    display: flex;
    align-items: center;
    gap: 20px;
}

.wfx-modal-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.2) 0%, rgba(147, 51, 234, 0.2) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: #3b82f6;
    border: 2px solid rgba(59, 130, 246, 0.3);
    transition: all 0.3s ease;
}

.wfx-modal-title {
    font-size: 28px;
    font-weight: 800;
    color: #ffffff;
    margin: 0 0 8px 0;
    line-height: 1.2;
}

.wfx-modal-subtitle {
    font-size: 16px;
    color: #9ca3af;
    margin: 0;
    line-height: 1.4;
}

.wfx-modal-close-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(239, 68, 68, 0.15);
    border: 2px solid rgba(239, 68, 68, 0.4);
    color: #ef4444;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 18px;
}

.wfx-modal-close-btn:hover {
    background: rgba(239, 68, 68, 0.25);
    transform: scale(1.1) rotate(90deg);
}

/* ===== جسم النافذة - Modal Body ===== */
.wfx-modal-body {
    padding: 32px;
    flex: 1;
    overflow-y: auto;
    max-height: calc(85vh - 180px);
}

.wfx-modal-body::-webkit-scrollbar {
    width: 8px;
}

.wfx-modal-body::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}

.wfx-modal-body::-webkit-scrollbar-thumb {
    background: rgba(59, 130, 246, 0.3);
    border-radius: 4px;
}

.wfx-modal-body::-webkit-scrollbar-thumb:hover {
    background: rgba(59, 130, 246, 0.5);
}

/* ===== تذييل النافذة - Modal Footer ===== */
.wfx-modal-footer {
    padding: 24px 32px 32px 32px;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.05) 0%, rgba(147, 51, 234, 0.05) 100%);
    border-top: 1px solid rgba(59, 130, 246, 0.1);
    margin-bottom: 0;
    flex-shrink: 0;
    border-bottom-left-radius: 24px;
    border-bottom-right-radius: 24px;
}

/* ===== عناصر النموذج - Form Elements ===== */
.wfx-form-group {
    margin-bottom: 24px;
}

.wfx-form-label {
    display: flex;
    align-items: center;
    font-size: 16px;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 12px;
    gap: 12px;
}

.wfx-form-input,
.wfx-form-select,
.wfx-form-textarea {
    width: 100%;
    padding: 16px 20px;
    background: rgba(31, 41, 55, 0.8);
    border: 2px solid rgba(75, 85, 99, 0.5);
    border-radius: 12px;
    color: #ffffff;
    font-size: 16px;
    transition: all 0.3s ease;
    outline: none;
}

.wfx-form-input:focus,
.wfx-form-select:focus,
.wfx-form-textarea:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    background: rgba(31, 41, 55, 0.9);
}

.wfx-form-input::placeholder,
.wfx-form-textarea::placeholder {
    color: #9ca3af;
}

.wfx-form-textarea {
    min-height: 120px;
    resize: vertical;
}

.wfx-form-select {
    cursor: pointer;
}

/* ===== تنسيق حقل التاريخ والوقت - DateTime Field Styling ===== */
.wfx-datetime-container {
    position: relative;
}

.wfx-datetime-input {
    background: rgba(31, 41, 55, 0.8) !important;
    color: #ffffff !important;
    border: 2px solid rgba(75, 85, 99, 0.5);
    border-radius: 16px;
    padding: 16px 20px;
    font-size: 16px;
    transition: all 0.3s ease;
    outline: none;
}

.wfx-datetime-input:focus {
    border-color: #3b82f6 !important;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1) !important;
    background: rgba(31, 41, 55, 0.9) !important;
}

.wfx-datetime-input::-webkit-calendar-picker-indicator {
    background-color: #3b82f6;
    border-radius: 4px;
    cursor: pointer;
    filter: invert(1);
    padding: 4px;
}

.wfx-datetime-helper {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
    font-size: 14px;
    color: #9ca3af;
    opacity: 0.8;
}

.wfx-datetime-helper i {
    font-size: 12px;
}

/* ===== أزرار النافذة - Modal Buttons ===== */
.wfx-modal-submit-btn {
    width: 100%;
    padding: 16px 24px;
    background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
    border: none;
    border-radius: 12px;
    color: #ffffff;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.wfx-modal-submit-btn:hover {
    background: linear-gradient(135deg, #2563eb 0%, #7c3aed 100%);
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(59, 130, 246, 0.3);
}

.wfx-modal-submit-btn:active {
    transform: translateY(0);
}

/* ===== نافذة النجاح - Success Modal ===== */
.wfx-success-modal {
    /* يستخدم نفس أنماط النافذة الرئيسية */
}

/* ===== الاستجابة للشاشات الصغيرة - Responsive Design ===== */
@media (max-width: 768px) {
    .wfx-modal-overlay {
        padding: 20px 15px;
    }

    .wfx-modal-header {
        padding: 24px 20px;
    }

    .wfx-modal-body {
        padding: 24px 20px;
    }

    .wfx-modal-footer {
        padding: 20px 20px 28px 20px;
    }

    .wfx-modal-wrapper {
        max-height: 90vh;
        margin: 10px;
    }

    .wfx-modal-body {
        max-height: calc(90vh - 160px);
    }

    .wfx-modal-title {
        font-size: 22px;
    }

    .wfx-modal-subtitle {
        font-size: 14px;
    }

    .wfx-modal-icon {
        width: 56px;
        height: 56px;
        font-size: 24px;
    }

    .wfx-form-input,
    .wfx-form-select,
    .wfx-form-textarea {
        padding: 14px 16px;
        font-size: 16px;
    }

    .wfx-modal-submit-btn {
        padding: 14px 20px;
        font-size: 16px;
    }
}
