/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    overflow-x: hidden;
}

/* Arabic font support */
[dir="rtl"] body {
    font-family: 'Noto Sans Arabic', 'Cairo', 'Tajawal', 'Almarai', 'Segoe UI', 'Tahoma', 'Arial', sans-serif;
}

/* Import Google Fonts for Arabic */
@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@200;300;400;500;600;700;800;900&family=Tajawal:wght@200;300;400;500;700;800;900&family=Almarai:wght@300;400;700;800&family=Noto+Sans+Arabic:wght@100;200;300;400;500;600;700;800;900&display=swap');

/* RTL Support */
[dir="rtl"] {
    direction: rtl;
    text-align: right;
}

/* Arabic Typography Enhancements */
[dir="rtl"] .subtitle {
    font-family: 'Cairo', 'Noto Sans Arabic', sans-serif;
    font-weight: 400;
    letter-spacing: 0.5px;
    line-height: 1.8;
}

[dir="rtl"] .filter-title {
    font-family: 'Tajawal', 'Noto Sans Arabic', sans-serif;
    font-weight: 600;
}

[dir="rtl"] .filter-btn {
    font-family: 'Cairo', 'Noto Sans Arabic', sans-serif;
    font-weight: 500;
}

[dir="rtl"] .stat-label {
    font-family: 'Almarai', 'Noto Sans Arabic', sans-serif;
    font-weight: 700;
    letter-spacing: 0.3px;
}

[dir="rtl"] .course-title {
    font-family: 'Tajawal', 'Noto Sans Arabic', sans-serif;
    font-weight: 600;
    line-height: 1.4;
}

[dir="rtl"] .course-description {
    font-family: 'Cairo', 'Noto Sans Arabic', sans-serif;
    font-weight: 400;
    line-height: 1.8;
}

[dir="rtl"] .course-level {
    font-family: 'Almarai', 'Noto Sans Arabic', sans-serif;
    font-weight: 700;
}

[dir="rtl"] .coming-soon-badge {
    font-family: 'Cairo', 'Noto Sans Arabic', sans-serif;
    font-weight: 600;
}

[dir="rtl"] .feature {
    font-family: 'Cairo', 'Noto Sans Arabic', sans-serif;
    font-weight: 500;
}

[dir="rtl"] .enroll-btn, 
[dir="rtl"] .details-btn {
    font-family: 'Tajawal', 'Noto Sans Arabic', sans-serif;
    font-weight: 600;
}

[dir="rtl"] .filter-title {
    font-family: 'Tajawal', 'Noto Sans Arabic', sans-serif;
    font-weight: 600;
}

[dir="rtl"] .dialog-header h2 {
    font-family: 'Tajawal', 'Noto Sans Arabic', sans-serif;
    font-weight: 600;
}

[dir="rtl"] .form-group label {
    font-family: 'Cairo', 'Noto Sans Arabic', sans-serif;
    font-weight: 600;
}

[dir="rtl"] .form-note p {
    font-family: 'Cairo', 'Noto Sans Arabic', sans-serif;
    font-weight: 400;
    line-height: 1.8;
}

[dir="rtl"] .submit-btn, 
[dir="rtl"] .cancel-btn {
    font-family: 'Tajawal', 'Noto Sans Arabic', sans-serif;
    font-weight: 600;
}

[dir="rtl"] .footer-content p {
    font-family: 'Cairo', 'Noto Sans Arabic', sans-serif;
    font-weight: 400;
}

/* Arabic Typography Final Enhancements */
[dir="rtl"] .loading-state h3,
[dir="rtl"] .error-state h3,
[dir="rtl"] .no-courses h3 {
    font-family: 'Tajawal', 'Noto Sans Arabic', sans-serif;
    font-weight: 700;
    line-height: 1.4;
}

[dir="rtl"] .loading-state p,
[dir="rtl"] .error-state p,
[dir="rtl"] .no-courses p {
    font-family: 'Cairo', 'Noto Sans Arabic', sans-serif;
    font-weight: 400;
    line-height: 1.8;
}

[dir="rtl"] .retry-btn {
    font-family: 'Tajawal', 'Noto Sans Arabic', sans-serif;
    font-weight: 600;
    padding: 16px 32px;
    border-radius: 28px;
}

[dir="rtl"] .close-btn {
    font-family: 'Cairo', 'Noto Sans Arabic', sans-serif;
}

/* Arabic-specific visual improvements */
[dir="rtl"] .course-card::before {
    background: linear-gradient(90deg, #96ceb4, #45b7d1, #4ecdc4, #ff6b6b);
}

[dir="rtl"] .course-icon {
    font-size: 2rem;
}

[dir="rtl"] .course-level {
    font-size: 0.9rem;
    padding: 10px 18px;
}

[dir="rtl"] .coming-soon-badge {
    font-size: 0.8rem;
    padding: 8px 14px;
    border-radius: 18px;
}

/* Arabic form field improvements */
[dir="rtl"] .form-group input:focus {
    border-width: 3px;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.15);
}

[dir="rtl"] .form-note {
    border-radius: 18px;
    padding: 22px;
}

[dir="rtl"] .form-note i {
    font-size: 1.3rem;
    margin-top: 3px;
}

/* Additional Arabic Typography Improvements */
[dir="rtl"] .course-features {
    gap: 10px;
}

[dir="rtl"] .feature {
    padding: 8px 14px;
    border-radius: 18px;
    font-size: 0.85rem;
}

[dir="rtl"] .course-duration {
    font-family: 'Almarai', 'Noto Sans Arabic', sans-serif;
    font-weight: 500;
}

[dir="rtl"] .card-actions {
    gap: 15px;
}

[dir="rtl"] .enroll-btn, 
[dir="rtl"] .details-btn {
    padding: 14px 26px;
    border-radius: 28px;
    font-size: 0.95rem;
    letter-spacing: 0.3px;
}

[dir="rtl"] .filter-btn {
    padding: 14px 26px;
    border-radius: 28px;
    font-size: 0.95rem;
    letter-spacing: 0.3px;
}

[dir="rtl"] .stat-item {
    text-align: center;
}

[dir="rtl"] .stat-label {
    text-align: center;
    margin-top: 5px;
}

/* Arabic-specific spacing improvements */
[dir="rtl"] .course-card {
    text-align: right;
    padding: 32px 28px;
}

[dir="rtl"] .card-header {
    margin-bottom: 28px;
}

[dir="rtl"] .card-content {
    margin-bottom: 28px;
}

[dir="rtl"] .card-footer {
    padding-top: 25px;
}

/* Arabic form improvements */
[dir="rtl"] .form-group input {
    text-align: right;
    padding: 16px 20px;
    font-family: 'Cairo', 'Noto Sans Arabic', sans-serif;
}

[dir="rtl"] .form-group input::placeholder {
    font-family: 'Cairo', 'Noto Sans Arabic', sans-serif;
    font-weight: 400;
}

[dir="rtl"] .header-content {
    flex-direction: column;
}

[dir="rtl"] .nav-container {
    flex-direction: row-reverse;
}

[dir="rtl"] .top-social-links {
    flex-direction: row-reverse;
}

[dir="rtl"] .filter-buttons {
    justify-content: flex-end;
}

[dir="rtl"] .course-card {
    text-align: right;
}

[dir="rtl"] .course-features {
    justify-content: flex-end;
}

[dir="rtl"] .card-actions {
    flex-direction: row-reverse;
}

[dir="rtl"] .footer-content {
    flex-direction: row-reverse;
}

[dir="rtl"] .social-links {
    margin-left: 0;
    margin-right: auto;
}

[dir="rtl"] .course-stats {
    text-align: center;
}

[dir="rtl"] .stats-container {
    flex-direction: row;
}

[dir="rtl"] .enrollment-dialog .dialog-content {
    text-align: right;
}

[dir="rtl"] .form-group label {
    text-align: right;
}

[dir="rtl"] .form-note {
    text-align: right;
}

[dir="rtl"] .form-actions {
    flex-direction: row-reverse;
}

/* Language Toggle Styles */
.language-toggle {
    /* Removed margin-top since it's now in top nav */
}

.lang-btn {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 25px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    min-width: 90px;
    position: relative;
    overflow: hidden;
}

.lang-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
    background: linear-gradient(135deg, #764ba2, #667eea);
}

.lang-btn:active {
    transform: translateY(0);
}

/* Language toggle indicator */
.lang-btn::before {
    content: '🌍';
    margin-right: 8px;
    font-size: 1rem;
}

[dir="rtl"] .lang-btn::before {
    margin-right: 0;
    margin-left: 8px;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Loading and Error States */
.loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 20px;
    text-align: center;
    color: white;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.error-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 20px;
    text-align: center;
    color: white;
}

.error-state i {
    font-size: 4rem;
    color: #ff6b6b;
    margin-bottom: 20px;
}

.error-state h3 {
    font-size: 2rem;
    margin-bottom: 15px;
    color: white;
}

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

.retry-btn {
    background: linear-gradient(135deg, #ff6b6b, #ee5a52);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(255, 107, 107, 0.3);
}

.retry-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255, 107, 107, 0.4);
}

.no-courses {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 20px;
    text-align: center;
    color: white;
    grid-column: 1 / -1;
}

.no-courses i {
    font-size: 4rem;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 20px;
}

.no-courses h3 {
    font-size: 2rem;
    margin-bottom: 15px;
    color: white;
}

.no-courses p {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* Header Styles */
.header {
    text-align: center;
    padding: 0 0 60px;
    position: relative;
}

.header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 200px;
    height: 4px;
    background: linear-gradient(90deg, #ff6b6b, #4ecdc4, #45b7d1, #96ceb4);
    border-radius: 2px;
}

/* Top Navigation Bar */
.top-nav {
    background: rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: all 0.3s ease;
}

.top-nav:hover {
    background: rgba(0, 0, 0, 0.15);
    border-bottom-color: rgba(255, 255, 255, 0.2);
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.top-social-links {
    display: flex;
    gap: 15px;
}

.top-social-links .social-link {
    width: 35px;
    height: 35px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    text-decoration: none;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    font-size: 0.9rem;
}

.top-social-links .social-link:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.header-content {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 40px 0 20px;
    animation: fadeInDown 0.8s ease-out;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.main-title {
    font-family: 'Playfair Display', serif;
    font-size: 4rem;
    font-weight: 700;
    margin-bottom: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 4px 8px rgba(0,0,0,0.1);
}
.main-title img{ 
    object-fit: cover;
}

.title-accent {
    display: block;
    font-size: 2.5rem;
    color: #ff6b6b;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.1);
}

.subtitle {
    font-size: 1.3rem;
    color: #fff;
    font-weight: 300;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
    letter-spacing: 1px;
}

/* Courses Section */
.courses-section {
    padding: 40px 0;
}

.courses-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
    gap: 30px;
    margin-bottom: 60px;
}

/* Course Card Styles */
.course-card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.course-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #ff6b6b, #4ecdc4, #45b7d1);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.course-card:hover::before {
    transform: scaleX(1);
}

.course-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 30px 60px rgba(0,0,0,0.15);
}

.course-card[data-available="false"] {
    position: relative;
}

.course-card[data-available="false"]::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 107, 107, 0.05);
    border-radius: 20px;
    pointer-events: none;
}

/* Card Header */
.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.course-icon {
    width: 60px;
    height: 60px;
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    color: white;
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
    transition: transform 0.3s ease;
}

.course-icon:hover {
    transform: scale(1.1);
}

/* Course Icon Colors */
.laravel { background: linear-gradient(135deg, #ff2d20, #ff6b6b); }
.react { background: linear-gradient(135deg, #61dafb, #21d4fd); }
.figma { background: linear-gradient(135deg, #f24e1e, #ff6b35); }
.flutter { background: linear-gradient(135deg, #02569b, #42a5f5); }
.aspnet { background: linear-gradient(135deg, #512bd4, #7c4dff); }
.spring { background: linear-gradient(135deg, #6db33f, #8bc34a); }
.nodejs { background: linear-gradient(135deg, #339933, #4caf50); }
.vuejs { background: linear-gradient(135deg, #4fc08d, #42b883); }
.algorithms { background: linear-gradient(135deg, #9c27b0, #e91e63); }
.web-essentials { background: linear-gradient(135deg, #2196f3, #03a9f4); }
.photoshop { background: linear-gradient(135deg, #31a8ff, #001d35); }
.illustrator { background: linear-gradient(135deg, #ff9a00, #ffb366); }
.angular { background: linear-gradient(135deg, #dd0031, #c3002f); }
.python { background: linear-gradient(135deg, #3776ab, #ffd43b); }
.ai-essentials { background: linear-gradient(135deg, #ff6b6b, #4ecdc4); }
.swift { background: linear-gradient(135deg, #fa7343, #ffb366); }
.kotlin { background: linear-gradient(135deg, #7f52ff, #0095d5); }

.course-level {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.coming-soon-badge {
    background: linear-gradient(135deg, #ff6b6b, #ee5a24);
    color: white;
    padding: 6px 12px;
    border-radius: 15px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 12px rgba(255, 107, 107, 0.3);
    animation: pulse 2s infinite;
}

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

/* Card Content */
.card-content {
    margin-bottom: 25px;
}

.course-title-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    gap: 15px;
}

.course-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.8rem;
    font-weight: 600;
    color: #2c3e50;
    line-height: 1.3;
    flex: 1;
}

.course-duration {
    display: flex;
    align-items: center;
    gap: 6px;
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    color: #495057;
    padding: 8px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    border: 1px solid #dee2e6;
    white-space: nowrap;
    transition: all 0.3s ease;
}

.course-duration:hover {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

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

.course-features {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.feature {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    color: #495057;
    padding: 6px 12px;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 500;
    border: 1px solid #dee2e6;
    transition: all 0.3s ease;
}

.feature:hover {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

/* Card Footer */
.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 20px;
    border-top: 1px solid #e9ecef;
}

.card-actions {
    display: flex;
    gap: 12px;
    align-items: center;
    justify-content: center;
}

.details-btn {
    background: linear-gradient(135deg, #4ecdc4, #44a08d);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 20px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(78, 205, 196, 0.3);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.details-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(78, 205, 196, 0.4);
    background: linear-gradient(135deg, #44a08d, #4ecdc4);
}



.enroll-btn {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 25px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.enroll-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
    background: linear-gradient(135deg, #764ba2, #667eea);
}

.enroll-btn:disabled {
    background: linear-gradient(135deg, #6c757d, #495057);
    cursor: not-allowed;
    opacity: 0.7;
    transform: none;
}

.enroll-btn:disabled:hover {
    transform: none;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    background: linear-gradient(135deg, #6c757d, #495057);
}

.course-duration {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #6c757d;
    font-size: 0.85rem;
    font-weight: 500;
}

.course-duration i {
    color: #667eea;
}

/* Course Stats */
.course-stats {
    padding: 40px 0;
    text-align: center;
}

.stats-container {
    display: flex;
    justify-content: center;
    gap: 40px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    color: white;
    text-align: center;
    width: 8rem
}

.stat-item i {
    font-size: 2rem;
    color: #4ecdc4;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    font-family: 'Playfair Display', serif;
}

.stat-label {
    font-size: 0.9rem;
    opacity: 0.9;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Filter Section */
.filter-section {
    padding: 40px 0;
    text-align: center;
}

.filter-container {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 30px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.filter-title {
    color: white;
    font-size: 1.5rem;
    margin-bottom: 25px;
    font-weight: 600;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.filter-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: center;
}

.filter-btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 12px 24px;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    backdrop-filter: blur(10px);
}

.filter-btn:hover,
.filter-btn.active {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.2);
}

/* Footer */
.footer {
    background: rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 30px 0;
    margin-top: 60px;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.footer-content p {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
}

.social-links {
    display: flex;
    gap: 15px;
}

.social-link {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    text-decoration: none;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.social-link:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.2);
}

/* Responsive Design */
@media (max-width: 1200px) {
    .courses-grid {
        grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
        gap: 25px;
    }
    
    .main-title {
        font-size: 3.5rem;
    }
}

/* Mobile-specific improvements */
@media (max-width: 768px) {
    /* Ensure course cards are visible on mobile */
    .courses-grid {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 20px !important;
        padding: 0 10px !important;
    }
    
    .course-card {
        display: block !important;
        opacity: 1 !important;
        transform: none !important;
        animation: none !important;
        margin-bottom: 20px !important;
    }
    
    /* Improve touch targets */
    .lang-btn, .filter-btn, .enroll-btn, .details-btn {
        min-height: 44px; /* Apple's recommended minimum touch target size */
    }
    
    /* Arabic mobile typography improvements */
    [dir="rtl"] .subtitle {
        font-size: 1.3rem;
        line-height: 1.9;
        letter-spacing: 0.6px;
    }
    
    [dir="rtl"] .stat-label {
        font-size: 1.1rem;
        font-weight: 600;
        line-height: 1.4;
    }
    
    [dir="rtl"] .filter-title {
        font-size: 1.4rem;
        font-weight: 700;
    }
    
    [dir="rtl"] .filter-btn {
        font-size: 1.05rem;
        font-weight: 500;
        padding: 16px 22px;
    }
    
    [dir="rtl"] .course-title {
        font-size: 1.7rem;
        line-height: 1.5;
        font-weight: 700;
    }
    
    [dir="rtl"] .course-description {
        font-size: 0.95rem;
        line-height: 1.9;
        font-weight: 400;
    }
    
    [dir="rtl"] .enroll-btn, 
    [dir="rtl"] .details-btn {
        font-size: 0.95rem;
        font-weight: 600;
        padding: 16px 22px;
    }
    
    /* Better spacing for mobile */
    .course-card {
        margin-bottom: 5px;
    }
    
    /* Improve readability on small screens */
    .course-description {
        font-size: 0.9rem;
        line-height: 1.6;
    }
    
    /* Better mobile navigation */
    .top-nav {
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    }
    
    /* Mobile-optimized stats */
    .stat-item {
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
        transition: transform 0.2s ease;
    }
    
    .stat-item:hover {
        transform: translateY(-2px);
    }
    
    /* Mobile filter improvements */
    .filter-container {
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    }
    
    /* Mobile course card improvements */
    .course-card {
        box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    }
    
    .course-card:hover {
        transform: translateY(-5px);
        box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15);
    }
    
    /* Mobile enrollment dialog improvements */
    .enrollment-dialog .dialog-content {
        width: 95%;
        margin: 20px 10px;
        max-height: 85vh;
    }
    
    .dialog-header {
        padding: 20px 20px 15px;
    }
    
    .dialog-body {
        padding: 20px;
    }
    
    .form-group input {
        padding: 14px 16px;
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    .form-actions {
        flex-direction: column;
        gap: 12px;
    }
    
    .submit-btn, .cancel-btn {
        width: 100%;
        padding: 16px 20px;
        min-height: 48px;
    }
}

/* Extra small mobile optimizations */
@media (max-width: 360px) {
    .container {
        padding: 0 12px;
    }
    
    .main-title img {
        width: 180px !important;
        height: 100px !important;
    }
    
    .subtitle {
        font-size: 1rem;
        padding: 0 10px;
    }
    
    .stat-item {
        min-width: 220px;
        padding: 15px 12px;
    }
    
    .filter-container {
        padding: 18px 12px;
        margin: 0 2px;
    }
    
    .course-card {
        padding: 18px 15px;
        margin: 0 2px;
    }
    
    .course-title {
        font-size: 1.3rem;
    }
    
    .enroll-btn, .details-btn {
        padding: 12px 16px;
        font-size: 0.8rem;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 0 20px;
    }
    
    .header {
        padding: 0 0 30px;
    }
    
    .top-nav {
        padding: 12px 0;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 1001;
        background: rgba(0, 0, 0, 0.2);
        backdrop-filter: blur(15px);
    }
    
    .nav-container {
        padding: 0 20px;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        gap: 0;
    }
    
    .top-social-links {
        order: 0;
        gap: 12px;
    }
    
    .top-social-links .social-link {
        width: 32px;
        height: 32px;
        font-size: 0.8rem;
    }
    
    .header-content {
        padding: 80px 0 30px;
        margin-top: 60px;
    }
    
    .main-title img {
        width: 250px !important;
        height: 150px !important;
    }
    
    .subtitle {
        font-size: 1.2rem;
        padding: 0 20px;
        line-height: 1.5;
    }
    
    .course-stats {
        padding: 30px 0;
    }
    
    .stats-container {
        gap: 25px;
        flex-direction: column;
        align-items: center;
    }
    
    .stat-item {
        flex-direction: row;
        gap: 15px;
        background: rgba(255, 255, 255, 0.1);
        padding: 20px;
        border-radius: 15px;
        backdrop-filter: blur(10px);
        border: 1px solid rgba(255, 255, 255, 0.2);
        min-width: 280px;
    }
    
    .stat-item i {
        font-size: 2.5rem;
        margin: 0;
    }
    
    .stat-number {
        font-size: 2.2rem;
        margin: 0;
    }
    
    .stat-label {
        font-size: 1rem;
        margin: 0;
        text-align: left;
    }
    
    .filter-section {
        padding: 30px 0;
    }
    
    .filter-container {
        padding: 25px 20px;
        margin: 0 10px;
    }
    
    .filter-title {
        font-size: 1.3rem;
        margin-bottom: 20px;
    }
    
    .filter-buttons {
        flex-direction: column;
        align-items: center;
        gap: 12px;
    }
    
    .filter-btn {
        width: 100%;
        max-width: 300px;
        padding: 15px 20px;
        font-size: 1rem;
    }
    
    .courses-section {
        padding: 30px 0;
    }
    
    .courses-grid {
        grid-template-columns: 1fr;
        gap: 25px;
        padding: 0 10px;
    }
    
    .course-card {
        padding: 25px 20px;
        margin: 0 5px;
    }
    
    .course-title {
        font-size: 1.6rem;
        line-height: 1.3;
    }
    
    .course-description {
        font-size: 0.9rem;
        line-height: 1.5;
    }
    
    .card-actions {
        flex-direction: column;
        gap: 12px;
        width: 100%;
    }
    
    .enroll-btn, .details-btn {
        width: 100%;
        padding: 15px 20px;
        font-size: 0.9rem;
        justify-content: center;
    }
    
    .footer {
        margin-top: 40px;
        padding: 25px 0;
    }
    
    .footer-content {
        flex-direction: column;
        text-align: center;
        gap: 20px;
    }
    
    .social-links {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }
    
    /* Arabic small mobile typography improvements */
    [dir="rtl"] .subtitle {
        font-size: 1.2rem;
        line-height: 1.8;
        letter-spacing: 0.5px;
    }
    
    [dir="rtl"] .stat-label {
        font-size: 1rem;
        font-weight: 600;
        line-height: 1.3;
    }
    
    [dir="rtl"] .filter-title {
        font-size: 1.3rem;
        font-weight: 700;
    }
    
    [dir="rtl"] .filter-btn {
        font-size: 1rem;
        font-weight: 500;
        padding: 15px 20px;
    }
    
    [dir="rtl"] .course-title {
        font-size: 1.5rem;
        line-height: 1.4;
        font-weight: 700;
    }
    
    [dir="rtl"] .course-description {
        font-size: 0.9rem;
        line-height: 1.8;
        font-weight: 400;
    }
    
    [dir="rtl"] .enroll-btn, 
    [dir="rtl"] .details-btn {
        font-size: 0.9rem;
        font-weight: 600;
        padding: 15px 20px;
    }
    
    .top-nav {
        padding: 10px 0;
    }
    
    .nav-container {
        padding: 0 15px;
        gap: 15px;
    }
    
    .lang-btn {
        padding: 12px 18px;
        font-size: 0.85rem;
        min-width: 85px;
    }
    
    .top-social-links {
        gap: 10px;
    }
    
    .top-social-links .social-link {
        width: 28px;
        height: 28px;
        font-size: 0.75rem;
    }
    
    .header-content {
        padding: 70px 0 25px;
        margin-top: 50px;
    }
    
    .main-title img {
        width: 200px !important;
        height: 120px !important;
    }
    
    .subtitle {
        font-size: 1.1rem;
        padding: 0 15px;
        line-height: 1.4;
    }
    
    .course-stats {
        padding: 25px 0;
    }
    
    .stats-container {
        gap: 20px;
    }
    
    .stat-item {
        min-width: 250px;
        padding: 18px 15px;
        gap: 12px;
    }
    
    .stat-item i {
        font-size: 2.2rem;
    }
    
    .stat-number {
        font-size: 2rem;
    }
    
    .stat-label {
        font-size: 0.9rem;
    }
    
    .filter-section {
        padding: 25px 0;
    }
    
    .filter-container {
        padding: 20px 15px;
        margin: 0 5px;
    }
    
    .filter-title {
        font-size: 1.2rem;
        margin-bottom: 18px;
    }
    
    .filter-buttons {
        gap: 10px;
    }
    
    .filter-btn {
        max-width: 280px;
        padding: 14px 18px;
        font-size: 0.95rem;
    }
    
    .courses-section {
        padding: 25px 0;
    }
    
    .courses-grid {
        gap: 20px;
        padding: 0 5px;
    }
    
    .course-card {
        padding: 20px 18px;
        margin: 0 3px;
        border-radius: 18px;
    }
    
    .card-header {
        margin-bottom: 20px;
    }
    
    .course-icon {
        width: 50px;
        height: 50px;
        font-size: 1.4rem;
    }
    
    .course-level {
        padding: 6px 12px;
        font-size: 0.75rem;
    }
    
    .coming-soon-badge {
        font-size: 0.65rem;
        padding: 4px 8px;
    }
    
    .course-title {
        font-size: 1.4rem;
        line-height: 1.3;
    }
    
    .course-description {
        font-size: 0.85rem;
        line-height: 1.5;
        margin-bottom: 18px;
    }
    
    .course-features {
        gap: 6px;
        margin-bottom: 20px;
    }
    
    .feature {
        padding: 5px 10px;
        font-size: 0.75rem;
    }
    
    .card-actions {
        gap: 10px;
        width: 100%;
    }
    
    .enroll-btn, .details-btn {
        padding: 14px 18px;
        font-size: 0.85rem;
        border-radius: 20px;
    }
    
    .footer {
        margin-top: 30px;
        padding: 20px 0;
    }
    
    .footer-content {
        gap: 15px;
    }
    
    .footer-content p {
        font-size: 0.85rem;
    }
    
    .social-links {
        gap: 12px;
    }
    
    .social-link {
        width: 35px;
        height: 35px;
        font-size: 0.9rem;
    }
}

/* Animation Classes */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.course-card {
    animation: fadeInUp 0.6s ease forwards;
}

.course-card:nth-child(1) { animation-delay: 0.1s; }
.course-card:nth-child(2) { animation-delay: 0.2s; }
.course-card:nth-child(3) { animation-delay: 0.3s; }
.course-card:nth-child(4) { animation-delay: 0.4s; }
.course-card:nth-child(5) { animation-delay: 0.5s; }
.course-card:nth-child(6) { animation-delay: 0.6s; }
.course-card:nth-child(7) { animation-delay: 0.7s; }
.course-card:nth-child(8) { animation-delay: 0.8s; }
.course-card:nth-child(9) { animation-delay: 0.9s; }
.course-card:nth-child(10) { animation-delay: 1s; }

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Mobile performance optimizations */
@media (max-width: 768px) {
    /* Ensure course cards are always visible on mobile */
    .courses-grid {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 20px !important;
        padding: 0 10px !important;
        min-height: 200px !important;
    }
    
    .course-card {
        display: block !important;
        opacity: 1 !important;
        transform: none !important;
        animation: none !important;
        margin-bottom: 20px !important;
        transition: transform 0.2s ease, box-shadow 0.2s ease;
    }
    
    .course-card:nth-child(1),
    .course-card:nth-child(2),
    .course-card:nth-child(3),
    .course-card:nth-child(4),
    .course-card:nth-child(5),
    .course-card:nth-child(6),
    .course-card:nth-child(7),
    .course-card:nth-child(8),
    .course-card:nth-child(9),
    .course-card:nth-child(10) {
        animation-delay: 0s;
    }
    
    /* Optimize header animation for mobile */
    .header-content {
        animation: fadeInDown 0.5s ease-out;
    }
    
    /* Better mobile scrolling */
    .courses-grid {
        -webkit-overflow-scrolling: touch;
    }
    
    /* Mobile-friendly hover states */
    .course-card:hover {
        transform: translateY(-3px);
    }
    
    .stat-item:hover {
        transform: translateY(-1px);
    }
    
    .filter-btn:hover {
        transform: translateY(-1px);
    }
    
    /* Ensure loading and error states are visible on mobile */
    .loading-state,
    .error-state,
    .no-courses {
        display: flex !important;
        opacity: 1 !important;
        transform: none !important;
        min-height: 200px !important;
    }
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #764ba2, #667eea);
}

/* Enrollment Dialog Styles */
.enrollment-dialog {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2000;
    display: none;
}

.enrollment-dialog.active {
    display: block;
}

.dialog-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
}

.dialog-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    border-radius: 20px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3);
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    animation: dialogSlideIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes dialogSlideIn {
    from {
        opacity: 0;
        transform: translate(-50%, -60%);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

.dialog-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 25px 30px 20px;
    border-bottom: 1px solid #e1e5e9;
}

.dialog-header h2 {
    font-family: 'Playfair Display', serif;
    font-size: 1.8rem;
    color: #333;
    margin: 0;
}

.close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #666;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: all 0.3s ease;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-btn:hover {
    background: #f0f0f0;
    color: #333;
}

.dialog-body {
    padding: 30px;
}

.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
    font-size: 0.95rem;
}

.form-group input {
    width: 100%;
    padding: 15px 18px;
    border: 2px solid #e1e5e9;
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: #fafbfc;
}

.form-group input:focus {
    outline: none;
    border-color: #667eea;
    background: white;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-group input::placeholder {
    color: #999;
}

.form-note {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    padding: 20px;
    border-radius: 15px;
    margin-bottom: 30px;
    display: flex;
    align-items: flex-start;
    gap: 15px;
}

.form-note i {
    font-size: 1.2rem;
    margin-top: 2px;
    flex-shrink: 0;
}

.form-note p {
    margin: 0;
    line-height: 1.6;
    font-size: 0.95rem;
}

.form-actions {
    display: flex;
    gap: 15px;
    justify-content: flex-end;
}

.submit-btn, .cancel-btn {
    padding: 15px 30px;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 120px;
}

.submit-btn {
    background: linear-gradient(135deg, #4ecdc4, #44a08d);
    color: white;
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(78, 205, 196, 0.4);
}

.cancel-btn {
    background: #f0f0f0;
    color: #666;
}

.cancel-btn:hover {
    background: #e0e0e0;
    color: #333;
}

/* Responsive Dialog */
@media (max-width: 600px) {
    .dialog-content {
        width: 95%;
        margin: 20px;
    }
    
    .dialog-header {
        padding: 20px 25px 15px;
    }
    
    .dialog-body {
        padding: 25px;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .submit-btn, .cancel-btn {
        width: 100%;
    }
}
