/* استایل مودال کراپر */
.cropper-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    z-index: 10000;
    justify-content: center;
    align-items: center;
}
.cropper-container-box {
    background: white;
    border-radius: 10px;
    max-width: 90%;
    max-height: 90%;
    padding: 20px;
    position: relative;
}
.cropper-image-preview {
    max-width: 100%;
    max-height: 60vh;
}
.cropper-buttons {
    margin-top: 15px;
    text-align: center;
    direction: ltr;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
}

.cropper-buttons button {
    margin: 0;
    padding: 8px 16px;
    border-radius: 5px;
    border: none;
    cursor: pointer;
    font-size: 14px;
    white-space: nowrap;
}

@media (max-width: 500px) {
    .cropper-buttons button {
        padding: 6px 12px;
        font-size: 12px;
    }
}

@media (max-width: 400px) {
    .cropper-buttons button {
        padding: 5px 8px;
        font-size: 11px;
    }
}
.btn-crop-confirm { background: #28a745; color: white; }
.btn-crop-cancel { background: #dc3545; color: white; }
.btn-crop-rotate { background: #17a2b8; color: white; }

.cropper-container {
    max-width: 100% !important;
    max-height: 100% !important;
}

/* دکمه شناور تماس با پشتیبانی - نسخه ساده فیکس */
.support-fab {
    position: fixed;
    bottom: 40px;
    left: 30px;
    z-index: 9999;
}

.support-btn-call {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    border: none;
    border-radius: 50px;
    padding: 8px 20px;
    font-size: 16px;
    font-weight: 600;
    font-family: inherit;
    box-shadow: 0 8px 20px rgba(40, 167, 69, 0.3);
    transition: all 0.3s ease;
    cursor: pointer;
    text-decoration: none;
    letter-spacing: 0.5px;
    animation: softPulse 2s infinite ease-in-out;
}

.support-btn-call i {
    font-size: 20px;
    transition: transform 0.3s ease;
}

.support-btn-call .custom-icon {
    width: 38px;
    height: 38px;
    border-radius: 30%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.support-btn-call .phone-number {
    direction: ltr;
    display: inline-block;
    font-family: 'Segoe UI', 'Roboto', monospace;
    font-weight: 600;
}

.support-btn-call:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 28px rgba(40, 167, 69, 0.4);
    background: linear-gradient(135deg, #218838 0%, #1aa179 100%);
}

.support-btn-call:hover .custom-icon {
    transform: scale(1.1);
}

.support-btn-call:active {
    transform: translateY(0);
}

@keyframes softPulse {
    0% { box-shadow: 0 8px 20px rgba(255, 215, 0, 0.4); }
    50% { box-shadow: 0 8px 30px rgba(255, 215, 0, 0.7), 0 0 0 5px rgba(255, 215, 0, 0.3); }
    100% { box-shadow: 0 8px 20px rgba(255, 215, 0, 0.4); }
}

/* موبایل */
@media (max-width: 768px) {
    .support-fab {
        bottom: 40px;
        left: 20px;
    }
    
    .support-btn-call {
        padding: 6px 16px;
        font-size: 14px;
    }
    
    .support-btn-call .custom-icon {
        width: 38px;
        height: 38px;
    }
}

@media (max-width: 480px) {
    .support-fab {
        bottom: 40px;
        left: 15px;
    }
    
    .support-btn-call .phone-number {
        display: none;
    }
    
    .support-btn-call {
        border-radius: 15%;
        padding: 5px;
    }
    
    .support-btn-call .custom-icon {
        width: 38px;
        height: 38px;
        margin: 0;
    }
}

body { 
    background-color: #f5f7fa; 
    background-image: linear-gradient(to bottom, #f5f7fa 0%, #c3cfe2 100%); 
    min-height: 100vh; 
    padding: 20px 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}
.registration-container { 
    max-width: 900px; 
    width: 100%; 
    padding: 30px; 
    background: rgba(255, 255, 255, 0.95); 
    border-radius: 15px; 
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1); 
    border: 1px solid rgba(255, 255, 255, 0.3); 
    margin: 0 auto;
}
.form-control { 
    border-radius: 8px; 
    border: 1px solid #ddd; 
    height: 45px;
    padding: 10px 15px;
}
.form-control:focus { 
    border-color: #4a80f0; 
    box-shadow: 0 0 0 0.2rem rgba(74, 128, 240, 0.25); 
}
.input-icon { 
    position: absolute; 
    left: 15px; 
    top: 50%; 
    transform: translateY(-50%); 
    z-index: 4; 
    font-size: 1.2rem; 
}
.input-with-icon { 
    position: relative; 
}
.btn-submit { 
    background: linear-gradient(to right, #4a80f0, #6a5acd); 
    border: none; 
    height: 50px; 
    font-weight: 600; 
    letter-spacing: 1px; 
    border-radius: 8px; 
    transition: all 0.3s; 
    margin-top: 20px;
}
.btn-submit:hover { 
    transform: translateY(-2px); 
    box-shadow: 0 5px 15px rgba(74, 128, 240, 0.4); 
}
.registration-title { 
    color: #333; 
    margin-bottom: 25px; 
    position: relative; 
    text-align: center; 
    font-weight: 700;
}
.title-divider { 
    display: block; 
    width: 80px; 
    height: 3px; 
    background: linear-gradient(to right, #4a80f0, #6a5acd); 
    margin: 10px auto 25px; 
    border-radius: 3px; 
}
.section-title {
    color: #4a80f0;
    margin: 25px 0 15px;
    padding-bottom: 8px;
    border-bottom: 2px solid #eee;
    font-weight: 600;
}
.error-message {
    color: #dc3545;
    font-size: 0.9rem;
    margin-top: 5px;
}
.form-label {
    font-weight: 500;
    margin-bottom: 8px;
}
.required-field::after {
    content: " *";
    color: #dc3545;
}

/* ============================================
   استایل جدید برای چک‌باکس‌ها با اسکرول و ستون‌بندی
   ============================================ */
.checkbox-container {
    background: rgb(236, 245, 152);
    border-radius: 8px;
    padding: 15px;
    margin-top: 10px;
    max-height: 250px;
    overflow-y: auto;
}

.checkbox-container::-webkit-scrollbar {
    width: 6px;
}
.checkbox-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}
.checkbox-container::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 3px;
}
.checkbox-container::-webkit-scrollbar-thumb:hover {
    background: #555;
}

.checkbox-item {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
    padding: 2px 0;
}

.checkbox-item input[type="checkbox"] {
    margin-left: 8px;
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.checkbox-item label {
    margin-bottom: 0;
    font-size: 14px;
    cursor: pointer;
}

/* ============================================
   استایل برای رادیوها
   ============================================ */
.radio-container {
    background: #e8f4ff;
    border-radius: 8px;
    padding: 15px;
    margin-top: 10px;
}

.radio-container .form-check {
    margin-bottom: 8px;
}

.radio-container .form-check:last-child {
    margin-bottom: 0;
}

.radio-container .form-check-input {
    margin-left: 8px;
}

/* ============================================
   استایل گروه شناسنامه (موجود)
   ============================================ */
.birth-certificate-box {
    display: flex;
    align-items: center;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 5px 10px;
    background: white;
}
.birth-certificate-divider {
    height: 38px;
    width: 1px;
    background-color: #ddd;
    margin: 0 10px;
}
.birth-certificate-part {
    display: flex;
    flex-direction: column;
    align-items: center;
}
.birth-certificate-label {
    font-size: 0.8rem;
    color: #6c757d;
    margin-bottom: 3px;
}
.birth-certificate-input {
    border: none;
    text-align: center;
    width: 100%;
    background: transparent;
}
.birth-certificate-select {
    border: none;
    background: transparent;
    width: 70px;
}

/* ============================================
   استایل عکس (مثل سیستم قدیمی)
   ============================================ */
.photo-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.btn-primary {
    min-width: 150px;
    width: auto;
    padding: 8px 20px;
    border-radius: 8px;
    cursor: pointer;
}

.photo-preview {
    width: 150px;
    height: 180px;
    border: 2px dashed #ddd;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 10px auto;
    cursor: pointer;
    background-color: #f8f9fa;
    overflow: hidden;
    transition: all 0.3s ease;
}

.photo-preview:hover {
    border-color: #4a80f0;
    transform: scale(1.02);
}

.photo-preview.invalid {
    border: 2px solid #dc3545;
    box-shadow: 0 0 0 0.25rem rgba(220,53,69,.25);
}

.photo-preview img {
    max-width: 100%;
    max-height: 100%;
    display: none;
}

.photo-preview img[src]:not([src="#"]) {
    display: block;
}

#photoError {
    text-align: center;
    font-weight: bold;
    color: #dc3545;
    display: none;
}

/* ============================================
   استایل Teacher Header
   ============================================ */
.teacher-header-container {
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    margin-bottom: 25px;
}
.teacher-header-card {
    background: linear-gradient(135deg, #4a80f0 0%, #6a5acd 100%);
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    padding: 20px;
    border: 1px solid #dee2e6;
    color: white;
}
.teacher-header-content {
    display: flex;
    align-items: center;
    gap: 25px;
}
.teacher-header-image {
    flex: 0 0 100px;
}
.teacher-pic {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #fff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}
.teacher-header-info {
    flex: 1;
}
.teacher-greeting {
    color: white;
    margin-bottom: 15px;
    font-weight: 600;
    font-size: 1.9rem;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.3);
}
.detail-label, .detail-value {
    color: white;
}
.detail-value {
    background-color: rgba(255,255,255,0.2);
    padding: 2px 8px;
    border-radius: 4px;
}

/* ============================================
   استایل‌های اخبار و خطاها
   ============================================ */
.alert-danger {
    background-color: #f8d7da;
    border-color: #f5c6cb;
    color: #721c24;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
    border: 1px solid transparent;
}

.alert-danger ul {
    margin-bottom: 0;
    padding-right: 20px;
}

.alert-danger li {
    list-style-type: none;
    position: relative;
    padding-right: 15px;
}

.alert-danger li:before {
    content: "•";
    position: absolute;
    right: 0;
}

.is-invalid {
    border-color: #dc3545 !important;
}

.invalid-feedback {
    display: none;
    color: #dc3545;
    font-size: 0.875em;
    margin-top: 0.25rem;
    text-align: center;
}

/* برای اطمینان از نمایش خطا */
.is-invalid ~ .invalid-feedback {
    display: block !important;
}

/* خطا برای چک‌باکس‌ها */
.checkbox-container.is-invalid {
    border: 2px solid #dc3545;
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25);
}

/* ============================================
   استایل باکس سبز (راهنما)
   ============================================ */
.green-notification {
    background: linear-gradient(to right, #e8f5e9, #f1f8e9);
    border: 1px solid #c8e6c9;
    border-radius: 10px;
    padding: 15px 20px;
    margin: 20px 0;
    border-left: 6px solid #43a047;
    box-shadow: 0 3px 10px rgba(0,0,0,0.08);
    position: relative;
    overflow: hidden;
}

.green-notification:before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: #2e7d32;
}

.green-notification p {
    margin: 0;
    color: #1b5e20;
    font-weight: 500;
    line-height: 1.6;
}

.notification-title {
    color: #2e7d32;
    font-weight: 700;
    margin-bottom: 15px;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
}

.notification-content {
    color: #1b5e20;
    line-height: 1.8;
}

.requirements-list {
    list-style-type: none;
    padding-right: 0;
    margin: 15px 0;
}

.requirements-list li {
    padding: 8px 0;
    border-bottom: 1px dashed #a5d6a7;
    display: flex;
    align-items: center;
}

.requirements-list li:last-child {
    border-bottom: none;
}

.note-box {
    background-color: rgba(255, 243, 205, 0.5);
    border-right: 4px solid #ffc107;
    padding: 10px 15px;
    border-radius: 6px;
    margin-top: 15px;
    display: flex;
    align-items: center;
    font-size: 0.9rem;
}

@media (max-width: 768px) {
    .green-notification {
        padding: 15px;
    }
    
    .notification-title {
        font-size: 1.1rem;
    }
}

/* ============================================
   استایل دکمه ویرایش
   ============================================ */
.btn-edit {
    display: inline-block;
    padding: 10px 20px;
    background: linear-gradient(135deg, #4CAF50 0%, #FF9800 100%);
    color: white !important;
    text-decoration: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: bold;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.btn-edit:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
    background: linear-gradient(135deg, #45a049 0%, #e68a00 100%);
}

.btn-edit i {
    margin-left: 8px;
    color: #fff;
    font-size: 18px;
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

/* ============================================
   استایل اطلاعات مدرسه
   ============================================ */
.school-info {
    background-color: #e7f3ff;
    border: 1px solid #b8daff;
    border-radius: 8px;
    padding: 15px;
    margin-top: 10px;
    color: #004085;
}
.school-info-container {
    display: flex;
    align-items: center;
    background-color: #e7f3ff;
    border: 1px solid #b8daff;
    border-radius: 8px;
    padding: 15px;
    margin-top: 10px;
    color: #004085;
    gap: 15px;
}

.school-logo {
    flex-shrink: 0;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.school-logo-img {
    max-width: 100%;
    max-height: 100%;
    border-radius: 8px;
    object-fit: cover;
}

.school-logo-placeholder {
    width: 100%;
    height: 100%;
    background-color: #d1ecff;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #0056b3;
    font-size: 24px;
}

.school-details {
    flex-grow: 1;
    font-size: 16px;
}

@media (max-width: 768px) {
    .school-info-container {
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }
    
    .school-logo {
        width: 50px;
        height: 50px;
    }
}

/* ============================================
   استایل لودینگ
   ============================================ */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

#submitBtn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* ============================================
   استایل‌های Wizard و Progress Bar
   ============================================ */
.wizard-progress .step-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: default;
}
.wizard-progress .step-circle {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #e9ecef;
    color: #6c757d;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s ease;
}
.wizard-progress .step-indicator.active .step-circle {
    background: #4a80f0;
    color: white;
    box-shadow: 0 0 0 3px rgba(74, 128, 240, 0.3);
}
.wizard-progress .step-indicator.completed .step-circle {
    background: #28a745;
    color: white;
}
.wizard-progress .step-label {
    font-size: 13px;
    color: #6c757d;
}
.wizard-progress .step-indicator.active .step-label {
    color: #4a80f0;
    font-weight: 600;
}

.btn-next, .btn-prev, .btn-submit {
    min-width: 120px;
}

/* ============================================
   استایل نمایش مراحل در موبایل (عرض 765 تا 990)
   ============================================ */
@media (min-width: 765px) and (max-width: 990px) {
    .step-indicator .step-label {
        display: none !important;
    }
    
    /* نمایش tooltip با هاور */
    .step-indicator {
        position: relative;
    }
    
    .step-indicator:hover::after {
        content: attr(title);
        position: absolute;
        top: 100%;
        left: 50%;
        transform: translateX(-50%);
        background: #333;
        color: #fff;
        padding: 4px 10px;
        border-radius: 4px;
        font-size: 12px;
        white-space: nowrap;
        z-index: 100;
        margin-top: 5px;
    }
    
    .step-indicator:hover::before {
        content: '';
        position: absolute;
        top: 100%;
        left: 50%;
        transform: translateX(-50%);
        border: 6px solid transparent;
        border-bottom-color: #333;
        margin-top: -1px;
        z-index: 100;
    }
}

/* ============================================
   استایل فاصله آیکون با متن - فقط از سمت چپ (آیکون)
   ============================================ */
.input-with-icon .form-control {
    padding-right: 25px !important;
    padding-left: 45px !important;
}

/* برای فیلدهایی که آیکون ندارند، padding معمولی */
.input-with-icon .form-control:not(.ps-5) {
    padding-right: 25px !important;
    padding-left: 25px !important;
}

/* فیلدهایی که کلاس ps-5 دارند (آیکون دار) */
.input-with-icon .form-control.ps-5 {
    padding-right: 25px !important;
    padding-left: 50px !important;
}

/* ============================================
   استایل ریسپانسیو عمومی
   ============================================ */
@media (max-width: 768px) {
    .registration-container {
        padding: 20px 15px;
    }
    .form-row {
        flex-direction: column;
    }
    .form-row .col-md-6 {
        width: 100%;
        margin-bottom: 15px;
    }
    .teacher-header-content {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }
    .birth-certificate-box {
        flex-direction: column;
        align-items: stretch;
    }
    .birth-certificate-divider {
        height: 1px;
        width: 100%;
        margin: 5px 0;
    }
    .wizard-progress .step-label {
        display: none !important;
    }
    .btn-next, .btn-prev, .btn-submit {
        min-width: 80px;
        font-size: 14px;
    }
}

/* ============================================
   استایل‌های جدید برای خطاهای قابل کلیک و پیام بازیابی
   ============================================ */

/* استایل باکس خطا - قابل کلیک */
.form-errors-alert {
    cursor: pointer;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(220, 53, 69, 0.15);
    transition: all 0.3s ease;
    border-right: 4px solid #dc3545;
}

.form-errors-alert:hover {
    box-shadow: 0 6px 25px rgba(220, 53, 69, 0.25);
    transform: translateY(-2px);
}

/* استایل لینک‌های خطا */
.error-link {
    transition: all 0.2s ease;
    border-radius: 5px;
    padding: 5px 10px;
    text-decoration: none !important;
    color: #dc3545 !important;
    display: block;
}

.error-link:hover {
    background-color: rgba(220, 53, 69, 0.08);
    padding-right: 15px;
    color: #a71d2a !important;
}

.error-link i {
    transition: all 0.3s ease;
}

.error-link:hover i {
    transform: translateX(-5px);
}

/* استایل فیلدهای خطا */
.is-invalid {
    border-color: #dc3545 !important;
    background-color: #fff8f8 !important;
}

.is-invalid:focus {
    border-color: #dc3545 !important;
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25) !important;
}

/* هایلایت فیلد خطا با انیمیشن */
.field-highlight {
    animation: fieldPulse 1.5s ease 3;
}

@keyframes fieldPulse {
    0% { box-shadow: 0 0 0 0 rgba(220, 53, 69, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(220, 53, 69, 0); }
    100% { box-shadow: 0 0 0 0 rgba(220, 53, 69, 0); }
}

/* ============================================
   استایل پیام بازیابی اطلاعات
   ============================================ */
.restore-alert {
    animation: slideDown 0.5s ease;
    position: relative;
    border-right: 4px solid #0dcaf0;
    box-shadow: 0 4px 15px rgba(13, 202, 240, 0.2);
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================
   استایل پیام بازیابی به صورت تاپ‌نوتیفیکیشن (برای JS)
   ============================================ */
.restore-toast {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    min-width: 300px;
    max-width: 600px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    border-right: 4px solid #28a745;
    animation: slideDown 0.5s ease;
    background: #d4edda;
    color: #155724;
    padding: 15px 20px;
    border-radius: 8px;
    border: 1px solid #c3e6cb;
}

.restore-toast .btn-close {
    position: absolute;
    top: 10px;
    left: 10px;
}

/* ============================================
   استایل‌های ریسپانسیو برای خطاها
   ============================================ */
@media (max-width: 768px) {
    .form-errors-alert {
        font-size: 14px;
        padding: 12px 15px;
    }
    
    .error-link {
        font-size: 13px;
        padding: 4px 8px;
    }
    
    .restore-alert {
        font-size: 14px;
        padding: 12px 15px;
    }
    
    .restore-toast {
        min-width: 90%;
        font-size: 14px;
        padding: 12px 15px;
        top: 10px;
    }
}

@media (max-width: 480px) {
    .form-errors-alert {
        font-size: 12px;
        padding: 10px 12px;
    }
    
    .error-link {
        font-size: 12px;
        padding: 3px 6px;
    }
    
    .restore-alert {
        font-size: 12px;
        padding: 10px 12px;
    }
    
    .restore-toast {
        min-width: 95%;
        font-size: 12px;
        padding: 10px 12px;
        top: 5px;
    }
}