:root {
    --primary-color: #4361ee;
    --primary-dark: #3a56d4;
    --secondary-color: #3f37c9;
    --accent-color: #4cc9f0;
    --accent-dark: #2eafda;
    --correct-color: #4CAF50;
    --correct-dark: #3d8c40;
    --incorrect-color: #f44336;
    --incorrect-dark: #d32f2f;
    --neutral-color: #f8f9fa;
    --text-color: #212529;
    --light-text: #6c757d;
    --border-radius: 12px;
    --box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
    
    /* Dark mode variables */
    --dark-bg: #121212;
    --dark-surface: #1e1e1e;
    --dark-text: #e0e0e0;
    --dark-light-text: #aaaaaa;
    --dark-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Poppins', sans-serif;
}

body {
    background-color: #f8f9fa;
    color: var(--text-color);
    line-height: 1.6;
    transition: var(--transition);
}

body.dark-mode {
    background-color: var(--dark-bg);
    color: var(--dark-text);
}

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

header {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 30px 0;
    border-radius: var(--border-radius);
    margin-bottom: 30px;
    box-shadow: var(--box-shadow);
    text-align: center;
    position: relative;
    overflow: hidden;
}

/* Add this to your styles.css file */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--primary-color);
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.5s ease-out, visibility 0.5s ease-out;
}

.loading-screen.fade-out {
    opacity: 0;
    visibility: hidden;
}

.loading-content {
    text-align: center;
    padding: 30px;
    max-width: 400px;
}

.loading-logo {
    position: relative;
    width: 120px;
    height: 120px;
    margin: 0 auto 30px;
}

.loading-circle {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 5px solid rgba(255, 255, 255, 0.2);
    border-top-color: white;
    animation: spin 1.5s linear infinite;
}

.loading-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 40px;
    color: white;
}

.loading-text {
    color: white;
    font-size: 2rem;
    margin-bottom: 25px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    font-weight: 700;
}

.loading-bar {
    height: 8px;
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 15px;
}

.loading-progress {
    height: 100%;
    background-color: white;
    border-radius: 4px;
    width: 0%;
    animation: progress 3s ease-in-out forwards;
}

.loading-message {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1rem;
    font-style: italic;
}

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

@keyframes progress {
    0% { width: 0%; }
    60% { width: 70%; }
    100% { width: 100%; }
}

/* For dark mode */
.dark-mode .loading-screen {
    background: linear-gradient(135deg, var(--secondary-color), var(--dark-bg));
}

.share-btn.instagram {
    background-color: #E1306C; /* Instagram color */
    color: white;
    transition: all 0.3s ease;
}

.share-btn.instagram:hover {
    background-color: #C13584; /* Darker shade for hover */
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(225, 48, 108, 0.3);
}
header::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" preserveAspectRatio="none"><path fill="white" opacity="0.05" d="M0,0 L100,0 L100,100 Z" /></svg>') no-repeat center center;
    background-size: 100% 100%;
    z-index: 1;
}

h1 {
    font-size: 2.8rem;
    margin-bottom: 10px;
    position: relative;
    z-index: 2;
}

.config-container {
    margin-bottom: 30px;
}

.config-panel {
    background-color: white;
    border-radius: var(--border-radius);
    padding: 20px;
    box-shadow: var(--box-shadow);
}

.dark-mode .config-panel {
    background-color: var(--dark-surface);
}

.config-row {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    align-items: flex-end;
}

.config-field {
    flex: 1;
    min-width: 200px;
}

.config-field label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-color);
}

.dark-mode .config-field label {
    color: var(--dark-text);
}

.config-field input,
.config-field select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 1rem;
}

.dark-mode .config-field input,
.dark-mode .config-field select {
    background-color: #2a2a2a;
    border-color: #444;
    color: var(--dark-text);
}

.subtitle {
    font-size: 1.3rem;
    opacity: 0.95;
    margin-bottom: 15px;
    position: relative;
    z-index: 2;
}

.darija-motivation {
    font-style: italic;
    font-size: 1.1rem;
    opacity: 0.9;
    position: relative;
    z-index: 2;
    margin-top: 10px;
    font-weight: 500;
    color: #ffe066;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.stats {
    background-color: white;
    padding: 15px 20px;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    display: flex;
    gap: 25px;
    flex-wrap: wrap;
}

.dark-mode .stats {
    background-color: var(--dark-surface);
}

.stat-item {
    text-align: center;
    min-width: 70px;
}

.stat-value {
    font-weight: bold;
    font-size: 1.6rem;
    color: var(--primary-color);
    margin-bottom: 5px;
}

.dark-mode .stat-value {
    color: var(--accent-color);
}

.stat-label {
    font-size: 0.9rem;
    color: var(--light-text);
    font-weight: 500;
}

.dark-mode .stat-label {
    color: var(--dark-light-text);
}

.timer-container .stat-value {
    color: var(--accent-color);
}

.dark-mode .timer-container .stat-value {
    color: #66d9ff;
}

button {
    padding: 12px 24px;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: none;
}

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

.primary-btn:hover, .primary-btn:focus {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(67, 97, 238, 0.3);
}

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

.dark-mode .secondary-btn {
    background-color: var(--dark-surface);
    color: var(--dark-text);
    border: 1px solid #333;
}

.secondary-btn:hover, .secondary-btn:focus {
    background-color: #e9ecef;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.dark-mode .secondary-btn:hover, .dark-mode .secondary-btn:focus {
    background-color: #2a2a2a;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

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

.accent-btn:hover, .accent-btn:focus {
    background-color: var(--accent-dark);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(76, 201, 240, 0.3);
}

button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.quiz-container {
    background-color: white;
    border-radius: var(--border-radius);
    padding: 35px;
    box-shadow: var(--box-shadow);
    margin-bottom: 40px;
    position: relative;
}

.dark-mode .quiz-container {
    background-color: var(--dark-surface);
    box-shadow: var(--dark-shadow);
}

.darija-quote {
    font-style: italic;
    text-align: center;
    margin-bottom: 25px;
    padding: 12px;
    border-radius: 8px;
    background-color: #e9f7fe;
    color: var(--primary-color);
    font-weight: 500;
    font-size: 1.05rem;
}

.dark-mode .darija-quote {
    background-color: #192734;
    color: var(--accent-color);
}

.question {
    margin-bottom: 30px;
    display: none;
    animation: fadeIn 0.5s;
}

.question.active {
    display: block;
}

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

.question-number {
    color: var(--primary-color);
    font-weight: bold;
    margin-bottom: 8px;
    font-size: 1.1rem;
}

.dark-mode .question-number {
    color: var(--accent-color);
}

.question-text {
    font-size: 1.3rem;
    margin-bottom: 25px;
    line-height: 1.5;
    font-weight: 500;
}

.options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.option {
    padding: 15px 18px;
    background-color: var(--neutral-color);
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.dark-mode .option {
    background-color: #2a2a2a;
}

.option:hover {
    background-color: #e9ecef;
    transform: translateY(-2px);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
}

.dark-mode .option:hover {
    background-color: #333;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
}

.option.selected {
    background-color: var(--accent-color);
    color: white;
    font-weight: 500;
}

.option.correct {
    background-color: var(--correct-color);
    color: white;
    font-weight: 500;
}

.option.incorrect {
    background-color: var(--incorrect-color);
    color: white;
    font-weight: 500;
}

.option-prefix {
    font-weight: bold;
    margin-right: 12px;
    min-width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
}

.dark-mode .option:not(.selected):not(.correct):not(.incorrect) .option-prefix {
    background-color: rgba(255, 255, 255, 0.1);
}

.explanation {
    margin-top: 25px;
    padding: 18px;
    background-color: #e9f7fe;
    border-radius: var(--border-radius);
    display: none;
    font-size: 1.05rem;
    line-height: 1.5;
    border-left: 4px solid var(--primary-color);
}

.dark-mode .explanation {
    background-color: #192734;
    border-left: 4px solid var(--accent-color);
}

.explanation.show {
    display: block;
    animation: fadeIn 0.5s;
}

.navigation {
    display: flex;
    justify-content: space-between;
    margin-top: 30px;
    gap: 15px;
}

.progress-container {
    width: 100%;
    height: 10px;
    background-color: #e9ecef;
    border-radius: 5px;
    margin-top: 30px;
    overflow: hidden;
}

.dark-mode .progress-container {
    background-color: #2a2a2a;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(to right, var(--primary-color), var(--accent-color));
    width: 0%;
    transition: width 0.5s ease;
    border-radius: 5px;
}

.results {
    display: none;
    text-align: center;
    padding: 30px;
    animation: fadeIn 0.8s;
}

.results.show {
    display: block;
}

.results-title {
    font-size: 2.5rem;
    margin-bottom: 25px;
    color: var(--primary-color);
    font-weight: 700;
}

.dark-mode .results-title {
    color: var(--accent-color);
}

.score-container {
    display: flex;
    justify-content: center;
    margin-bottom: 30px;
}

.score-circle {
    width: 180px;
    height: 180px;
    border-radius: 50%;
    background: conic-gradient(var(--primary-color) 0%, var(--accent-color) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.score-circle::after {
    content: '';
    position: absolute;
    width: 160px;
    height: 160px;
    border-radius: 50%;
    background-color: white;
}

.dark-mode .score-circle::after {
    background-color: var(--dark-surface);
}

.score {
    font-size: 3.5rem;
    font-weight: bold;
    color: var(--primary-color);
    position: relative;
    z-index: 2;
}

.dark-mode .score {
    color: var(--accent-color);
}

.results-stats {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 30px;
    margin-bottom: 35px;
}

.results-message {
    margin-bottom: 25px;
    font-size: 1.3rem;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

.results-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 40px;
}

.toggle-review {
    margin-bottom: 0;
}

.review {
    margin-top: 40px;
    text-align: left;
    display: none;
}

.review.show {
    display: block;
    animation: fadeIn 0.5s;
}

.review-item {
    background-color: #f8f9fa;
    padding: 20px;
    border-radius: var(--border-radius);
    margin-bottom: 20px;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.05);
}

.dark-mode .review-item {
    background-color: #2a2a2a;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15);
}

.review-question {
    font-weight: bold;
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.review-answer {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 1.05rem;
}

.review-answer.correct {
    color: var(--correct-color);
    background-color: rgba(76, 175, 80, 0.1);
}

.dark-mode .review-answer.correct {
    background-color: rgba(76, 175, 80, 0.15);
}

.review-answer.incorrect {
    color: var(--incorrect-color);
    background-color: rgba(244, 67, 54, 0.1);
}

.dark-mode .review-answer.incorrect {
    background-color: rgba(244, 67, 54, 0.15);
}

.review-answer-icon {
    margin-right: 10px;
    font-size: 1.1rem;
}

.review-explanation {
    font-size: 1rem;
    color: var(--light-text);
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #e9ecef;
}

.dark-mode .review-explanation {
    color: var(--dark-light-text);
    border-top: 1px solid #333;
}

footer {
    padding: 40px 0 20px;
    background-color: #f1f3f5;
    border-radius: var(--border-radius);
    margin-top: 50px;
}

.dark-mode footer {
    background-color: #1a1a1a;
}

.footer-content {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 30px;
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 20px;
}

.footer-section {
    flex: 1;
    min-width: 250px;
}

.footer-section h3 {
    font-size: 1.2rem;
    margin-bottom: 15px;
    color: var(--primary-color);
}

.dark-mode .footer-section h3 {
    color: var(--accent-color);
}

.footer-section p {
    margin-bottom: 15px;
    color: var(--light-text);
}

.dark-mode .footer-section p {
    color: var(--dark-light-text);
}

.footer-section ul {
    list-style-type: none;
}

.footer-section ul li {
    margin-bottom: 10px;
}

.footer-section ul li a {
    color: var(--light-text);
    text-decoration: none;
    transition: var(--transition);
}

.footer-section ul li a:hover {
    color: var(--primary-color);
    text-decoration: underline;
}

.dark-mode .footer-section ul li a {
    color: var(--dark-light-text);
}

.dark-mode .footer-section ul li a:hover {
    color: var(--accent-color);
}

.social-icons {
    display: flex;
    gap: 15px;
    margin-top: 10px;
}

.social-icons a {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--neutral-color);
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: var(--primary-color);
    font-size: 1.2rem;
    transition: var(--transition);
}

.dark-mode .social-icons a {
    background-color: #2a2a2a;
    color: var(--accent-color);
}

.social-icons a:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 10px rgba(0, 0, 0, 0.1);
    background-color: var(--primary-color);
    color: white;
}

.dark-mode .social-icons a:hover {
    background-color: var(--accent-color);
    color: white;
    box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
}

.footer-bottom {
    text-align: center;
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid #e9ecef;
}

.dark-mode .footer-bottom {
    border-top: 1px solid #333;
}

.footer-bottom p {
    color: var(--light-text);
    font-size: 0.9rem;
}

.dark-mode .footer-bottom p {
    color: var(--dark-light-text);
}

.footer-bottom a {
    color: var(--primary-color);
    text-decoration: none;
}

.dark-mode .footer-bottom a {
    color: var(--accent-color);
}

.footer-bottom a:hover {
    text-decoration: underline;
}

.theme-toggle {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    transition: var(--transition);
    z-index: 100;
}

.theme-toggle:hover {
    transform: scale(1.1);
}

.dark-mode .theme-toggle {
    background-color: var(--accent-color);
}

.share-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.share-content {
    background-color: white;
    padding: 30px;
    border-radius: var(--border-radius);
    width: 90%;
    max-width: 500px;
    position: relative;
}

.dark-mode .share-content {
    background-color: var(--dark-surface);
}

.close-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--light-text);
}

.dark-mode .close-btn {
    color: var(--dark-light-text);
}

.share-content h3 {
    margin-bottom: 20px;
    font-size: 1.4rem;
    color: var(--primary-color);
}

.dark-mode .share-content h3 {
    color: var(--accent-color);
}

.share-content p {
    margin-bottom: 20px;
    font-size: 1.1rem;
}

.share-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
}

.share-btn {
    flex: 1;
    min-width: 120px;
    padding: 10px;
    border: none;
    border-radius: 5px;
    color: white;
    cursor: pointer;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.share-btn:hover {
    opacity: 0.9;
    transform: translateY(-2px);
}

.twitter {
    background-color: #1DA1F2;
}

.facebook {
    background-color: #4267B2;
}

.linkedin {
    background-color: #0077B5;
}

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

.copy-link {
    display: flex;
    gap: 10px;
}

.copy-link input {
    flex: 1;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 0.9rem;
}

.dark-mode .copy-link input {
    background-color: #2a2a2a;
    border-color: #444;
    color: var(--dark-text);
}

.copy-link button {
    padding: 10px 15px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

.dark-mode .copy-link button {
    background-color: var(--accent-color);
}

.copy-link button:hover {
    background-color: var(--primary-dark);
}

.dark-mode .copy-link button:hover {
    background-color: var(--accent-dark);
}

/* Media Queries pour le responsive */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    h1 {
        font-size: 2rem;
    }
    
    .subtitle {
        font-size: 1.1rem;
    }
    
    .controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .stats {
        justify-content: center;
    }
    
    .quiz-container {
        padding: 20px;
    }
    
    .question-text {
        font-size: 1.2rem;
    }
    
    .navigation {
        flex-direction: column;
    }
    
    .navigation button {
        width: 100%;
    }
    
    .results-stats {
        flex-direction: column;
        gap: 15px;
        align-items: center;
    }
    
    .score {
        font-size: 3rem;
    }
    
    .score-circle {
        width: 150px;
        height: 150px;
    }
    
    .score-circle::after {
        width: 130px;
        height: 130px;
    }
    
    .results-buttons {
        flex-direction: column;
    }
    
    .footer-content {
        flex-direction: column;
        gap: 30px;
    }
    
    .footer-section {
        flex: 1 1 100%;
    }
    
    .theme-toggle {
        bottom: 20px;
        right: 20px;
        width: 40px;
        height: 40px;
    }
}

@media (max-width: 480px) {
    h1 {
        font-size: 1.8rem;
    }
    
    .subtitle {
        font-size: 1rem;
    }
    
    .darija-motivation {
        font-size: 0.9rem;
    }
    
    .quiz-container {
        padding: 15px;
    }
    
    .question-text {
        font-size: 1.1rem;
    }
    
    .option {
        padding: 12px 15px;
    }
    
    .explanation {
        padding: 15px;
        font-size: 0.95rem;
    }
    
    .score-circle {
        width: 120px;
        height: 120px;
    }
    
    .score-circle::after {
        width: 100px;
        height: 100px;
    }
    
    .score {
        font-size: 2.5rem;
    }
    
    .results-message {
        font-size: 1.1rem;
    }
}