/* الأساسيات */
:root {
    --primary-color: #4facfe;
    --secondary-color: #00f2fe;
    --gradient-primary: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    --font-main: 'Cairo', 'Tajawal', sans-serif;
    --box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-main);
    background-color: #f8f9fa;
    min-height: 100vh;
    overflow-x: hidden;
}

/* التنسيق العام للنماذج */
.main-container {
    max-width: 1000px;
    margin: 20px auto;
    background: white;
    border-radius: 20px;
    box-shadow: var(--box-shadow);
    overflow: hidden;
}

.header-section {
    background: var(--gradient-primary);
    color: white;
    padding: 30px;
    text-align: center;
}

    .header-section h1 {
        margin: 0;
        font-weight: 700;
        font-size: 2.5rem;
    }

.form-container {
    padding: 40px;
}

/* تنسيقات النموذج الأفقي (الذي لديك بالفعل) */
.form-group-horizontal {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

    .form-group-horizontal .form-group {
        flex: 1 1 calc(25% - 15px);
        min-width: 200px;
    }

/* تنسيقات شريط التنقل المحسنة */
.navbar {
    background: var(--gradient-primary) !important;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    padding: 0.5rem 1rem;
}

.navbar-brand {
    font-size: 1.5rem;
    font-weight: 700;
    color: white !important;
}


.navbar-nav .nav-link {
    color: white !important;
    font-size: 1.1rem;
    font-weight: 600;
    padding: 0.5rem 1rem;
    transition: all 0.3s ease;
    border-radius: 5px;
}

    .navbar-nav .nav-link:hover {
        background-color: rgba(255, 255, 255, 0.2);
        transform: translateY(-2px);
    }

/* تنسيقات القوائم المنسدلة */
.dropdown-menu {
    background-color: white;
    border: none;
    box-shadow: var(--box-shadow);
    border-radius: 10px;
    padding: 0.5rem 0;
}

.dropdown-item {
    color: #333 !important;
    font-weight: 500;
    padding: 0.5rem 1.5rem;
    transition: all 0.3s ease;
}

    .dropdown-item:hover {
        background: var(--gradient-primary) !important;
        color: white !important;
    }

/* تنسيقات الأزرار */
.btn {
    border-radius: 10px;
    padding: 10px 25px;
    font-weight: 600;
    transition: all 0.3s ease;
    border: none;
}

.btn-primary {
    background: var(--gradient-primary);
    box-shadow: 0 5px 15px rgba(79, 172, 254, 0.3);
}

    .btn-primary:hover {
        transform: translateY(-2px);
        box-shadow: 0 8px 25px rgba(79, 172, 254, 0.4);
    }

/* التنسيق للجوال */
@media (max-width: 768px) {
    .main-container {
        margin: 10px;
        border-radius: 15px;
    }

    .form-container {
        padding: 20px;
    }

    .header-section {
        padding: 20px;
    }

    .form-group-horizontal {
        flex-direction: column;
    }

        .form-group-horizontal .form-group {
            flex: 1 1 100%;
        }

    .navbar-nav {
        padding: 10px 0;
    }

        .navbar-nav .nav-link {
            padding: 0.5rem;
        }
}
/* تنسيقات الجدول المحسنة */
.af-table-responsive {
    overflow-x: auto;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.af-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

    .af-table th {
        background-color: #4facfe;
        color: white;
        padding: 12px 15px;
        text-align: right;
        font-weight: 600;
    }

    .af-table td {
        padding: 10px 15px;
        border-bottom: 1px solid #e9ecef;
        vertical-align: middle;
    }

    .af-table tr:hover {
        background-color: #f8f9fa;
    }

    .af-table tr:last-child td {
        border-bottom: none;
    }

/* تنسيق الصورة */
.af-profile-img {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #e9ecef;
}

.af-no-image {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: #f1f1f1;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6c757d;
    font-size: 24px;
}

/* تنسيق أزرار الإجراءات */
.af-actions {
    display: flex;
    gap: 8px;
    justify-content: center;
}

.af-btn {
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.af-btn-info {
    background-color: #17a2b8;
    color: white;
}

.af-btn-warning {
    background-color: #ffc107;
    color: #212529;
}

.af-btn-danger {
    background-color: #dc3545;
    color: white;
}

/* تنسيق شارة الحالة */
.af-status-badge {
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

    .af-status-badge.active {
        background-color: #d4edda;
        color: #155724;
    }

    .af-status-badge.inactive {
        background-color: #f8d7da;
        color: #721c24;
    }

/* صندوق البحث */
.af-search-box {
    display: flex;
    width: 300px;
}

    .af-search-box input {
        border-radius: 8px 0 0 8px !important;
    }

    .af-search-box button {
        border-radius: 0 8px 8px 0 !important;
        padding: 0 15px;
    }

/* التجاوب */
@media (max-width: 992px) {
    .af-table th, .af-table td {
        padding: 8px 10px;
        font-size: 0.85rem;
    }

    .af-search-box {
        width: 200px;
    }
}

@media (max-width: 768px) {
    .d-flex {
        flex-direction: column;
        gap: 15px;
    }

    .af-search-box {
        width: 100%;
    }
}
/* تنسيقات خاصة بصفحة المواد الدراسية */
.af-search-form {
    margin-bottom: 2rem;
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 10px;
}

.af-code {
    font-family: monospace;
    font-weight: 600;
    color: #4facfe;
}

.af-description {
    color: #6c757d;
    max-width: 300px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.af-badge {
    display: inline-block;
    padding: 0.35em 0.65em;
    font-size: 0.85em;
    font-weight: 600;
    line-height: 1;
    text-align: center;
    white-space: nowrap;
    vertical-align: baseline;
    border-radius: 50rem;
}

.af-badge-info {
    color: #084298;
    background-color: #cfe2ff;
}

.af-badge-secondary {
    color: #41464b;
    background-color: #e2e3e5;
}

.af-btn-edit {
    background-color: #ffc107;
    color: #212529;
}

.af-btn-delete {
    background-color: #dc3545;
    color: white;
}

.af-btn-download {
    background-color: #198754;
    color: white;
}

.af-footer-actions {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e9ecef;
    text-align: left;
}

/* تحسينات التجاوب */
@media (max-width: 768px) {
    .af-search-form .af-form-group-horizontal {
        flex-direction: column;
    }

    .af-search-form .af-form-group {
        width: 100%;
    }

    .af-table td:nth-child(3),
    .af-table th:nth-child(3) {
        display: none;
    }

    .af-description {
        max-width: 150px;
    }
}
/* تنسيق صف البحث */
.af-search-row {
    display: flex;
    align-items: stretch;
    gap: 10px;
    margin-bottom: 20px;
}

.af-search-input {
    flex: 1;
    position: relative;
}

.af-search-icon {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #6c757d;
}

.af-grade-select {
    width: 200px;
    position: relative;
}

.af-select-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    color: #6c757d;
}

.af-search-btn {
    background: var(--gradient-primary);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 0 25px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

    .af-search-btn:hover {
        opacity: 0.9;
        transform: translateY(-1px);
    }

/* تحسينات لحقول الإدخال */
.af-search-input .af-form-control {
    width: 100%;
    padding-right: 40px;
}

.af-grade-select .af-form-select {
    width: 100%;
    padding-left: 35px;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
}

/* التجاوب للشاشات الصغيرة */
@media (max-width: 768px) {
    .af-search-row {
        flex-direction: column;
        gap: 15px;
    }

    .af-grade-select {
        width: 100%;
    }

    .af-search-btn {
        width: 100%;
        padding: 10px;
    }
}

.af-search-buttons {
    display: flex;
    gap: 10px;
}

.af-reset-btn {
    background: #f8f9fa;
    color: #6c757d;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 0 20px;
    font-weight: 600;
    transition: all 0.3s;
}

    .af-reset-btn:hover {
        background: #e9ecef;
        color: #495057;
    }

body.Student .navbar-collapse {
    flex-grow: 1;
    display: flex;
    justify-content: center;
}

body.Student .navbar-nav {
    width: auto;
    flex-direction: row;
}

.dropdown-menu {
    right: 0 !important;
    left: auto !important;
}

body.Teacher.navbar-collapse {
    flex-grow: 1;
    display: flex;
    justify-content: center;
}

body.Teacher .navbar-nav {
    width: auto;
    flex-direction: row;
}
