:root {
    --primary-dark: #0a192f;
    --primary-medium: #112240;
    --primary-light: #233554;
    --accent-color: #64ffda;
    --text-primary: #e6f1ff;
    --text-secondary: #a8b2d1;
    --success: #64ffda;
    --warning: #ffd166;
    --error: #ef476f;
}

body {
    font-family: 'Tajawal', sans-serif;
    background-color: var(--primary-dark);
    color: var(--text-primary);
    overflow-x: hidden;
    position: relative;
    transition: all 0.3s ease;
}

body[dir="rtl"] {
    font-family: 'Tajawal', sans-serif;
    text-align: right;
}

body[dir="ltr"] {
    font-family: 'Inter', sans-serif;
    text-align: left;
}

/* Navigation */
header {
    background: rgba(10, 25, 47, 0.9);
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    border-bottom: 1px solid rgba(100, 255, 218, 0.1);
}

.nav-link {
    position: relative;
    padding: 8px 0;
    margin: 0 20px;
    transition: color 0.3s ease;
}

.nav-link:after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent-color);
    transition: width 0.3s ease;
}

.nav-link:hover {
    color: var(--accent-color);
}

.nav-link:hover:after {
    width: 100%;
}

/* Cards */
.card {
    background: linear-gradient(145deg, var(--primary-medium), var(--primary-light));
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid rgba(100, 255, 218, 0.1);
    transition: all 0.3s ease;
    position: relative;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3);
    border-color: rgba(100, 255, 218, 0.3);
}

.card::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, var(--accent-color), transparent);
    z-index: -1;
    border-radius: 18px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

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

/* Buttons */
.btn-primary {
    background: linear-gradient(45deg, var(--accent-color), #0ad8a5);
    color: var(--primary-dark);
    font-weight: bold;
    padding: 12px 28px;
    border-radius: 50px;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(100, 255, 218, 0.3);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(100, 255, 218, 0.4);
}

.btn-primary:after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.1);
    transform: translateX(-100%);
    transition: transform 0.3s ease;
}

.btn-primary:hover:after {
    transform: translateX(0);
}

.btn-outline {
    background: transparent;
    color: var(--accent-color);
    border: 2px solid var(--accent-color);
    font-weight: bold;
    padding: 10px 26px;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-outline:hover {
    background: rgba(100, 255, 218, 0.1);
}

/* Sections */
.section-title {
    position: relative;
    display: inline-block;
    padding-bottom: 15px;
    margin-bottom: 40px;
}

.section-title:after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 60px;
    height: 3px;
    background: var(--accent-color);
    border-radius: 3px;
}

body[dir="rtl"] .section-title:after {
    left: 0;
    right: auto;
}

body[dir="ltr"] .section-title:after {
    left: auto;
    right: 0;
}

/* Background elements */
.bg-pattern {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.03;
    background-image: 
        radial-gradient(circle at 10% 20%, var(--accent-color) 0%, transparent 20%),
        radial-gradient(circle at 90% 80%, var(--accent-color) 0%, transparent 20%),
        radial-gradient(circle at 50% 50%, var(--accent-color) 0%, transparent 30%);
    background-size: 400px 400px;
    z-index: -1;
}

/* Animations */
@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
    100% { transform: translateY(0px); }
}

.floating-element {
    animation: float 4s ease-in-out infinite;
}

.code-block {
    background: rgba(10, 25, 47, 0.8);
    border-radius: 12px;
    padding: 20px;
    overflow-x: auto;
    border: 1px solid rgba(100, 255, 218, 0.1);
    direction: ltr;
    text-align: left;
    font-family: 'Courier New', monospace;
    font-size: 15px;
    line-height: 1.6;
    position: relative;
}

.copy-code-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(100, 255, 218, 0.1);
    color: var(--accent-color);
    border: 1px solid var(--accent-color);
    border-radius: 4px;
    padding: 6px 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10;
    backdrop-filter: blur(5px);
}

.copy-code-btn:hover {
    background: var(--accent-color);
    color: var(--primary-dark);
}

/* MODIFIED: Improved code editor styling */
.code-editor-container {
    border: 1px solid rgba(100, 255, 218, 0.2);
    border-radius: 12px;
    overflow: hidden;
    position: relative;
}

#code-editor {
    font-family: 'Courier New', monospace;
    resize: none;
    border: none;
    outline: none;
    min-height: 200px;
    padding: 16px;
    background: var(--primary-light);
    color: var(--text-primary);
    width: 100%;
    box-sizing: border-box;
    line-height: 1.5;
}

/* MODIFIED: Additional styling for new sections */
#level-theory, #level-examples {
    white-space: pre-line;
    line-height: 1.8;
}

#level-common-errors li {
    padding: 8px 0;
    border-bottom: 1px solid rgba(100, 255, 218, 0.1);
}

#level-common-errors li:last-child {
    border-bottom: none;
}

/* MODIFIED: Responsive improvements */
@media (max-width: 768px) {
    .copy-code-btn {
        top: 5px;
        right: 5px;
        padding: 4px 8px;
        font-size: 12px;
    }
    
    .code-block {
        padding: 15px 15px 15px 15px;
        font-size: 13px;
    }
    
    #level-theory, #level-examples {
        font-size: 14px;
    }
}

.java-keyword {
    color: #ff79c6;
}

.java-comment {
    color: #6272a4;
}

.java-string {
    color: #f1fa8c;
}

.java-number {
    color: #bd93f9;
}

/* Progress bars */
.progress-container {
    background: rgba(100, 255, 218, 0.1);
    border-radius: 10px;
    height: 10px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: var(--accent-color);
    border-radius: 10px;
    transition: width 0.4s ease;
}

/* Mobile menu */
.mobile-menu {
    background: rgba(10, 25, 47, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.3);
    transform: translateX(100%);
    transition: transform 0.3s ease-in-out;
}

.mobile-menu.open {
    transform: translateX(0);
}

body[dir="rtl"] .mobile-menu {
    right: 0;
    left: auto;
}

body[dir="ltr"] .mobile-menu {
    right: auto;
    left: 0;
    transform: translateX(-100%);
}

body[dir="ltr"] .mobile-menu.open {
    transform: translateX(0);
}

/* Hero section */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(100, 255, 218, 0.05) 0%, transparent 70%);
    z-index: -1;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .section-title:after {
        left: 50%;
        transform: translateX(-50%);
    }
    
    .nav-links {
        display: none;
    }
    
    .menu-toggle {
        display: block;
    }
    
    /* Mobile-specific adjustments */
    .hero .grid {
        grid-template-columns: 1fr;
    }
    
    .profile-img-container {
        width: 150px;
        height: 150px;
    }
    
    .level-card {
        height: auto;
    }
    
    .nav-link {
        margin: 0 15px;
    }
    
    .language-switcher {
        top: 90px;
        left: 15px;
    }
    
    .lang-btn {
        padding: 6px 12px;
        font-size: 14px;
    }
}

/* Footer */
footer {
    background: rgba(10, 25, 47, 0.8);
    border-top: 1px solid rgba(100, 255, 218, 0.1);
}

/* Floating particles */
.particle {
    position: absolute;
    border-radius: 50%;
    background: rgba(100, 255, 218, 0.1);
    box-shadow: 0 0 15px rgba(100, 255, 218, 0.1);
    animation: float 15s infinite ease-in-out;
}

/* Level cards */
.level-card {
    height: 280px;
    perspective: 1000px;
}

.level-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.8s;
    transform-style: preserve-3d;
}

.level-card:hover .level-card-inner {
    transform: rotateY(180deg);
}

.level-card-front, .level-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 30px;
}

.level-card-front {
    background: linear-gradient(135deg, var(--primary-medium), var(--primary-light));
}

.level-card-back {
    background: linear-gradient(135deg, var(--primary-light), var(--primary-medium));
    transform: rotateY(180deg);
    color: var(--text-primary);
    text-align: center;
}

/* Java logo styling */
.java-logo {
    color: #f89820;
    text-shadow: 0 0 10px rgba(248, 152, 32, 0.5);
}

/* Feature icons */
.feature-icon {
    font-size: 48px;
    color: var(--accent-color);
    margin-bottom: 20px;
}

/* Transition effects */
.transition-all {
    transition: all 0.3s ease;
}

/* Hover effects */
.hover-grow:hover {
    transform: scale(1.05);
}

/* Resource cards */
.resource-card {
    transition: all 0.3s ease;
    border-left: 4px solid var(--accent-color);
}

.resource-card:hover {
    transform: translateY(-5px);
    background: rgba(100, 255, 218, 0.05);
}

/* Quiz options */
.quiz-option {
    background-color: rgba(100, 255, 218, 0.05);
    border: 2px solid rgba(100, 255, 218, 0.1);
    color: var(--text-primary);
    transition: all 0.3s ease;
    padding: 20px;
    border-radius: 12px;
    text-align: center;
    cursor: pointer;
    font-size: 18px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100px;
}

.quiz-option:hover {
    background-color: rgba(100, 255, 218, 0.1);
    border-color: var(--accent-color);
}

.quiz-option.selected {
    background-color: rgba(100, 255, 218, 0.1);
    border-color: var(--accent-color);
    box-shadow: 0 0 0 2px var(--accent-color);
}

.quiz-option.correct {
    background-color: rgba(100, 255, 218, 0.2);
    border-color: var(--accent-color);
}

.quiz-option.incorrect {
    background-color: rgba(239, 71, 111, 0.2);
    border-color: var(--error);
}

/* Profile image */
.profile-img-container {
    position: relative;
    width: 200px;
    height: 200px;
    margin: 0 auto 40px;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid var(--accent-color);
    box-shadow: 0 0 30px rgba(100, 255, 218, 0.3);
}

.profile-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Video container */
.video-container {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    height: 0;
    overflow: hidden;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* Social buttons */
.social-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 25px;
    border-radius: 50px;
    font-weight: bold;
    transition: all 0.3s ease;
}

.social-btn i {
    margin-right: 10px;
    transition: transform 0.3s ease;
}

.social-btn:hover i {
    transform: scale(1.2);
}

.instagram-btn {
    background: linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888);
    color: white;
}

.instagram-btn:hover {
    background: linear-gradient(45deg, #d8812a, #d0552a, #c61f37, #b61d59, #a51475);
    box-shadow: 0 0 15px rgba(220, 39, 67, 0.5);
}

.whatsapp-btn {
    background-color: #25D366;
    color: white;
}

.whatsapp-btn:hover {
    background-color: #128C7E;
    box-shadow: 0 0 15px rgba(37, 211, 102, 0.5);
}

/* Page transitions */
.page {
    display: none;
    animation: fadeIn 0.5s ease-in-out;
}

.page.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Level details */
.level-detail {
    padding: 2rem;
    background: rgba(17, 34, 64, 0.7);
    border-radius: 16px;
    margin-top: 2rem;
    border: 1px solid rgba(100, 255, 218, 0.2);
}

/* Quiz styling */
.quiz-container {
    background: rgba(17, 34, 64, 0.7);
    border-radius: 16px;
    padding: 2rem;
    margin-top: 2rem;
}

/* Popup styling */
#desktop-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(5px);
}

.popup-content {
    background: var(--primary-medium);
    border-radius: 16px;
    padding: 30px;
    max-width: 500px;
    width: 90%;
    text-align: center;
    position: relative;
    border: 2px solid var(--accent-color);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.popup-close {
    position: absolute;
    top: 15px;
    left: 15px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 24px;
    cursor: pointer;
    transition: all 0.3s;
}

body[dir="rtl"] .popup-close {
    left: 15px;
    right: auto;
}

body[dir="ltr"] .popup-close {
    left: auto;
    right: 15px;
}

.popup-close:hover {
    color: var(--accent-color);
    transform: rotate(90deg);
}

.popup-title {
    font-size: 24px;
    color: var(--accent-color);
    margin-bottom: 15px;
}

.popup-message {
    font-size: 18px;
    margin-bottom: 25px;
    line-height: 1.6;
}

.popup-icon {
    font-size: 48px;
    color: var(--accent-color);
    margin-bottom: 20px;
}

/* Language Switcher */
.language-switcher {
    position: fixed;
    top: 100px;
    left: 20px;
    z-index: 100;
}

body[dir="rtl"] .language-switcher {
    left: 20px;
    right: auto;
}

body[dir="ltr"] .language-switcher {
    left: auto;
    right: 20px;
}

.lang-btn {
    background: rgba(10, 25, 47, 0.8);
    color: var(--accent-color);
    border: 2px solid var(--accent-color);
    border-radius: 50px;
    padding: 8px 15px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.lang-btn:hover {
    background: rgba(100, 255, 218, 0.1);
}

.lang-text {
    font-weight: bold;
}

/* Fade-in animation for scroll */
.fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Improved back to top button */
#back-to-top {
    background: var(--accent-color);
    color: var(--primary-dark);
    z-index: 99;
    box-shadow: 0 4px 15px rgba(100, 255, 218, 0.4);
}

#back-to-top:hover {
    background: #4fd8b8;
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(100, 255, 218, 0.6);
}

/* Form elements */
input, textarea {
    transition: all 0.3s ease;
}

input:focus, textarea:focus {
    box-shadow: 0 0 0 2px var(--accent-color);
}

/* FAQ section improvements */
.faq-header {
    transition: all 0.3s ease;
}

.faq-header:hover {
    background: rgba(100, 255, 218, 0.05);
}

.faq-content {
    transition: all 0.3s ease;
}

/* Code editor styling */
.code-editor-container {
    border: 1px solid rgba(100, 255, 218, 0.2);
    border-radius: 12px;
    overflow: hidden;
}

#code-editor {
    font-family: 'Courier New', monospace;
    resize: none;
    border: none;
    outline: none;
    min-height: 200px;
    padding: 16px;
    background: var(--primary-light);
    color: var(--text-primary);
    width: 100%;
    box-sizing: border-box;
}

#code-editor:focus {
    outline: none;
    box-shadow: 0 0 0 2px var(--accent-color);
}

/* Color utilities */
.text-success {
    color: var(--success);
}

.text-warning {
    color: var(--warning);
}

.text-error {
    color: var(--error);
}

/* Mobile-specific styles */
@media (max-width: 768px) {
    .mobile-menu {
        width: 100%;
    }
    
    .hero {
        padding-top: 100px;
        min-height: auto;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .nav-link {
        font-size: 18px;
    }
}

/* Level card spacing improvements */
.level-card-front, .level-card-back {
    padding: 20px;
}

.level-card-front .text-4xl {
    margin-bottom: 15px;
}

.level-card-front h3 {
    margin-bottom: 10px;
}

.level-card-back h4 {
    margin-bottom: 15px;
}

.level-card-back p {
    margin-bottom: 20px;
}

/* Improved text alignment for English */
body[dir="ltr"] .level-card-front,
body[dir="ltr"] .level-card-back {
    text-align: center;
}

body[dir="ltr"] .nav-link {
    margin: 0 15px;
}

/* Better spacing for level cards */
.level-card {
    margin-bottom: 20px;
}

    /* MODIFIED: Make buttons stack on small screens */
    .hero .flex-col.sm\\:flex-row {
        flex-direction: column;
    }

    /* MODIFIED: Adjust testimonials layout */
    .card .flex-col.sm\\:flex-row {
        flex-direction: column;
        text-align: center;
    }
    .card .mr-3 {
        margin-right: 0;
        margin-top: 8px;
    }
    
    /* MODIFIED: Adjust button spacing in code editor */
    .code-editor-container .flex-col {
        flex-direction: column;
    }


@media (max-width: 480px) {
    .hero h1 {
        font-size: 2rem;
    }
    
    .section-title {
        font-size: 1.8rem;
    }
    
    .card {
        padding: 1rem;
    }
    
    .level-card {
        height: 240px;
    }
    
    .feature-icon {
        font-size: 30px;
    }
    
    .profile-img-container {
        width: 150px;
        height: 150px;
    }
}
/* MODIFIED: Improved mobile responsiveness */
@media (max-width: 768px) {
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    .hero h1 {
        font-size: 2.5rem;
    }
    
    .card {
        padding: 1.5rem;
    }
    
    .level-card {
        height: auto;
        margin-bottom: 1.5rem;
    }
    
    .level-card-inner {
        transform: none !important;
        height: auto;
    }
    
    .level-card-front, .level-card-back {
        position: relative;
        height: auto;
        padding: 1.5rem;
    }
    
    .level-card-back {
        transform: none;
        display: none;
    }
    
    .level-card:hover .level-card-back {
        display: flex;
    }
    
    .grid-cols-1.md\:grid-cols-3 {
        grid-template-columns: 1fr;
    }
    
    .grid-cols-2.md\:grid-cols-4 {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
    
    .grid-cols-1.lg\:grid-cols-2 {
        grid-template-columns: 1fr;
    }
    
    .nav-link {
        margin: 0 0.5rem;
        font-size: 0.9rem;
    }
    
    .btn-primary, .btn-outline {
        padding: 0.75rem 1.5rem;
        font-size: 0.9rem;
        width: 100%;
        margin-bottom: 0.5rem;
    }
    
    .hero .flex-col.sm\:flex-row {
        flex-direction: column;
    }
    
    .code-block {
        font-size: 0.8rem;
        padding: 1rem;
    }
    
    .mobile-menu {
        width: 100%;
        right: 0;
    }
    
    .language-switcher {
        top: 70px;
        left: 10px;
    }
    
    .profile-img-container {
        width: 150px;
        height: 150px;
    }
    
    /* MODIFIED: Improve touch targets for mobile */
    .quiz-option {
        min-height: 60px;
        padding: 1rem;
        font-size: 1rem;
    }
    
    input, textarea, select {
        font-size: 16px; /* Prevents zoom on iOS */
    }
}

/* MODIFIED: Additional mobile adjustments for very small screens */
@media (max-width: 480px) {
    .hero h1 {
        font-size: 2rem;
    }
    
    .section-title {
        font-size: 1.8rem;
    }
    
    .grid-cols-2.md\:grid-cols-4 {
        grid-template-columns: 1fr;
    }
    
    .card {
        padding: 1rem;
    }
    
    .feature-icon {
        font-size: 2rem;
    }
    
    .text-4xl {
        font-size: 1.875rem;
    }
    
    .text-3xl {
        font-size: 1.5rem;
    }
    
    .text-2xl {
        font-size: 1.25rem;
    }
}
/* أنماط خاصة للمستويين 9 و10 */
#special-layout .code-block,
#normal-layout .code-block {
    background: rgba(10, 25, 47, 0.8);
    border-radius: 12px;
    padding: 20px;
    overflow-x: auto;
    border: 1px solid rgba(100, 255, 218, 0.1);
    direction: ltr;
    text-align: left;
    font-family: 'Courier New', monospace;
    font-size: 15px;
    line-height: 1.6;
    position: relative;
    min-height: 200px;
}

#special-layout .code-editor-container {
    border: 1px solid rgba(100, 255, 218, 0.2);
    border-radius: 12px;
    overflow: hidden;
    position: relative;
}

#special-layout #code-editor {
    font-family: 'Courier New', monospace;
    resize: none;
    border: none;
    outline: none;
    min-height: 200px;
    padding: 16px;
    background: var(--primary-light);
    color: var(--text-primary);
    width: 100%;
    box-sizing: border-box;
    line-height: 1.5;
}

#special-layout #code-editor:focus {
    outline: none;
    box-shadow: 0 0 0 2px var(--accent-color);
}

/* تحسين التنسيق للشاشات الصغيرة */
@media (max-width: 768px) {
    #special-layout .grid-cols-1.lg\:grid-cols-2 {
        grid-template-columns: 1fr;
    }
    
    #special-layout .code-block,
    #normal-layout .code-block {
        font-size: 12px;
        padding: 15px;
    }
}

/* تحسينات للصفحة الرئيسية على الشاشات الصغيرة */
@media (max-width: 768px) {
  /* تحسين حجم النصوص */
  .hero h1 {
    font-size: 2rem !important;
    line-height: 1.3;
    margin-bottom: 1rem;
  }
  
  .hero p {
    font-size: 1.1rem !important;
    line-height: 1.5;
    margin-bottom: 2rem;
  }
  
  /* تحسين الأزرار */
  .hero .flex-col {
    gap: 1rem;
  }
  
  .hero .btn-primary,
  .hero .btn-outline {
    width: 100%;
    padding: 1rem 1.5rem;
    font-size: 1.1rem;
    text-align: center;
    justify-content: center;
  }
  
  /* تحسين بلوك الكود */
  .hero .code-block {
    max-width: 100%;
    overflow-x: auto;
    font-size: 0.8rem;
    padding: 1rem;
    margin: 0;
  }
  
  .hero .code-block pre {
    min-width: min-content;
    white-space: pre;
  }
  
  /* تحسين التباعد العام */
  .hero .grid {
    gap: 2rem;
  }
  
  .hero > .container {
    padding-top: 1rem;
    padding-bottom: 2rem;
  }
  
  /* تحسين العناصر العائمة */
  .hero .absolute {
    display: none; /* إخفاء العناصر العائمة على الهواتف */
  }
}

/* تحسينات إضافية للشاشات الصغيرة جداً */
@media (max-width: 480px) {
  .hero h1 {
    font-size: 1.8rem !important;
  }
  
  .hero p {
    font-size: 1rem !important;
  }
  
  .hero .btn-primary,
  .hero .btn-outline {
    padding: 0.9rem 1.2rem;
    font-size: 1rem;
  }
  
  .hero .code-block {
    font-size: 0.7rem;
  }
}

/* ========================================= */
/* === MOBILE RESPONSIVENESS ENHANCEMENTS === */
/* ========================================= */

/* أضف هذا الكود بالكامل في نهاية ملف style.css */

@media (max-width: 768px) {

    /* --- General Layout & Typography --- */
    body {
        -webkit-text-size-adjust: 100%; /* Prevent font scaling in landscape on iOS */
    }

    .section-title {
        font-size: 2rem; /* تصغير حجم عناوين الأقسام */
        margin-bottom: 2rem;
    }

    h3 {
        font-size: 1.25rem; /* تعديل حجم عناوين h3 */
    }

    p, li, a {
        font-size: 0.95rem; /* تعديل حجم نصوص الفقرات والقوائم */
        line-height: 1.6;
    }

    /* --- Header & Navigation --- */
    .pt-20 {
        padding-top: 5rem; /* تقليل المساحة العلوية تحت الهيدر */
    }

    /* --- Hero Section --- */
    .hero {
        padding-top: 1rem;
        padding-bottom: 2rem;
        min-height: auto; /* إلغاء الارتفاع الثابت ليتناسب مع المحتوى */
        text-align: center; /* توسيط النص */
    }

    .hero h1 {
        font-size: 2.5rem !important; /* تصغير حجم العنوان الرئيسي */
        line-height: 1.3;
    }

    .hero p {
        font-size: 1.1rem !important;
        margin-bottom: 1.5rem;
    }

    .hero .lg\:text-right {
        text-align: center !important; /* ضمان توسيط النص */
    }
    
    .hero .lg\:justify-end {
        justify-content: center !important; /* توسيط الأزرار */
    }

    .hero .code-block {
        padding: 0.75rem;
        font-size: 0.75rem; /* تصغير خط الكود ليناسب الشاشة */
    }

    /* --- Level Cards (Mobile-Friendly Redesign) --- */
    /* إلغاء تأثير القلب (Flip) على الهواتف لأنه غير عملي باللمس */
    .level-card {
        height: auto;
        perspective: none;
    }

    .level-card-inner {
        transform: none !important;
        position: relative;
        height: auto;
        transition: none;
        display: block;
        background: linear-gradient(145deg, var(--primary-medium), var(--primary-light));
        border-radius: 16px;
        border: 1px solid rgba(100, 255, 218, 0.1);
    }
    
    .level-card:hover .level-card-inner {
        transform: none !important;
    }

    .level-card-front, .level-card-back {
        position: relative;
        transform: none;
        -webkit-backface-visibility: visible;
        backface-visibility: visible;
        display: flex;
        background: none;
    }
    
    /* إخفاء الجزء الأمامي (الأيقونة والعنوان) لأنه أقل أهمية */
    .level-card-front {
        display: none;
    }

    /* إظهار الجزء الخلفي (الوصف والزر) دائماً لأنه يحتوي على المعلومات المهمة */
    .level-card-back {
        display: flex;
        border-radius: 16px;
        padding: 1.5rem;
    }

    /* --- Buttons --- */
    /* جعل الأزرار بعرض الشاشة الكاملة لتسهيل النقر */
    .btn-primary, .btn-outline {
        width: 100%;
        text-align: center;
        display: block;
        padding: 0.9rem 1rem;
    }
    
    .hero .flex-col.sm\:flex-row {
        flex-direction: column;
        gap: 0.75rem; /* إضافة مسافة بين الأزرار المكدسة */
    }

    /* --- Code Editor (Levels 9 & 10) --- */
    /* ترتيب أزرار محرر الكود بشكل عمودي */
    #code-editor-section .sm\:flex-row {
        flex-direction: column;
        align-items: stretch;
    }
    
    #code-editor-section .sm\:flex-row .flex-wrap {
        flex-direction: column;
    }

    #code-editor-section button {
        width: 100%;
        margin-bottom: 0.5rem;
    }
    
    #code-editor-section button:last-child {
        margin-bottom: 0;
    }

    /* --- Testimonials --- */
    /* تكديس معلومات صاحب التقييم بشكل عمودي */
    .card .sm\:flex-row {
        flex-direction: column;
        text-align: center;
    }

    .card .mr-3 {
        margin-right: 0;
        margin-left: 0;
        margin-bottom: 0.5rem;
    }
    
    /* --- Language Switcher --- */
    /* تعديل مكان زر اللغة ليتجنب التداخل */
    .language-switcher {
        top: auto;
        bottom: 20px;
        left: 20px;
    }
    body[dir="rtl"] .language-switcher {
        left: 20px;
        right: auto;
    }
    body[dir="ltr"] .language-switcher {
        left: 20px;
        right: auto;
    }

}

/* --- Enhancements for Very Small Screens --- */
@media (max-width: 480px) {
    .hero h1 {
        font-size: 2rem !important;
    }
    
    .section-title {
        font-size: 1.7rem;
    }
    
    .grid-cols-2.md\:grid-cols-4 {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .code-block, .hero .code-block {
        font-size: 0.7rem;
    }
}