/* فونت فارسی */
@import url('https://fonts.googleapis.com/css2?family=Vazirmatn:wght@300;400;500;700&display=swap');

/* =================== GLOBAL RESET =================== */
.moukeb-form-container,
.moukeb-form-container * {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* =================== CONTAINER STYLES =================== */
.moukeb-form-container {
    width: 100%;
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    font-family: 'Vazirmatn', sans-serif;
    direction: rtl;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* لوگو */
.moukeb-logo-container {
    width: 100%;
    text-align: center;
    margin-bottom: 20px;
}

.moukeb-logo {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    object-fit: cover;
}

/* عنوان فرم */
.moukeb-form-title {
    text-align: center;
    color: #fff;
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
}

/* کانتینر فرم */
#form-container {
    width: 100%;
    max-width: 100%;
}

/* فرم اصلی */
.moukeb-form {
    width: 100%;
    background: white;
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

/* ردیف‌های فرم */
.moukeb-form-row {
    width: 100%;
    margin-bottom: 15px;
}

/* گروه فیلدها */
.moukeb-form-group {
    width: 100%;
    position: relative;
    margin-bottom: 15px;
}

.moukeb-form-group.full-width {
    width: 100%;
}

/* لیبل‌ها */
.moukeb-form-group label {
    display: block;
    color: #2c3e50;
    font-weight: 500;
    font-size: 14px;
    margin-bottom: 8px;
}

.required {
    color: #e74c3c;
    margin-right: 3px;
}

/* اینپوت‌ها */
.moukeb-form-group input,
.moukeb-form-group select,
.moukeb-form-group textarea {
    width: 100%;
    padding: 12px 40px 12px 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    font-family: 'Vazirmatn', sans-serif;
    background: white;
    transition: all 0.3s ease;
}

.moukeb-form-group input:focus,
.moukeb-form-group select:focus,
.moukeb-form-group textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* آیکون فیلدها */
.moukeb-field-icon {
    position: absolute;
    right: 12px;
    top: 38px;
    font-size: 18px;
    pointer-events: none;
}

/* دکمه‌ها */
.moukeb-btn-primary,
.moukeb-btn-secondary {
    width: 100%;
    padding: 14px 20px;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    font-family: 'Vazirmatn', sans-serif;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 10px;
}

.moukeb-btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.moukeb-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.moukeb-btn-secondary {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
}

.moukeb-btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(240, 147, 251, 0.4);
}

/* محل دکمه‌ها */
.moukeb-form-actions {
    width: 100%;
    margin-top: 20px;
}

/* مودال پیش‌نمایش */
.moukeb-modal {
    position: fixed;
    z-index: 999999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.moukeb-modal-content {
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    background: white;
    padding: 25px;
    border-radius: 15px;
    overflow-y: auto;
    position: relative;
}

.moukeb-modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 30px;
    height: 30px;
    background: #f0f0f0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: #666;
    cursor: pointer;
    transition: all 0.3s ease;
}

.moukeb-modal-close:hover {
    background: #e0e0e0;
    color: #333;
}

.moukeb-modal h3 {
    text-align: center;
    color: #2c3e50;
    font-size: 20px;
    margin-bottom: 20px;
}

/* محتوای پیش‌نمایش */
#preview-content {
    width: 100%;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 10px;
    margin-bottom: 20px;
}

.preview-item {
    width: 100%;
    padding: 10px 0;
    border-bottom: 1px solid #e0e0e0;
}

.preview-item:last-child {
    border-bottom: none;
}

.preview-label {
    display: inline-block;
    font-weight: 600;
    color: #667eea;
    font-size: 13px;
    margin-bottom: 5px;
}

.preview-value {
    display: block;
    color: #2c3e50;
    font-size: 14px;
    padding-right: 10px;
}

.moukeb-modal-actions {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* پیام‌های وضعیت */
.moukeb-status-message {
    width: 100%;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    margin-bottom: 20px;
}

.moukeb-status-message h3 {
    font-size: 18px;
    margin-bottom: 10px;
}

.moukeb-status-message p {
    font-size: 14px;
    line-height: 1.6;
}

.moukeb-status-message.pending {
    background: #fff3cd;
    color: #856404;
    border: 2px solid #ffc107;
}

.moukeb-status-message.approved {
    background: #d4edda;
    color: #155724;
    border: 2px solid #28a745;
}

.moukeb-status-message.rejected {
    background: #f8d7da;
    color: #721c24;
    border: 2px solid #dc3545;
}

/* صفحه لاگین */
.moukeb-login-required {
    width: 100%;
    max-width: 400px;
    padding: 30px;
    background: white;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.moukeb-login-required h2 {
    font-size: 20px;
    color: #e74c3c;
    margin: 20px 0;
}

.moukeb-login-required p {
    font-size: 14px;
    color: #555;
    margin-bottom: 20px;
    line-height: 1.6;
}

.login-buttons {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.login-buttons a {
    width: 100%;
    padding: 12px;
    text-decoration: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    transition: all 0.3s ease;
}

/* Loading animation */
.moukeb-loading {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 3px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* =================== TABLET STYLES =================== */
@media screen and (min-width: 768px) {
    .moukeb-form-container {
        padding: 40px;
    }
    
    .moukeb-form {
        max-width: 700px;
        margin: 0 auto;
        padding: 30px;
    }
    
    .moukeb-logo {
        width: 100px;
        height: 100px;
    }
    
    .moukeb-form-title {
        font-size: 24px;
        margin-bottom: 30px;
    }
    
    .moukeb-form-row {
        display: flex;
        gap: 20px;
    }
    
    .moukeb-form-group {
        flex: 1;
    }
    
    .moukeb-modal-actions {
        flex-direction: row;
        justify-content: center;
    }
    
    .moukeb-modal-actions button {
        width: auto;
        padding: 12px 30px;
    }
    
    .login-buttons {
        flex-direction: row;
        justify-content: center;
    }
    
    .login-buttons a {
        width: auto;
        padding: 12px 30px;
    }
}

/* =================== DESKTOP STYLES =================== */
@media screen and (min-width: 1024px) {
    .moukeb-form-container {
        padding: 60px;
    }
    
    .moukeb-form {
        max-width: 800px;
        padding: 40px;
    }
    
    .moukeb-logo {
        width: 120px;
        height: 120px;
    }
    
    .moukeb-form-title {
        font-size: 28px;
    }
    
    .moukeb-modal-content {
        max-width: 600px;
        padding: 35px;
    }
    
    .preview-item {
        display: flex;
        justify-content: space-between;
        align-items: center;
    }
    
    .preview-label {
        display: inline;
        margin-bottom: 0;
    }
    
    .preview-value {
        display: inline;
        padding-right: 0;
    }
}

/* =================== MOBILE FULL WIDTH FIX =================== */
@media screen and (max-width: 767px) {
    /* حذف margin و padding والدین */
    body {
        margin: 0 !important;
        padding: 0 !important;
    }
    
    .moukeb-form-container {
        width: 100vw;
        margin-left: calc(-50vw + 50%);
        margin-right: calc(-50vw + 50%);
        padding: 15px;
        border-radius: 0;
    }
    
    .moukeb-form {
        border-radius: 10px;
    }
    
    /* مودال در موبایل */
    .moukeb-modal {
        padding: 0;
    }
    
    .moukeb-modal-content {
        width: 100%;
        height: 100vh;
        max-height: 100vh;
        border-radius: 0;
        padding: 20px;
        padding-top: 60px;
    }
    
    .moukeb-modal-close {
        position: fixed;
        top: 15px;
        right: 15px;
        z-index: 1000;
    }
}