/* --- Global Styles --- */
body {
    font-family: 'Vazirmatn', sans-serif; /* Already set in header, but good for backup */
    background-color: #f8f9fa; /* A light grey background */
}

/* --- Main Content Wrapper --- */
.main-content-wrapper {
    background-color: #ffffff; /* White background for the content area */
    border-radius: 0.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    border: 1px solid #dee2e6;
    overflow: hidden; /* Ensures the header corners are rounded */
}

/* --- Content Header (The Blue Bar) --- */
.content-header {
    background-color: #0d6efd; /* Bootstrap primary blue */
    color: white;
    padding: 1rem 1.5rem;
    font-size: 1.25rem;
    font-weight: 600;
}
/* --- Modern Form Styling --- */

.form-wrapper {
    max-width: 900px; /* Controls the width of the form */
    margin: 0 auto; /* Centers the form on the page */
}

.form-section-title {
    font-weight: 600;
    color: #495057;
    margin-top: 2.5rem;
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #dee2e6;
    display: flex;
    align-items: center;
}

.form-section-title i {
    color: #0d6efd;
    margin-left: 0.75rem; /* For RTL */
    font-size: 1.5rem;
}

.form-label-rtl {
    font-size: 1rem;
    font-weight: 500;
    color: #212529;
}

.form-label-rtl .text-muted {
    font-size: 0.85rem;
    display: block;
    font-weight: 400;
}

.form-control::placeholder {
    color: #adb5bd;
    opacity: 1;
}

/* Ensure inputs are RTL */
.form-control, .form-select {
    text-align: right;
}

/* Radio button styling for better alignment */
.form-check-group .form-check {
    margin-left: 1.5rem; /* Spacing for RTL */
}
.content-header .btn {
    font-size: 0.9rem;
}

/* --- Content Body (Area below the blue bar) --- */
.content-body {
    padding: 1.5rem;
}

/* --- Table Styling --- */
.table {
    border-top: 1px solid #dee2e6; /* Add a top border to the table */
}

.table thead th {
    font-weight: 600;
    color: #495057;
    background-color: #f8f9fa; /* Light grey header for the table */
    border-bottom-width: 2px;
}

.table tbody td {
    vertical-align: middle;
}

/* --- Flash Message Styling --- */
.flash-message {
    position: fixed;
    top: 20px;
    left: 20px; /* Changed from right to left for RTL */
    z-index: 1060;
    max-width: 400px;
}

/* --- Action Icons in Tables --- */
.action-icons a, .action-icons button {
    margin: 0 0.25rem;
    color: #6c757d;
    transition: color 0.2s;
}
.action-icons a:hover, .action-icons button:hover {
    color: #0d6efd;
}
.action-icons form {
    display: inline;
}

/* Modern Form Styles */
.registration-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    font-family: 'Vazirmatn', sans-serif;
    direction: rtl;
}

.progress-header {
    margin-bottom: 30px;
}

.progress-steps {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    position: relative;
}

.progress-steps::before {
    content: '';
    position: absolute;
    top: 20px;
    left: 0;
    right: 0;
    height: 2px;
    background-color: #e9ecef;
    z-index: 1;
}

.step {
    position: relative;
    z-index: 2;
    text-align: center;
    flex: 1;
}

.step-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #e9ecef;
    color: #6c757d;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 8px;
    font-weight: bold;
    transition: all 0.3s ease;
}

.step.active .step-icon {
    background-color: #0d6efd;
    color: white;
}

.progress-bar {
    height: 4px;
    background-color: #e9ecef;
    border-radius: 2px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background-color: #0d6efd;
    width: 25%;
    transition: width 0.3s ease;
}

.modern-form {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

.form-section {
    padding: 30px;
    display: none;
}

.form-section.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.section-header {
    display: flex;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e9ecef;
}

.section-header i {
    font-size: 24px;
    margin-left: 15px;
    color: #0d6efd;
}

.section-header h2 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
}

.section-header p {
    margin: 5px 0 0 0;
    color: #6c757d;
    font-size: 14px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #495057;
}

.input-wrapper {
    position: relative;
}

.form-control {
    width: 100%;
    padding: 12px 15px 12px 45px;
    border: 1px solid #ced4da;
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.2s ease;
    background-color: #fff;
}

.form-control:focus {
    border-color: #0d6efd;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
    outline: none;
}

.form-control.is-invalid {
    border-color: #dc3545;
}

.input-icon {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #6c757d;
    font-size: 18px;
}

.radio-group {
    display: flex;
    gap: 15px;
    margin-top: 8px;
}

.radio-option {
    display: flex;
    align-items: center;
    cursor: pointer;
    position: relative;
}

.radio-option input[type="radio"] {
    position: absolute;
    opacity: 0;
}

.radio-check {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid #ced4da;
    margin-left: 8px;
    position: relative;
    transition: all 0.2s ease;
}

.radio-option input[type="radio"]:checked + .radio-check {
    border-color: #0d6efd;
}

.radio-option input[type="radio"]:checked + .radio-check::after {
    content: '';
    position: absolute;
    top: 4px;
    right: 4px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: #0d6efd;
}

.radio-label {
    font-weight: 500;
    color: #495057;
}

.btn-next, .btn-prev, .btn-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-next {
    background-color: #0d6efd;
    color: white;
}

.btn-next:hover {
    background-color: #0b5ed7;
}

.btn-prev {
    background-color: #6c757d;
    color: white;
    margin-right: 10px;
}

.btn-prev:hover {
    background-color: #5a6268;
}

.btn-submit {
    background-color: #198754;
    color: white;
    padding: 12px 25px;
}

.btn-submit:hover {
    background-color: #157347;
}

.btn-group {
    display: flex;
    justify-content: space-between;
    margin-top: 30px;
}

.form-actions {
    display: flex;
    justify-content: space-between;
    margin-top: 30px;
}

.has-error .form-control {
    border-color: #dc3545;
}

.error-message {
    color: #dc3545;
    font-size: 14px;
    margin-top: 5px;
}

.review-section {
    margin-bottom: 25px;
}

.review-section h3 {
    font-size: 18px;
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e9ecef;
    color: #495057;
}

.review-item {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid #f8f9fa;
}

.review-item:last-child {
    border-bottom: none;
}

.review-item span:first-child {
    color: #6c757d;
    font-weight: 500;
}

.review-item span:last-child {
    font-weight: 500;
    color: #212529;
}

.loading-spinner {
    display: none;
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #0d6efd;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.loading-spinner.active {
    display: block;
}

@keyframes spin {
    0% { transform: translateY(-50%) rotate(0deg); }
    100% { transform: translateY(-50%) rotate(360deg); }
}

/* Responsive Design */
@media (max-width: 768px) {
    .registration-container {
        padding: 15px;
    }
    
    .form-section {
        padding: 20px;
    }
    
    .section-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .section-header i {
        margin-bottom: 10px;
    }
    
    .btn-group, .form-actions {
        flex-direction: column;
        gap: 10px;
    }
    
    .btn-prev {
        margin-right: 0;
    }
    
    .radio-group {
        flex-direction: column;
        gap: 10px;
    }
}

/* Mobile App Feel */
@media (max-width: 480px) {
    .progress-steps {
        justify-content: center;
        gap: 10px;
    }
    
    .step span {
        display: none;
    }
    
    .step-icon {
        margin: 0;
    }
}