/**
 * ملف التنسيق الرئيسي
 * Training Courses Management System
 * ألوان متوافقة مع شعار جمعية التنمية الأهلية
 */

/* الخطوط العربية */
@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@300;400;600;700&display=swap');

/* المتغيرات - ألوان الشعار */
:root {
    --primary-color: #B8434F;      /* أحمر عنابي */
    --primary-dark: #8B2D3A;       /* عنابي غامق */
    --primary-light: #E8636B;      /* أحمر فاتح */
    --secondary-color: #F4A68E;    /* سلموني */
    --secondary-dark: #E8917A;     /* سلموني غامق */
    --accent-color: #D94F5C;       /* مرجاني */
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --success-color: #10b981;
    --dark-color: #722F3D;         /* عنابي داكن للنصوص */
    --light-color: #FFF5F5;        /* خلفية فاتحة وردية */
    --border-radius: 12px;
    --box-shadow: 0 4px 6px rgba(139, 45, 58, 0.15);
    --transition: all 0.3s ease;
}

/* إعدادات عامة */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Cairo', sans-serif;
    direction: rtl;
    text-align: right;
    background: linear-gradient(135deg, #B8434F 0%, #F4A68E 50%, #E8636B 100%);
    min-height: 100vh;
    color: var(--dark-color);
}

/* الحاوية الرئيسية */
.main-container {
    min-height: 100vh;
    padding: 2rem 0;
}

/* الهيدر */
.header {
    background: white;
    padding: 1.5rem 0;
    box-shadow: var(--box-shadow);
    margin-bottom: 2rem;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logo {
    max-width: 180px;
    height: auto;
}

.site-title {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary-color);
    margin: 0;
}

/* البطاقات */
.card {
    border: none;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    transition: var(--transition);
    overflow: hidden;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(139, 45, 58, 0.2);
}

.card-header {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    font-weight: 600;
    padding: 1.2rem;
    border: none;
}

.card-body {
    padding: 1.5rem;
}

/* الأزرار */
.btn {
    border-radius: 8px;
    padding: 0.6rem 1.5rem;
    font-weight: 600;
    transition: var(--transition);
    border: none;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

.btn-outline-primary {
    background: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.btn-outline-primary:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
}

.btn-success {
    background: var(--success-color);
    color: white;
}

.btn-success:hover {
    background: #059669;
}

.btn-danger {
    background: var(--danger-color);
    color: white;
}

.btn-danger:hover {
    background: #dc2626;
}

.btn-warning {
    background: var(--warning-color);
    color: white;
}

.btn-secondary {
    background: var(--secondary-color);
    color: var(--dark-color);
}

.btn-secondary:hover {
    background: var(--secondary-dark);
}

/* الإحصائيات */
.stat-card {
    background: white;
    border-radius: var(--border-radius);
    padding: 1.5rem;
    box-shadow: var(--box-shadow);
    transition: var(--transition);
    text-align: center;
}

.stat-card:hover {
    transform: translateY(-5px);
}

.stat-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--primary-color);
}

.stat-label {
    color: #6b7280;
    font-size: 1rem;
}

/* بطاقات الدورات */
.course-card {
    background: white;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--box-shadow);
    transition: var(--transition);
    height: 100%;
    display: flex;
    flex-direction: column;
}

.course-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 24px rgba(139, 45, 58, 0.25);
}

.course-header {
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    color: white;
    padding: 1.5rem;
}

.course-title {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.course-body {
    padding: 1.5rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.course-description {
    color: #6b7280;
    margin-bottom: 1rem;
    flex-grow: 1;
}

.course-info {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    margin-bottom: 1rem;
}

.course-info-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #4b5563;
}

.course-info-item i {
    color: var(--primary-color);
    width: 20px;
}

/* شريط التقدم */
.progress-container {
    margin-top: 1rem;
}

.progress-label {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    color: #6b7280;
}

.progress {
    height: 10px;
    border-radius: 5px;
    background: #fde8e8;
}

.progress-bar {
    border-radius: 5px;
    transition: width 0.6s ease;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
}

/* الشارات */
.badge {
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.85rem;
}

.badge.bg-success {
    background: var(--success-color) !important;
}

.badge.bg-primary {
    background: var(--primary-color) !important;
}

/* النماذج */
.form-label {
    font-weight: 600;
    color: var(--dark-color);
    margin-bottom: 0.5rem;
}

.form-control, .form-select {
    border-radius: 8px;
    border: 2px solid #fde8e8;
    padding: 0.7rem;
    transition: var(--transition);
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(184, 67, 79, 0.15);
}

.form-check-input {
    width: 1.3rem;
    height: 1.3rem;
    border-radius: 4px;
    border: 2px solid #d1d5db;
}

.form-check-input:checked {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.form-check-input:focus {
    box-shadow: 0 0 0 3px rgba(184, 67, 79, 0.15);
}

.form-check-label {
    margin-right: 0.5rem;
    font-weight: 500;
}

/* الجداول */
.table {
    background: white;
    border-radius: var(--border-radius);
    overflow: hidden;
}

.table thead {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
}

.table thead th {
    border: none;
    padding: 1rem;
    font-weight: 600;
}

.table tbody tr {
    transition: var(--transition);
}

.table tbody tr:hover {
    background: var(--light-color);
}

.table tbody td {
    padding: 1rem;
    vertical-align: middle;
}

/* التنبيهات */
.alert {
    border-radius: var(--border-radius);
    border: none;
    padding: 1rem 1.5rem;
    margin-bottom: 1.5rem;
}

.alert i {
    font-size: 1.2rem;
}

.alert-danger {
    background: #fde8e8;
    color: var(--primary-dark);
}

.alert-success {
    background: #d1fae5;
    color: #065f46;
}

/* صفحة تسجيل الدخول */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.login-card {
    max-width: 450px;
    width: 100%;
    background: white;
    border-radius: var(--border-radius);
    box-shadow: 0 20px 60px rgba(139, 45, 58, 0.3);
    overflow: hidden;
}

.login-header {
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    color: white;
    padding: 2rem;
    text-align: center;
}

.login-header h2 {
    margin: 0;
    font-weight: 700;
}

.login-logo {
    max-width: 120px;
    height: auto;
}

.login-body {
    padding: 2rem;
}

/* صفحة النجاح */
.success-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.success-card {
    max-width: 600px;
    width: 100%;
    background: white;
    border-radius: var(--border-radius);
    box-shadow: 0 20px 60px rgba(139, 45, 58, 0.3);
    padding: 3rem;
    text-align: center;
}

.success-icon {
    font-size: 5rem;
    color: var(--success-color);
    margin-bottom: 1.5rem;
}

.success-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--dark-color);
    margin-bottom: 1rem;
}

.success-message {
    color: #6b7280;
    font-size: 1.1rem;
    margin-bottom: 2rem;
}

.registration-details {
    background: var(--light-color);
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    text-align: right;
}

/* الرسوم المتحركة */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.5s ease;
}

/* استجابة الشاشات الكبيرة - تابلت */
@media (max-width: 992px) {
    .course-card {
        margin-bottom: 1rem;
    }
    
    .stat-number {
        font-size: 2.2rem;
    }
}

/* استجابة الشاشات المتوسطة - تابلت صغير */
@media (max-width: 768px) {
    body {
        background: linear-gradient(180deg, #B8434F 0%, #F4A68E 100%);
    }
    
    .site-title {
        font-size: 1.3rem;
    }
    
    .stat-number {
        font-size: 2rem;
    }
    
    .course-title {
        font-size: 1.2rem;
    }
    
    .login-card, .success-card {
        margin: 1rem;
    }
    
    .header .d-flex {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .header .logo-container {
        justify-content: center;
    }
    
    .header .d-flex.gap-3 {
        flex-direction: column;
        width: 100%;
    }
    
    .header .d-flex.gap-3 .btn {
        width: 100%;
    }
    
    .card-header {
        padding: 1rem;
        font-size: 0.95rem;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .display-4 {
        font-size: 1.8rem !important;
    }
    
    .lead {
        font-size: 1rem !important;
    }
}

/* استجابة الهواتف الذكية */
@media (max-width: 576px) {
    .container {
        padding-left: 15px;
        padding-right: 15px;
    }
    
    .header {
        padding: 1rem 0;
        margin-bottom: 1rem;
    }
    
    .logo {
        max-width: 120px;
    }
    
    .site-title {
        font-size: 1.1rem;
    }
    
    .display-4 {
        font-size: 1.5rem !important;
    }
    
    .lead {
        font-size: 0.95rem !important;
    }
    
    .text-center.mb-5 {
        margin-bottom: 1.5rem !important;
    }
    
    /* البطاقات */
    .card {
        border-radius: 10px;
        margin-bottom: 1rem;
    }
    
    .card-header {
        padding: 0.8rem;
        font-size: 0.9rem;
    }
    
    .card-header .badge {
        display: block;
        margin-top: 0.5rem;
    }
    
    .card-header.d-flex {
        flex-direction: column;
        align-items: flex-start !important;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    /* النماذج */
    .form-label {
        font-size: 0.9rem;
    }
    
    .form-control, .form-select {
        padding: 0.6rem;
        font-size: 16px; /* يمنع التكبير التلقائي على iOS */
    }
    
    .col-md-6 {
        margin-bottom: 0.5rem;
    }
    
    /* بطاقات الدورات */
    .course-card {
        border-radius: 10px;
    }
    
    .course-header {
        padding: 1rem;
    }
    
    .course-title {
        font-size: 1.1rem;
    }
    
    .course-body {
        padding: 1rem;
    }
    
    .course-description {
        font-size: 0.9rem;
    }
    
    .course-info-item {
        font-size: 0.85rem;
    }
    
    .course-info-item i {
        width: 18px;
        font-size: 0.85rem;
    }
    
    /* الأزرار */
    .btn {
        padding: 0.6rem 1rem;
        font-size: 0.9rem;
    }
    
    .btn-lg {
        padding: 0.8rem 1.5rem;
        font-size: 1rem;
    }
    
    /* التنبيهات */
    .alert {
        padding: 0.8rem 1rem;
        font-size: 0.85rem;
    }
    
    /* Footer */
    footer {
        padding: 1rem !important;
    }
    
    footer p {
        font-size: 0.85rem;
    }
    
    /* إحصائيات */
    .stat-card {
        padding: 1rem;
        margin-bottom: 1rem;
    }
    
    .stat-icon {
        font-size: 2rem;
    }
    
    .stat-number {
        font-size: 1.8rem;
    }
    
    .stat-label {
        font-size: 0.85rem;
    }
    
    /* صفحة النجاح */
    .success-card {
        padding: 1.5rem;
        margin: 0.5rem;
    }
    
    .success-icon {
        font-size: 3.5rem;
    }
    
    .success-title {
        font-size: 1.5rem;
    }
    
    .success-message {
        font-size: 1rem;
    }
    
    /* صفحة تسجيل الدخول */
    .login-card {
        margin: 0.5rem;
    }
    
    .login-header {
        padding: 1.5rem;
    }
    
    .login-body {
        padding: 1.5rem;
    }
}

/* استجابة الهواتف الصغيرة جداً */
@media (max-width: 375px) {
    .logo {
        max-width: 100px;
    }
    
    .display-4 {
        font-size: 1.3rem !important;
    }
    
    .course-title {
        font-size: 1rem;
    }
    
    .btn {
        padding: 0.5rem 0.8rem;
        font-size: 0.85rem;
    }
}

/* تحسينات اللمس للهواتف */
@media (hover: none) and (pointer: coarse) {
    .btn {
        min-height: 44px;
    }
    
    .form-check-input {
        width: 1.5rem;
        height: 1.5rem;
    }
    
    .course-card:hover {
        transform: none;
    }
    
    .card:hover {
        transform: none;
    }
    
    .stat-card:hover {
        transform: none;
    }
}

/* تنسيقات أزرار الهيدر */
.header-buttons {
    width: auto;
}

@media (max-width: 576px) {
    .header-buttons {
        width: 100%;
    }
    
    .header-buttons .btn {
        width: 100%;
        justify-content: center;
    }
}

/* زر التسجيل متجاوب */
@media (max-width: 576px) {
    .w-sm-auto {
        width: 100% !important;
    }
}

@media (min-width: 577px) {
    .w-sm-auto {
        width: auto !important;
    }
}

/* تحسينات إضافية */
.text-primary {
    color: var(--primary-color) !important;
}

.bg-primary {
    background-color: var(--primary-color) !important;
}

.border-primary {
    border-color: var(--primary-color) !important;
}

/* أيقونات مخصصة */
.icon-wrapper {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(184, 67, 79, 0.1);
    color: var(--primary-color);
}

/* تأثيرات hover للروابط */
a {
    color: var(--primary-color);
    transition: var(--transition);
}

a:hover {
    color: var(--primary-dark);
}

/* Footer */
footer {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary-color));
}

/* بطاقات الدورات للهواتف في لوحة التحكم */
.mobile-course-card {
    background: white;
    border-radius: var(--border-radius);
    padding: 1rem;
    margin: 0.75rem;
    box-shadow: var(--box-shadow);
    border-right: 4px solid var(--primary-color);
    transition: var(--transition);
}

.mobile-course-card:hover {
    box-shadow: 0 4px 12px rgba(139, 45, 58, 0.2);
    transform: translateY(-2px);
}

/* بطاقات المسجلين للهواتف */
.registration-card {
    background: white;
    border-radius: var(--border-radius);
    margin-bottom: 1rem;
    box-shadow: var(--box-shadow);
    overflow: hidden;
    border-right: 4px solid var(--primary-color);
}

.registration-card-header {
    background: var(--light-color);
    padding: 0.8rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.registration-number {
    background: var(--primary-color);
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: bold;
}

.registration-card-body {
    padding: 1rem;
}

.registration-info-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.registration-info-item i {
    color: var(--primary-color);
    width: 20px;
    text-align: center;
}

.registration-info-item:last-child {
    margin-bottom: 0;
}

.registration-card-actions {
    display: flex;
    gap: 0.5rem;
    padding: 0.8rem 1rem;
    background: var(--light-color);
    border-top: 1px solid #eee;
}

/* صندوق معلومات الدورة */
.course-info-box {
    background: var(--light-color);
    border-radius: 8px;
    padding: 1rem;
}

.course-info-box .course-info-item {
    padding: 0.5rem 0;
    border-bottom: 1px solid #eee;
}

.course-info-box .course-info-item:last-child {
    border-bottom: none;
}

/* تحسينات إضافية للهواتف */
@media (max-width: 576px) {
    .stat-card {
        padding: 0.8rem;
    }
    
    .stat-number {
        font-size: 1.5rem;
    }
    
    .stat-icon {
        font-size: 1.8rem;
        margin-bottom: 0.5rem;
    }
    
    .stat-label {
        font-size: 0.75rem;
    }
    
    .logo {
        max-width: 100px;
    }
    
    .mobile-course-card {
        margin: 0.5rem 0;
        padding: 0.8rem;
    }
    
    .btn-sm {
        padding: 0.4rem 0.6rem;
        font-size: 0.8rem;
    }
    
    .registration-card {
        margin-bottom: 0.75rem;
    }
    
    .registration-card-header {
        padding: 0.6rem 0.8rem;
    }
    
    .registration-card-body {
        padding: 0.8rem;
    }
    
    .registration-info-item {
        font-size: 0.85rem;
    }
    
    .registration-card-actions {
        padding: 0.6rem 0.8rem;
    }
    
    .course-info-box {
        padding: 0.8rem;
    }
}

/* تحسينات للطباعة */
@media print {
    .no-print {
        display: none !important;
    }
    
    body {
        background: white;
    }
}