/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* Loading Screen */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.5s ease-out;
}

.loading-screen.hidden {
    opacity: 0;
    pointer-events: none;
}

.loading-content {
    text-align: center;
    color: white;
}

.loading-logo {
    margin-bottom: 30px;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-logo h2 {
    font-size: 2rem;
    font-weight: 600;
    margin: 0;
}

.loading-bar {
    width: 300px;
    height: 4px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
    margin: 0 auto 20px;
    overflow: hidden;
}

.loading-progress {
    height: 100%;
    background: linear-gradient(90deg, #8a2be2, #6a0dad);
    width: 0%;
    animation: loadProgress 2s ease-out forwards;
    border-radius: 2px;
}

@keyframes loadProgress {
    0% { width: 0%; }
    100% { width: 100%; }
}

.loading-content p {
    font-size: 1rem;
    opacity: 0.8;
    margin: 0;
}

/* Background Animation */
.background-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
}

.floating-shape {
    position: absolute;
    background: rgba(138, 43, 226, 0.1);
    border-radius: 50%;
    animation: float 6s ease-in-out infinite;
    backdrop-filter: blur(2px);
}

.shape-1 {
    width: 80px;
    height: 80px;
    top: 20%;
    left: 10%;
    animation-delay: 0s;
}

.shape-2 {
    width: 120px;
    height: 120px;
    top: 60%;
    right: 10%;
    animation-delay: 2s;
}

.shape-3 {
    width: 60px;
    height: 60px;
    top: 80%;
    left: 20%;
    animation-delay: 4s;
}

.shape-4 {
    width: 100px;
    height: 100px;
    top: 10%;
    right: 30%;
    animation-delay: 1s;
}

.shape-5 {
    width: 90px;
    height: 90px;
    top: 40%;
    left: 50%;
    animation-delay: 3s;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px) rotate(0deg);
        opacity: 0.3;
    }
    50% {
        transform: translateY(-20px) rotate(180deg);
        opacity: 0.6;
    }
}

/* Page Management */
.page {
    display: none;
    min-height: 100vh;
    padding: 20px;
}

.page.active {
    display: block;
}

/* Homepage Styles */
.header {
    text-align: center;
    margin-bottom: 50px;
    padding-top: 40px;
    position: relative;
}

.header-nav {
    position: absolute;
    top: 20px;
    right: 20px;
}

.nav-btn {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 10px 20px;
    border-radius: 25px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Poppins', sans-serif;
}

.nav-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.main-title {
    font-size: 3.5rem;
    font-weight: 700;
    color: white;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    animation: fadeInUp 1s ease-out;
}

.subtitle {
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 300;
    animation: fadeInUp 1s ease-out 0.2s both;
    margin-bottom: 20px;
}

.difficulty-legend {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-top: 20px;
    animation: fadeInUp 1s ease-out 0.4s both;
}

.legend-item {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

.legend-item:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

/* Category Headers */
.categories-section {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

.category-header {
    text-align: center;
    margin: 60px 0 40px;
    animation: fadeInUp 1s ease-out;
}

.category-header h2 {
    font-size: 2.2rem;
    font-weight: 600;
    color: white;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.category-header p {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 300;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Languages Grid */
.languages-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

.language-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    padding: 40px 30px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    animation: fadeInUp 0.6s ease-out;
}

.language-card:nth-child(1) { animation-delay: 0.1s; }
.language-card:nth-child(2) { animation-delay: 0.2s; }
.language-card:nth-child(3) { animation-delay: 0.3s; }
.language-card:nth-child(4) { animation-delay: 0.4s; }
.language-card:nth-child(5) { animation-delay: 0.5s; }
.language-card:nth-child(6) { animation-delay: 0.6s; }

.language-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(138, 43, 226, 0.3);
    background: rgba(255, 255, 255, 0.15);
}

.card-logo {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 80px;
    margin-bottom: 1rem;
}

.card-logo i {
    font-size: 3.5rem;
    transition: transform 0.3s ease;
}

.card-logo svg {
    width: 100%;
    height: 100%;
    border-radius: 16px;
}

.language-card:hover .card-logo {
    transform: scale(1.1) rotate(5deg);
    filter: drop-shadow(0 8px 16px rgba(138, 43, 226, 0.4));
}

/* Custom colors for specific languages */
.language-card[data-language="css"] .card-logo i {
    color: #264de4 !important; /* لون CSS الرسمي بدرجة أغمق وأوضح */
    text-shadow: 0 0 10px rgba(38, 77, 228, 0.3); /* إضافة توهج خفيف */
    font-size: 4rem; /* حجم أكبر قليلاً */
}

.language-card[data-language="php"] .card-logo i {
    color: #4F5B93 !important; /* لون PHP الرسمي بدرجة أوضح */
    text-shadow: 0 0 10px rgba(79, 91, 147, 0.3); /* إضافة توهج خفيف */
    font-size: 4rem; /* حجم أكبر قليلاً */
}

/* تأثير التحويم */
.language-card[data-language="css"]:hover .card-logo i,
.language-card[data-language="php"]:hover .card-logo i {
    transform: scale(1.15);
    transition: all 0.3s ease;
}

/* تحسين شعار كوتلين */
.language-card[data-language="kotlin"] .card-logo i {
    color: #7F52FF !important; /* لون Kotlin الرسمي بدرجة أوضح */
    text-shadow: 0 0 10px rgba(127, 82, 255, 0.5); /* إضافة توهج للشعار */
    font-size: 4rem; /* حجم أكبر للشعار */
}

.language-card[data-language="kotlin"]:hover .card-logo i {
    transform: scale(1.15);
    transition: all 0.3s ease;
}

/* Programming Icons Styles */
.programming-icon {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 60px;
    height: 60px;
    border-radius: 12px;
    font-size: 1.8rem;
    font-weight: bold;
    color: white;
}

/* Language specific styles */
[data-language="dart"] .programming-icon {
    background: #0175C2;
    font-family: 'Roboto Mono', monospace;
}

[data-language="flutter"] .programming-icon {
    background: #02569B;
    font-family: 'Roboto Mono', monospace;
}

[data-language="csharp"] .programming-icon {
    background: #68217A;
    font-family: 'Roboto Mono', monospace;
}

[data-language="cpp"] .programming-icon {
    background: #00599C;
    font-family: 'Roboto Mono', monospace;
}

.language-card:hover .card-logo i,
.language-card:hover .programming-icon {
    transform: scale(1.1);
}

/* Special hover effects for specific languages */
.language-card[data-language="html"]:hover {
    box-shadow: 0 20px 40px rgba(228, 77, 38, 0.3);
}

.language-card[data-language="css"]:hover {
    box-shadow: 0 20px 40px rgba(6, 52, 237, 0.852);
}

.language-card[data-language="swift"]:hover {
    box-shadow: 0 20px 40px rgba(250, 115, 67, 0.3);
}

.language-card[data-language="kotlin"]:hover {
    box-shadow: 0 20px 40px rgba(128, 110, 227, 0.3);
}

.language-card[data-language="dart"]:hover {
    box-shadow: 0 20px 40px rgba(0, 210, 184, 0.3);
}

.language-card[data-language="flutter"]:hover {
    box-shadow: 0 20px 40px rgba(66, 165, 245, 0.3);
}

.card-stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.difficulty {
    color: white;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.difficulty.beginner {
    background: linear-gradient(135deg, #22c55e, #16a34a);
}

.difficulty.intermediate {
    background: linear-gradient(135deg, #f59e0b, #d97706);
}

.difficulty.advanced {
    background: linear-gradient(135deg, #ef4444, #dc2626);
}

.questions {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.8rem;
    font-weight: 500;
}

.language-card h3 {
    font-size: 1.5rem;
    font-weight: 600;
    color: white;
    margin-bottom: 10px;
}

.language-card p {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.95rem;
    line-height: 1.5;
}

.card-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #8a2be2, #6a0dad);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.3s ease;
    border-radius: 20px;
}

.language-card:hover .card-overlay {
    opacity: 0.95;
}

.card-overlay span {
    color: white;
    font-size: 1.2rem;
    font-weight: 600;
    transform: translateY(20px);
    transition: all 0.3s ease;
}

.language-card:hover .card-overlay span {
    transform: translateY(0);
}

/* Quiz Page Styles */
.quiz-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 40px;
    flex-wrap: wrap;
    gap: 20px;
}

.back-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 12px 20px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.back-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateX(-5px);
}

.quiz-title-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    flex: 1;
}

.quiz-logo {
    width: 50px;
    height: 50px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.quiz-logo svg {
    width: 100%;
    height: 100%;
    border-radius: 8px;
}

#quiz-title {
    color: white;
    font-size: 1.8rem;
    font-weight: 600;
    margin: 0;
}

.progress-container {
    display: flex;
    align-items: center;
    gap: 15px;
}

.progress-bar {
    width: 200px;
    height: 8px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #8a2be2, #6a0dad);
    width: 0%;
    transition: width 0.3s ease;
    border-radius: 4px;
}

#question-counter {
    color: white;
    font-weight: 500;
    font-size: 0.95rem;
}

/* Quiz Container */
.quiz-container {
    max-width: 800px;
    margin: 0 auto;
}

.question-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    padding: 40px;
    animation: slideInUp 0.5s ease-out;
    position: relative;
    overflow: hidden;
}

.question-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #8a2be2, #6a0dad, #9370db);
    border-radius: 20px 20px 0 0;
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#question-text {
    color: white;
    font-size: 1.4rem;
    font-weight: 500;
    margin-bottom: 30px;
    line-height: 1.6;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

#question-text code {
    background: rgba(0, 0, 0, 0.3);
    color: #ffd700;
    padding: 2px 8px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 1.2rem;
    font-weight: 600;
}

.question-header {
    margin-bottom: 30px;
}

.code-preview {
    background: rgba(0, 0, 0, 0.4);
    border-radius: 12px;
    margin-top: 20px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.code-header {
    background: rgba(0, 0, 0, 0.2);
    padding: 12px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.code-lang {
    color: #ffd700;
    font-size: 0.85rem;
    font-weight: 600;
    font-family: 'Courier New', monospace;
}

.code-dots {
    display: flex;
    gap: 6px;
}

.code-dots span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
}

.code-dots span:nth-child(1) { background: #ff5f57; }
.code-dots span:nth-child(2) { background: #ffbd2e; }
.code-dots span:nth-child(3) { background: #28ca42; }

#code-content {
    padding: 20px;
    margin: 0;
    color: #e6e6e6;
    font-family: 'Courier New', monospace;
    font-size: 0.95rem;
    line-height: 1.5;
    overflow-x: auto;
}

#code-content .keyword { color: #569cd6; }
#code-content .string { color: #ce9178; }
#code-content .comment { color: #6a9955; }
#code-content .number { color: #b5cea8; }
#code-content .function { color: #dcdcaa; }

.options-container {
    display: grid;
    gap: 15px;
    margin-bottom: 30px;
}

.option {
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    padding: 20px;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
    text-align: left;
    position: relative;
    overflow: hidden;
}

.option::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(135deg, #8a2be2, #6a0dad);
    transform: scaleY(0);
    transition: transform 0.3s ease;
}

.option:hover::before {
    transform: scaleY(1);
}

.option code {
    background: rgba(0, 0, 0, 0.2);
    color: #ffd700;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
}

.option:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateX(5px);
}

.option.selected {
    background: rgba(138, 43, 226, 0.3);
    border-color: #8a2be2;
}

.option.correct {
    background: rgba(34, 197, 94, 0.3);
    border-color: #22c55e;
    animation: correctPulse 0.6s ease-out;
}

.option.incorrect {
    background: rgba(239, 68, 68, 0.3);
    border-color: #ef4444;
    animation: incorrectShake 0.6s ease-out;
}

@keyframes correctPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.02); }
    100% { transform: scale(1); }
}

@keyframes incorrectShake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.next-btn {
    background: linear-gradient(135deg, #8a2be2, #6a0dad);
    border: none;
    color: white;
    padding: 15px 30px;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
}

.next-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(138, 43, 226, 0.4);
}

.next-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Results Page */
.results-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}

.results-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    padding: 50px;
    text-align: center;
    max-width: 500px;
    width: 100%;
    animation: scaleIn 0.6s ease-out;
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.score-circle {
    width: 150px;
    height: 150px;
    border: 8px solid rgba(138, 43, 226, 0.3);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 30px;
    position: relative;
    background: linear-gradient(135deg, rgba(138, 43, 226, 0.2), rgba(106, 13, 173, 0.2));
}

.score-text {
    display: flex;
    flex-direction: column;
    align-items: center;
}

#final-score {
    font-size: 3rem;
    font-weight: 700;
    color: white;
    line-height: 1;
}

.score-total {
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 500;
}

#results-title {
    color: white;
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: 15px;
}

#results-message {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.1rem;
    margin-bottom: 40px;
    line-height: 1.5;
}

.results-actions {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.action-btn {
    flex: 1;
    min-width: 150px;
    padding: 15px 25px;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.action-btn.primary {
    background: linear-gradient(135deg, #8a2be2, #6a0dad);
    color: white;
}

.action-btn.secondary {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(138, 43, 226, 0.3);
}

/* Developer Contact Section */
.developer-section {
    padding: 30px 20px;
    margin: 2rem;
    position: relative;
}

.developer-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.developer-info {
    background: rgba(14, 21, 37, 0.85);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 20px 30px;
    text-align: center;
    min-width: 300px;
}

.developer-info h3 {
    color: white;
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.developer-info p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1rem;
    line-height: 1.5;
    margin: 0;
    white-space: nowrap;
}

.contact-links {
    display: flex;
    gap: 15px;
    flex-direction: row;
}

.contact-btn {
    display: flex;
    align-items: center;
    padding: 12px 25px;
    background: rgba(14, 21, 37, 0.85);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    color: white;
    text-decoration: none;
    transition: all 0.3s ease;
    gap: 8px;
    font-size: 0.95rem;
    min-width: 140px;
    justify-content: center;
}

/* WhatsApp button hover effect */
.contact-btn:has(.fa-whatsapp):hover {
    background: rgba(37, 211, 102, 0.8); /* WhatsApp green color */
    border-color: rgba(37, 211, 102, 0.4);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(37, 211, 102, 0.2);
}

/* GitHub button hover effect */
.contact-btn:has(.fa-github):hover {
    background: rgba(110, 118, 129, 0.8); /* GitHub gray color */
    border-color: rgba(110, 118, 129, 0.4);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(110, 118, 129, 0.2);
}

.contact-btn i {
    font-size: 1.1rem;
}

/* Media Queries for Developer Section */
@media (max-width: 768px) {
    .developer-section {
        margin: 1rem;
        padding: 15px;
    }

    .developer-container {
        gap: 15px;
    }

    .developer-info {
        padding: 15px 25px;
        width: 100%;
    }

    .contact-links {
        gap: 10px;
        width: 100%;
        justify-content: center;
    }

    .contact-btn {
        padding: 10px 20px;
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .developer-section {
        margin-top: 30px;
        padding: 25px 15px;
        border-radius: 25px 25px 0 0;
    }
    
    .developer-info h3 {
        font-size: 1.1rem;
    }
    
    .developer-info p {
        font-size: 0.9rem;
    }
    
    .contact-btn {
        padding: 12px 18px;
        font-size: 0.85rem;
        border-radius: 20px;
        min-width: 120px;
        justify-content: center;
    }
    
    .contact-btn i {
        font-size: 1.1rem;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .main-title {
        font-size: 2.5rem;
    }
    
    .subtitle {
        font-size: 1rem;
    }
    
    .difficulty-legend {
        flex-direction: column;
        gap: 10px;
        align-items: center;
    }
    
    .languages-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .language-card {
        padding: 30px 20px;
    }
    
    .quiz-header {
        flex-direction: column;
        text-align: center;
    }
    
    .quiz-title-container {
        order: 1;
    }
    
    .progress-container {
        order: 2;
        width: 100%;
        justify-content: center;
    }
    
    .progress-bar {
        width: 250px;
    }
    
    .question-card {
        padding: 30px 20px;
    }
    
    #question-text {
        font-size: 1.2rem;
    }
    
    .code-preview {
        margin-top: 15px;
    }
    
    #code-content {
        padding: 15px;
        font-size: 0.85rem;
    }
    
    .results-card {
        padding: 40px 30px;
    }
    
    .results-actions {
        flex-direction: column;
    }
    
    .action-btn {
        min-width: auto;
    }
}

@media (max-width: 480px) {
    .page {
        padding: 15px;
    }
    
    .main-title {
        font-size: 2rem;
    }
    
    .language-card {
        padding: 25px 15px;
    }
    
    .card-logo {
        width: 70px;
        height: 70px;
    }
    
    .question-card {
        padding: 25px 15px;
    }
    
    .option {
        padding: 15px;
        font-size: 0.95rem;
    }
    
    .results-card {
        padding: 30px 20px;
    }
    
    .score-circle {
        width: 120px;
        height: 120px;
    }
    
    #final-score {
        font-size: 2.5rem;
    }
}
