/* =====================================
   style.css - ملف الأنماط العام لموقع جامعة مؤتة
   تصميم حديث وعصري - الإصدار 5.0 (الموحد المتكامل)
   ===================================== */

/* ========== استيراد الخطوط ========== */
@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@300;400;500;600;700;800&display=swap');

/* ========== المتغيرات العامة ========== */
:root {
    --primary: #1a4d8c;
    --primary-dark: #0e3a6b;
    --primary-light: #2c6bb0;
    --secondary: #2d6a4f;
    --secondary-dark: #1b4d3e;
    --secondary-light: #40916c;
    --accent: #f59e0b;
    --success: #10b981;
    --success-light: #d1fae5;
    --warning: #f59e0b;
    --warning-light: #fef3c7;
    --danger: #dc2626;
    --danger-light: #fee2e2;
    --info: #3b82f6;
    --info-light: #dbeafe;
    --bg-gradient-start: #eff6ff;
    --bg-gradient-end: #eef2ff;
    --bg-white: #ffffff;
    --bg-light: #f9fafb;
    --bg-dark: #1f2937;
    --text-primary: #111827;
    --text-secondary: #4b5563;
    --text-muted: #6b7280;
    --text-light: #9ca3af;
    --text-white: #ffffff;
    --border-light: #e5e7eb;
    --border-medium: #d1d5db;
    --sidebar-width: 280px;
    --header-height: 70px;
    --border-radius-sm: 8px;
    --border-radius-md: 12px;
    --border-radius-lg: 16px;
    --border-radius-xl: 20px;
    --border-radius-2xl: 24px;
    --border-radius-full: 9999px;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1);
    --shadow-2xl: 0 25px 50px -12px rgb(0 0 0 / 0.25);
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 300ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 500ms cubic-bezier(0.4, 0, 0.2, 1);
    --font-family: 'Cairo', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    --font-size-xs: 0.75rem;
    --font-size-sm: 0.875rem;
    --font-size-base: 1rem;
    --font-size-lg: 1.125rem;
    --font-size-xl: 1.25rem;
    --font-size-2xl: 1.5rem;
    --font-size-3xl: 1.875rem;
    --font-size-4xl: 2.25rem;
}

/* ========== إعادة تعيين الأنماط ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    background: linear-gradient(135deg, var(--bg-gradient-start) 0%, var(--bg-gradient-end) 100%);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

/* ========== الحاوية الرئيسية ========== */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ========== أنماط الرأس ========== */
.header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    padding: 12px 0;
    box-shadow: var(--shadow-md);
    margin-bottom: 30px;
    border-radius: var(--border-radius-lg);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 16px;
}

.logo-img {
    width: 48px;
    height: 48px;
    object-fit: contain;
    border-radius: var(--border-radius-md);
    background: white;
    padding: 8px;
    box-shadow: var(--shadow-lg);
    transition: transform var(--transition-base);
}

.logo-img:hover {
    transform: scale(1.05) rotate(5deg);
}

.logo-text h1 {
    font-size: var(--font-size-2xl);
    font-weight: 700;
    color: white;
}

.logo-text p {
    font-size: var(--font-size-sm);
    opacity: 0.9;
    color: white;
}

.header-buttons {
    display: flex;
    gap: 10px;
}

.header-buttons button {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    padding: 8px 16px;
    border-radius: var(--border-radius-full);
    cursor: pointer;
    font-size: var(--font-size-sm);
    transition: var(--transition-base);
    display: flex;
    align-items: center;
    gap: 8px;
}

.header-buttons button:hover {
    background: rgba(255,255,255,0.3);
    transform: translateY(-2px);
}

/* ========== أنماط لوحة المعلومات ========== */
.dashboard {
    display: flex;
    gap: 28px;
    background: transparent;
    min-height: 600px;
}

/* ========== أنماط القائمة الجانبية ========== */
.sidebar {
    width: var(--sidebar-width);
    min-width: var(--sidebar-width);
    background: linear-gradient(135deg, #1e3a5f 0%, #0f2b44 100%);
    border-radius: var(--border-radius-xl);
    box-shadow: var(--shadow-xl);
    height: fit-content;
    position: sticky;
    top: calc(var(--header-height) + 24px);
    overflow: hidden;
}

.user-profile {
    text-align: center;
    padding: 30px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.user-avatar {
    width: 90px;
    height: 90px;
    background: rgba(255,255,255,0.15);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 15px;
    color: white;
    font-size: 2.5rem;
    border: 3px solid rgba(255,255,255,0.3);
}

.user-name {
    font-size: var(--font-size-lg);
    font-weight: 700;
    color: white;
    margin-bottom: 5px;
}

.user-id {
    color: rgba(255,255,255,0.7);
    font-size: var(--font-size-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: rgba(255,255,255,0.1);
    padding: 5px 12px;
    border-radius: var(--border-radius-full);
    width: fit-content;
    margin: 0 auto;
}

.sidebar-menu {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-menu li {
    margin: 0;
    padding: 0;
}

.sidebar-menu a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    transition: all var(--transition-base);
    font-size: var(--font-size-sm);
    font-weight: 500;
    border-right: 3px solid transparent;
}

.sidebar-menu a:hover {
    background: rgba(255,255,255,0.1);
    color: white;
    border-right-color: var(--accent);
}

.sidebar-menu a.active {
    background: rgba(102, 126, 234, 0.3);
    color: white;
    border-right-color: #667eea;
}

.sidebar-menu i {
    width: 24px;
    text-align: center;
    font-size: var(--font-size-lg);
}

.sidebar-menu .logout-item {
    margin-top: 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 10px;
}

.sidebar-menu .logout-item a {
    color: #f87171;
}

.sidebar-menu .logout-item a:hover {
    background: rgba(220, 38, 38, 0.2);
    color: white;
}

/* ========== أنماط شارة المحادثات ========== */
.chat-menu-item {
    position: relative;
}

.chat-badge {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: #ef4444;
    color: white;
    border-radius: 20px;
    padding: 2px 8px;
    font-size: 11px;
    font-weight: bold;
    min-width: 20px;
    text-align: center;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%, 100% { transform: translateY(-50%) scale(1); }
    50% { transform: translateY(-50%) scale(1.1); }
}

/* ========== أنماط المحتوى الرئيسي ========== */
.main-content {
    padding: 0 0 32px 0;
}

.content {
    flex: 1;
    background: white;
    border-radius: var(--border-radius-2xl);
    box-shadow: var(--shadow-xl);
    padding: 28px;
    border: 1px solid var(--border-light);
}

/* ========== أنماط رأس الصفحة ========== */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--border-light);
    flex-wrap: wrap;
    gap: 15px;
}

.page-title {
    font-size: var(--font-size-2xl);
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.page-title i {
    color: var(--primary);
}

.student-info-badge {
    background: var(--bg-light);
    padding: 8px 18px;
    border-radius: var(--border-radius-full);
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
    border: 1px solid var(--border-light);
}

.info-item {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-primary);
    font-size: var(--font-size-sm);
    font-weight: 500;
}

.info-item i {
    color: var(--primary);
}

/* ========== أنماط التنبيهات ========== */
.alert {
    padding: 15px 20px;
    border-radius: var(--border-radius-lg);
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-right: 4px solid;
}

.alert-success {
    background: var(--success-light);
    color: #065f46;
    border-right-color: var(--success);
}

.alert-info {
    background: var(--info-light);
    color: var(--primary-dark);
    border-right-color: var(--primary);
}

.alert-warning {
    background: var(--warning-light);
    color: #92400e;
    border-right-color: var(--warning);
}

.alert-danger {
    background: var(--danger-light);
    color: #991b1b;
    border-right-color: var(--danger);
}

/* ========== أنماط البطاقات ========== */
.section-card {
    background: white;
    border-radius: var(--border-radius-lg);
    padding: 20px;
    margin-bottom: 25px;
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-sm);
}

.section-title {
    font-size: var(--font-size-xl);
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--border-light);
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-title i {
    color: var(--primary);
}

/* ========== أنماط بطاقات الإحصائيات ========== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 25px;
}

.stat-card {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    border-radius: var(--border-radius-lg);
    padding: 20px;
    color: white;
    text-align: center;
    transition: var(--transition-base);
}

.stat-card i {
    font-size: 2rem;
    margin-bottom: 10px;
    opacity: 0.9;
}

.stat-label {
    font-size: var(--font-size-sm);
    opacity: 0.9;
    margin-bottom: 8px;
}

.stat-value {
    font-size: 2rem;
    font-weight: 800;
}

.stat-desc {
    font-size: var(--font-size-xs);
    opacity: 0.8;
    margin-top: 5px;
}

.balance-positive {
    color: #ffcccc;
}

.balance-negative {
    color: #ccffcc;
}

/* ========== أنماط بطاقة نوع الطالب ========== */
.student-type-card {
    background: linear-gradient(135deg, #f8f9fa, #ffffff);
    border-radius: var(--border-radius-xl);
    padding: 15px 20px;
    margin-top: 20px;
    border: 1px solid var(--border-light);
}

.student-type-content {
    display: flex;
    align-items: center;
    gap: 15px;
}

.student-type-icon {
    width: 45px;
    height: 45px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.student-type-icon i {
    color: white;
    font-size: 1.3rem;
}

.student-type-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 2px;
}

.student-type-value {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
}

/* ========== أنماط الملاحظات ========== */
.notes-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 25px;
    margin: 20px 0;
}

.notes-card {
    background: white;
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

.notes-card-header {
    padding: 15px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.notes-card-header.acceptance {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
}

.notes-card-header.financial {
    background: linear-gradient(135deg, #f093fb, #f5576c);
    color: white;
}

.notes-card-header i {
    font-size: 24px;
}

.notes-card-header h4 {
    margin: 0;
    font-size: 1.1rem;
    flex: 1;
}

.notes-count {
    background: rgba(255,255,255,0.3);
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
}

.notes-list {
    padding: 10px;
    max-height: 350px;
    overflow-y: auto;
}

.note-item {
    background: #f9fafb;
    border-radius: 10px;
    padding: 12px;
    margin: 8px;
    transition: all 0.3s;
    border-right: 3px solid;
}

.notes-card.acceptance .note-item {
    border-right-color: #667eea;
}

.notes-card.financial .note-item {
    border-right-color: #f5576c;
}

.note-item:hover {
    transform: translateX(-3px);
    box-shadow: var(--shadow-sm);
    background: white;
}

.note-text {
    font-size: 0.9rem;
    color: #333;
    margin-bottom: 8px;
}

.note-date {
    font-size: 0.7rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 5px;
}

.empty-notes {
    text-align: center;
    padding: 40px;
    color: var(--text-muted);
}

.empty-notes i {
    font-size: 2rem;
    margin-bottom: 10px;
    opacity: 0.5;
}

/* ========== أنماط الجداول ========== */
.table-responsive {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: var(--border-radius-lg);
    overflow: hidden;
}

.data-table thead {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
}

.data-table th {
    padding: 12px 15px;
    font-weight: 600;
    text-align: center;
    color: white;
    font-size: var(--font-size-sm);
}

.data-table td {
    padding: 10px 15px;
    border-bottom: 1px solid var(--border-light);
    text-align: center;
}

.data-table tbody tr:hover {
    background: #f9fafb;
}

/* ========== أنماط الشارات ========== */
.serial-badge {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-weight: bold;
    font-size: 0.8rem;
}

.course-code {
    font-family: monospace;
    font-weight: bold;
    color: var(--primary);
}

.section-badge {
    background: #fef3c7;
    color: #92400e;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    display: inline-block;
}

.hall-badge {
    background: #d1fae5;
    color: #065f46;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    display: inline-block;
}

.time-badge {
    background: #e0e7ff;
    color: #3730a3;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    display: inline-block;
}

.day-badge {
    background: #ffe4e6;
    color: #9f1239;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 0.7rem;
    display: inline-block;
    margin: 2px;
}

/* ========== أنماط النموذج (Form Styles) ========== */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 25px;
}

.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-primary);
    font-size: var(--font-size-sm);
}

.form-label i {
    color: var(--primary);
    margin-left: 8px;
}

.form-control {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-medium);
    border-radius: var(--border-radius-md);
    font-size: var(--font-size-base);
    font-family: var(--font-family);
    transition: var(--transition-base);
    background: white;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(26, 77, 140, 0.1);
}

.form-text {
    font-size: var(--font-size-xs);
    color: var(--text-muted);
    margin-top: 5px;
    display: block;
}

.text-muted {
    color: var(--text-muted);
}

/* ========== أنماط الأزرار ========== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--border-radius-md);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-base);
    border: none;
    font-family: var(--font-family);
}

.btn-sm {
    padding: 5px 12px;
    font-size: var(--font-size-xs);
}

.btn-lg {
    padding: 12px 28px;
    font-size: var(--font-size-base);
}

.btn-success {
    background: linear-gradient(135deg, var(--success), #059669);
    color: white;
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--primary);
    color: var(--primary);
}

.btn-outline:hover {
    background: var(--primary);
    color: white;
    transform: translateY(-2px);
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger), #b91c1c);
    color: white;
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* ========== أنماط الإجراءات ========== */
.action-buttons {
    display: flex;
    gap: 15px;
    justify-content: flex-start;
    margin-top: 20px;
}

.quick-actions {
    display: flex;
    gap: 15px;
    justify-content: flex-start;
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid var(--border-light);
    flex-wrap: wrap;
}

.action-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    background: var(--primary);
    color: white;
    text-decoration: none;
    border-radius: var(--border-radius-md);
    transition: var(--transition-base);
    border: none;
    cursor: pointer;
    font-size: var(--font-size-sm);
    font-weight: 500;
}

.action-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    text-decoration: none;
    color: white;
}

/* ========== أنماط البطاقات الفارغة ========== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    background: var(--bg-light);
    border-radius: var(--border-radius-lg);
}

.empty-icon {
    font-size: 4rem;
    color: var(--text-light);
    margin-bottom: 20px;
}

.empty-state p {
    color: var(--text-muted);
    margin-top: 10px;
}

/* ========== أنماط الروابط السريعة ========== */
.quick-links-section-bottom {
    background: var(--bg-light);
    border-radius: var(--border-radius-xl);
    padding: 20px;
    margin-top: 25px;
}

.quick-links-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.quick-link-card {
    background: white;
    border: 1px solid var(--border-light);
    border-radius: 12px;
    padding: 15px;
    text-align: center;
    text-decoration: none;
    transition: all 0.3s;
    display: block;
}

.quick-link-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary);
}

.quick-link-icon {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #e0e7ff, #c7d2fe);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 12px;
}

.quick-link-icon i {
    font-size: 1.3rem;
    color: var(--primary);
}

.quick-link-title {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-primary);
    margin-bottom: 5px;
}

.quick-link-desc {
    font-size: 0.7rem;
    color: var(--text-muted);
}

/* ========== أنماط التذييل ========== */
.footer {
    background: linear-gradient(135deg, var(--bg-dark) 0%, #111827 100%);
    color: white;
    padding: 20px 0;
    margin-top: 40px;
    border-radius: var(--border-radius-lg);
    text-align: center;
}

/* ========== أنماط الطباعة ========== */
@media print {
    .header, .sidebar, .footer, .quick-links-section-bottom,
    .quick-actions, .alert-info, .action-buttons {
        display: none !important;
    }
    
    .dashboard {
        display: block;
    }
    
    .content {
        box-shadow: none;
        padding: 0;
        background: white;
    }
}

/* ========== أنماط الاستجابة للشاشات المختلفة ========== */
@media (max-width: 1024px) {
    .container {
        padding: 0 20px;
    }
    .dashboard {
        gap: 20px;
    }
}

@media (max-width: 768px) {
    .dashboard {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        min-width: auto;
        position: relative;
        top: 0;
        margin-bottom: 20px;
    }
    
    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .student-info-badge {
        width: 100%;
        justify-content: center;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .notes-container {
        grid-template-columns: 1fr;
    }
    
    .quick-links-grid {
        grid-template-columns: 1fr;
    }
    
    .form-grid {
        grid-template-columns: 1fr;
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .quick-actions {
        flex-direction: column;
    }
    
    .action-btn {
        width: 100%;
        justify-content: center;
    }
    
    .header .container {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
    
    .logo {
        justify-content: center;
    }
    
    .content {
        padding: 20px;
    }
}

@media (max-width: 576px) {
    .container {
        padding: 0 15px;
    }
    
    .page-title {
        font-size: var(--font-size-xl);
    }
    
    .section-title {
        font-size: var(--font-size-lg);
    }
    
    .stat-value {
        font-size: 1.5rem;
    }
}

/* ========== أنماط إضافية ========== */
.text-center {
    text-align: center;
}