/**
 * ملف CSS المخصص للمنصة التعليمية - التنسيقات الأساسية العامة
 * File: assets/css/style.css
 * 
 * يحتوي هذا الملف على التنسيقات العامة الأساسية للموقع
 * يجب استدعاء هذا الملف قبل باقي ملفات CSS المتخصصة
 */

/* إعدادات عامة */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-color);
    line-height: 1.6;
    color: var(--text-color);
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* القائمة العلوية */
.navbar {
    box-shadow: var(--navbar-shadow);
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.4rem;
}

/* الصفحة الرئيسية */
.hero-section {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    padding: 80px 0;
    color: white;
    border-radius: 0 0 20px 20px;
    margin-bottom: 40px;
    box-shadow: var(--shadow);
}

.hero-content h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 20px;
}

.hero-content p {
    font-size: 1.1rem;
    margin-bottom: 30px;
    opacity: 0.9;
}

/* بطاقات الدورات */
.course-card {
    border-radius: 10px;
    overflow: hidden;
    transition: var(--transition);
    margin-bottom: 30px;
    border: none;
    box-shadow: var(--shadow-sm);
    background-color: var(--card-bg);
}

.course-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow);
}

.course-card .card-img-top {
    height: 180px;
    object-fit: cover;
}

.course-card .badge {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 0.8rem;
    padding: 5px 10px;
}

.course-card .card-body {
    padding: 20px;
}

.course-card .card-title {
    font-weight: 700;
    margin-bottom: 10px;
}

.course-price {
    font-weight: 700;
    color: var(--secondary-color);
    font-size: 1.1rem;
}

/* الفيديو المشغل */
.video-container {
    position: relative;
    width: 100%;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: var(--shadow);
    margin-bottom: 20px;
}

.video-watermark {
    position: absolute;
    top: 20px;
    right: 20px;
    background-color: rgba(0, 0, 0, 0.5);
    color: white;
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 0.8rem;
    z-index: 10;
}

/* نموذج تسجيل الدخول والتسجيل */
.auth-form {
    background-color: var(--card-bg);
    border-radius: 10px;
    padding: 30px;
    box-shadow: var(--shadow-sm);
    max-width: 500px;
    margin: 40px auto;
}

.auth-form .form-title {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 30px;
    text-align: center;
    color: var(--primary-color);
}

/* لوحة التحكم */
.dashboard-card {
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
    background-color: var(--card-bg);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

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

.dashboard-card .card-icon {
    font-size: 2.5rem;
    margin-bottom: 15px;
    color: var(--primary-color);
}

.dashboard-card .card-title {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 10px;
}

.dashboard-card .card-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--secondary-color);
}

/* أزرار */
.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    border-color: var(--primary-dark);
}

/* المحتوى المقفل */
.locked-content {
    position: relative;
    height: 200px;
    background-color: var(--bg-secondary);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    overflow: hidden;
}

.locked-content::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1;
}

.locked-content i {
    font-size: 3rem;
    color: white;
    z-index: 2;
}

/* ذيل الصفحة */
footer {
    margin-top: 50px;
    border-top: 1px solid var(--border-color);
}

footer a {
    text-decoration: none;
    transition: var(--transition);
}

footer a:hover {
    color: var(--primary-color) !important;
}

/* للشاشات الصغيرة */
@media (max-width: 767.98px) {
    .hero-content h1 {
        font-size: 2rem;
    }
    
    .hero-section {
        padding: 50px 0;
    }
} 


/* تنسيقات محسّنة لقسم الصفوف الدراسية - الجزء الثاني: تحسين الأداء والوصولية */
.study-years-section {
    padding: 100px 0;
    background: #f8f9fa;
    position: relative;
}

.section-patterns {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    z-index: 0;
    overflow: hidden;
    pointer-events: none; /* تحسين تجربة المستخدم */
}

.pattern {
    position: absolute;
    background-repeat: no-repeat;
    opacity: 0.05;
    will-change: transform; /* تحسين الأداء */
    transform: translateZ(0); /* تفعيل تسريع الهاردوير */
}

.pattern-math {
    background-image: url('<?php echo SITE_URL; ?>/public/assets/images/math-pattern.png');
    width: 400px;
    height: 400px;
    top: -100px;
    right: -100px;
    background-size: contain;
    animation: rotate 60s linear infinite;
}

.pattern-language {
    background-image: url('<?php echo SITE_URL; ?>/public/assets/images/lang-pattern.png');
    width: 400px;
    height: 400px;
    bottom: -100px;
    left: -100px;
    background-size: contain;
    animation: rotate 50s linear infinite reverse;
}

.pattern-hexagons {
    background-image: url('<?php echo SITE_URL; ?>/public/assets/images/hexagon-pattern.png');
    width: 100%;
    height: 100%;
    background-size: 600px;
    opacity: 0.02;
    animation: moveBackground 40s linear infinite;
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes moveBackground {
    from { background-position: 0 0; }
    to { background-position: 600px 600px; }
}

.section-header {
    position: relative;
    z-index: 1;
    margin-bottom: 3rem;
}

.section-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    display: inline-block;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.section-title {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 1rem;
    position: relative;
    display: inline-block;
}

.section-title:after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    color: var(--primary-color);
    -webkit-text-fill-color: transparent;
    -webkit-text-stroke: 1px var(--primary-color);
    opacity: 0.1;
    z-index: -1;
    font-size: 110%;
    transform: translateY(5px);
}

.section-subtitle {
    color: #666;
    font-size: 1.2rem;
    max-width: 800px;
    margin: 0 auto 1.5rem;
}

.section-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 1.5rem 0;
}

.divider-line {
    height: 3px;
    width: 50px;
    background: linear-gradient(to right, rgba(var(--primary-rgb), 0.3), rgba(var(--primary-rgb), 0.7));
    border-radius: 3px;
}

.divider-icon {
    margin: 0 15px;
    font-size: 1.2rem;
    color: var(--primary-color);
    animation: spin 6s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.class-card {
    background: white;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.08);
    transition: all 0.5s cubic-bezier(0.165, 0.84, 0.44, 1);
    position: relative;
    z-index: 1;
    height: 100%;
    border: 1px solid rgba(0, 0, 0, 0.05);
    contain: layout paint; /* تحسين الأداء */
}

.class-card:hover {
    transform: translateY(-15px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.12);
}

.class-card:before {
    content: '';
    position: absolute;
    z-index: -1;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 20px;
    box-shadow: 0 20px 45px rgba(var(--primary-rgb), 0.2);
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
}

.class-card:hover:before {
    opacity: 1;
}

.class-image {
    height: 200px;
    position: relative;
    overflow: hidden;
}

.class-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.7s ease;
    filter: brightness(0.9);
    will-change: transform, filter; /* تحسين أداء التحويلات */
}

.class-card:hover .class-image img {
    transform: scale(1.1);
    filter: brightness(1);
}

.class-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.7) 0%, rgba(0, 0, 0, 0) 70%);
}

.class-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 70px;
    height: 70px;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    z-index: 1;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
    opacity: 0;
    transition: all 0.5s ease;
    will-change: transform, opacity; /* تحسين الأداء */
}

.class-card:hover .class-icon {
    opacity: 1;
    animation: bounce 1s ease;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translate(-50%, -50%); }
    40% { transform: translate(-50%, -70%); }
    60% { transform: translate(-50%, -60%); }
}

.class-content {
    padding: 25px;
    position: relative;
}

.class-title {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 15px;
    color: var(--text-color);
    position: relative;
    display: inline-block;
}

.class-title:after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 40%;
    height: 3px;
    background: linear-gradient(to right, var(--primary-color), var(--secondary-color));
    transition: width 0.3s ease;
}

.class-card:hover .class-title:after {
    width: 100%;
}

.class-description {
    color: #666;
    margin-bottom: 20px;
    font-size: 0.95rem;
    line-height: 1.6;
}

.class-features {
    display: flex;
    margin-bottom: 20px;
    gap: 15px;
}

.feature {
    display: flex;
    align-items: center;
    font-size: 0.9rem;
    color: #555;
}

.feature i {
    margin-left: 8px;
    color: var(--primary-color);
}

.class-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: linear-gradient(to right, var(--primary-color), var(--primary-color));
    color: white;
    padding: 12px 20px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.4s ease;
    box-shadow: 0 5px 15px rgba(var(--primary-rgb), 0.25);
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.class-btn:before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to right, var(--primary-color), var(--secondary-color));
    opacity: 0;
    z-index: -1;
    transition: opacity 0.4s ease;
}

.class-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(var(--primary-rgb), 0.4);
    color: white;
}

.class-btn:hover:before {
    opacity: 1;
}

.class-btn i {
    transition: transform 0.3s ease;
}

.class-btn:hover i {
    transform: translateX(-8px);
}

.empty-state {
    background: white;
    border-radius: 20px;
    padding: 50px 30px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
}

.empty-icon {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 20px;
    opacity: 0.5;
}

.empty-title {
    font-size: 1.5rem;
    margin-bottom: 10px;
    color: var(--text-color);
}

.empty-text {
    color: #666;
}

/* تنسيقات الوضع الداكن */
[data-theme="dark"] .study-years-section {
    background: #1a1a1a;
}

[data-theme="dark"] .pattern {
    opacity: 0.1;
}

[data-theme="dark"] .section-subtitle {
    color: #aaa;
}

[data-theme="dark"] .class-card {
    background: #2d2d2d;
    border-color: rgba(255, 255, 255, 0.05);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
}

[data-theme="dark"] .class-card:hover {
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .class-description {
    color: #aaa;
}

[data-theme="dark"] .feature {
    color: #aaa;
}

[data-theme="dark"] .empty-state {
    background: #2d2d2d;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

[data-theme="dark"] .empty-title {
    color: #eee;
}

[data-theme="dark"] .empty-text {
    color: #aaa;
}

@media (max-width: 992px) {
    .class-card {
        margin-bottom: 20px;
    }
    
    .class-btn {
        padding: 10px 18px;
        font-size: 0.95rem;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .section-subtitle {
        font-size: 1.05rem;
    }
}

@media (max-width: 768px) {
    .section-title {
        font-size: 1.8rem;
    }
    
    .section-subtitle {
        font-size: 0.95rem;
    }
    
    .class-btn {
        width: 100%;
        padding: 12px 15px;
        justify-content: space-between;
    }
    
    .class-btn i {
        margin-left: 5px;
    }
}

@media (max-width: 576px) {
    .section-title {
        font-size: 1.7rem;
    }
    
    .section-subtitle {
        font-size: 0.9rem;
    }
    
    .class-btn {
        width: 100%;
        padding: 12px 15px;
        justify-content: space-between;
    }
    
    .class-btn i {
        margin-left: 5px;
    }
}

@media (max-width: 375px) {
    .section-title {
        font-size: 1.5rem;
    }
    
    .section-subtitle {
        font-size: 0.85rem;
    }
    
    .class-btn {
        font-size: 0.9rem;
        padding: 10px 15px;
    }
}
