    /* static/css/style.css */

    /* ================= استایل های عمومی ================= */
    body {
        font-family: 'Vazirmatn', sans-serif;
        background-color: #F5F5F5;
        color: #333;
        margin: 0;
        padding: 0;
        display: flex;
        flex-direction: column;
        align-items: center;
        min-height: 100vh;
        box-sizing: border-box;
    }

    h1 {
        font-size: 2.5rem;
        font-weight: 700;
        color: #333;
        margin-bottom: 1rem;
        position: static;
    }

    p {
        color: #666;
        line-height: 1.6;
        margin-top: 0;
    }

    a {
        margin-top: 20px;
        color: #007bff;
        text-decoration: none;
        font-size: 18px;
    }

    a:hover {
        text-decoration: underline;
    }

    /* ================= استایل های هدر سایت ================= */
    .site-header {
        background-color: #ffffff;
        min-height: 5rem;
        padding-block: 1rem;
        padding-inline: 2.5rem;
        border-bottom: 1px solid #e5e5e5;
        display: flex;
        justify-content: flex-start;
        align-items: center;
        width: 100%;
        box-sizing: border-box;
        position: sticky;
        top: 0;
        left: 0;
        right: 0;
        z-index: 100;
        box-shadow: 0 0.25rem 1.25rem rgba(0,0,0,0.08);
        box-shadow: 0 4px 20px rgba(0,0,0,0.08);
        transition: all 0.3s ease;
    }

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

    .logo-container {
        display: flex;
        align-items: center;
        transition: transform 0.3s ease;
    }

    .logo-container:hover {
        transform: scale(1.02);
    }

    .logo-link {
        display: flex;
        align-items: center;
        text-decoration: none;
        color: #333;
        font-size: 1.6rem;
        font-weight: 700;
        font-family: 'Estedad', sans-serif;
        padding: 8px 15px;
        border-radius: 12px;
        background: linear-gradient(145deg, #ffffff, #f5f5f5);
        box-shadow: 5px 5px 10px #e6e6e6, -5px -5px 10px #ffffff;
    }

    .dolphin-emoji {
        font-size: 2.4rem;
        margin-left: 8px;
        transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
        line-height: 1;
    }

    .logo-text {
        font-size: 1.6rem;
        font-weight: 700;
        font-family: 'Estedad', sans-serif;
        color: #2c3e50;
        text-shadow: 1px 1px 2px rgba(0,0,0,0.1);
    }

    .logo-link:hover .dolphin-emoji {
        transform: rotate(15deg) scale(1.2);
    }

    .site-nav {
        display: flex;
        gap: 30px;
        margin: 0 40px;
    }

    .nav-link {
        color: #2c3e50;
        text-decoration: none !important;
        font-size: 1.1rem;
        font-weight: 500;
        padding: 8px 16px;
        border-radius: 8px;
        transition: all 0.3s ease;
        position: relative;
    }

    .nav-link::after {
        content: '';
        position: absolute;
        bottom: 0;
        left: 50%;
        width: 0;
        height: 2px;
        background: linear-gradient(90deg, #007bff, #00bfff);
        transition: all 0.3s ease;
        transform: translateX(-50%);
    }

    .nav-link:hover {
        color: #007bff;
        background-color: rgba(0, 123, 255, 0.05);
    }

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

    .nav-link.active {
        color: #007bff;
        font-weight: 600;
        background-color: rgba(0, 123, 255, 0.1);
    }

    .nav-link.active::after {
        width: 80%;
        background: linear-gradient(90deg, #007bff, #00bfff);
    }

    .header-cta {
        background: linear-gradient(135deg, #007bff, #00bfff);
        color: white;
        padding: 12px 24px;
        border-radius: 12px;
        font-weight: 600;
        font-size: 1.1rem;
        transition: all 0.3s ease;
        box-shadow: 0 4px 15px rgba(0, 123, 255, 0.2);
        border: none;
        text-decoration: none;
    }

    .header-cta:hover {
        transform: translateY(-2px);
        box-shadow: 0 6px 20px rgba(0, 123, 255, 0.3);
        background: linear-gradient(135deg, #0069d9, #00a8e8);
        text-decoration: none;
        color: white;
    }

    .hamburger-menu {
        display: none; /* در دسکتاپ مخفی است */
        z-index: 1001; /* باید بالاتر از منو باشد */
    }

    /* استایل‌های حالت موبایل */
    @media (max-width: 992px) {
        .header-wrapper {
            /* در موبایل، منو و دکمه تماس با ما به صورت پیش‌فرض فضا اشغال نمی‌کنند */
            justify-content: space-between;
        }

        .site-nav,
        .header-actions {
            /* منو و دکمه‌ها در یک لایه جدید و روی صفحه قرار می‌گیرند */
            display: flex;
            flex-direction: column;
            align-items: center;
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(255, 255, 255, 0.95);
            backdrop-filter: blur(10px);
            -webkit-backdrop-filter: blur(10px);
            
            /* انیمیشن باز و بسته شدن */
            clip-path: circle(25px at calc(100% - 55px) 40px);
            transition: all 0.5s ease-in-out;
            
            /* به صورت پیش‌فرض غیرقابل دسترس */
            pointer-events: none;
            opacity: 0;
        }

        .site-nav {
            padding-top: 150px;
            gap: 25px;
        }
        .nav-link { font-size: 1.5rem; }

        .header-actions {
            padding-bottom: 100px; /* فاصله از پایین */
            justify-content: flex-end;
        }

        /* وقتی منو باز است */
        .site-header.nav-open .site-nav,
        .site-header.nav-open .header-actions {
            clip-path: circle(150% at calc(100% - 55px) 40px);
            pointer-events: all;
            opacity: 1;
        }

        /* نمایش دکمه همبرگری */
        .hamburger-menu {
            display: flex;
            flex-direction: column;
            justify-content: space-around;
            width: 30px;
            height: 25px;
            background: transparent;
            border: none;
            cursor: pointer;
            padding: 0;
        }

        .hamburger-menu .line {
            width: 30px;
            height: 3px;
            background-color: #333; /* رنگ خطوط همبرگر */
            border-radius: 5px;
            transition: all 0.3s linear;
            transform-origin: 1px;
        }
        
        .site-header.nav-open .hamburger-menu .line:nth-child(1) {
        transform: rotate(45deg);
        }
        .site-header.nav-open .hamburger-menu .line:nth-child(2) {
        opacity: 0;
        transform: translateX(20px);
        }
        .site-header.nav-open .hamburger-menu .line:nth-child(3) {
        transform: rotate(-45deg);
        }
    }

    /* ================= استایل های کانتینر اصلی محتوا ================= */
    .content {
        padding: 20px 0 20px 0;
        width: 100%;
        box-sizing: border-box;
        display: flex;
        flex-direction: column;
        align-items: center;
        flex-grow: 1;
        padding-top: 120px;
    }

    @media (max-width: 600px) {
        .content {
            padding-top: 60px;
        }
        
        .btn-outline-dark {
            font-size: 0.6rem;
            padding: 0.25rem 0.5rem;
        }
        
        .navbar-toggler {
            padding: 0.2rem 0.4rem;
            font-size: 0.7rem;
        }
        
        .navbar-toggler-icon {
            width: 1.1rem;
            height: 1.1rem;
        }
        
        .offcanvas-logo {
            display: flex;
            align-items: center;
            justify-content: center;
            flex: 1;
            text-align: center;
        }
        
        .offcanvas-header {
            padding: 1rem 1.5rem;
            border-bottom: 1px solid #e9ecef;
            display: flex;
            align-items: center;
            justify-content: space-between;
        }
        
        .offcanvas-header {
            padding: 1rem 1.5rem;
            border-bottom: 1px solid #e9ecef;
        }
        
        .offcanvas-body .nav-link {
            font-size: 0.8rem;
            padding: 0.75rem 1rem;
        }
        
        .offcanvas-body .bi {
            font-size: 1rem;
        }
    }

    /* ================= استایل های کارت آزمون (tests.html) ================= */
    .quiz-card-container {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
        gap: 20px;
        width: 100%;
        max-width: 1200px; 
        margin-top: 30px;
        align-items: stretch;
    }

    .quiz-card {
        background-color: white; 
        border: 1px solid #e5e5e5;
        border-radius: 16px;
        padding: 20px;
        box-shadow: 0 4px 12px rgba(0,0,0,0.08);
        text-align: center;
        transition: transform 0.3s ease, box-shadow 0.3s ease, height 0.5s ease-out, min-height 0.5s ease-out; 
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        height: auto !important;
        max-height: none !important;
        overflow: visible !important;
        cursor: default;
        position: relative;
        min-height: 220px;
    }

    .quiz-card:hover:not(.expanded) {
        transform: translateY(-5px);
        box-shadow: 0 10px 20px rgba(0,0,0,0.1);
    }

    .quiz-card-header {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: flex-start;
        flex-grow: 1; 
    }

    .quiz-card-title {
        font-size: 1.3rem; 
        font-weight: 700;
        color: #333;
        margin: 0;
        padding: 10px 0;
    }

    .card-button, .start-quiz-btn, .expand-card-btn, .sub-button, .button {
        font-family: 'Vazirmatn', sans-serif !important;
    }

    .card-button {
        width: 100%;
        max-width: 11.25rem;
        font-weight: bold; 
        border-radius: 0.5rem;
        font-size: 1rem; 
        padding: 0.75rem 1.5rem;
        text-align: center;
        color: white; 
        border: 2px solid transparent; 
        transition: background 0.2s, color 0.2s, box-shadow 0.2s, transform 0.2s;
        cursor: pointer;
        display: block; 
        margin-inline: auto;
        outline: none;
    }
    .card-button:focus {
        outline: 2px solid #007bff;
        outline-offset: 2px;
    }
    .card-button:hover {
        background: #0056b3;
        color: #fff;
        box-shadow: 0 0.25rem 0.75rem rgba(0,123,255,0.13);
        transform: translateY(-2px);
    }

    .expand-card-btn,
    .green-button {
        padding: 0.75rem 1.5rem;
        font-size: 1rem;
        border-radius: 0.5rem;
        transition: background 0.2s, color 0.2s, box-shadow 0.2s, transform 0.2s;
        outline: none;
    }
    .expand-card-btn:focus,
    .start-quiz-btn:focus,
    .green-button:focus {
        outline: 2px solid #28a745;
        outline-offset: 2px;
    }
    .expand-card-btn:hover,
    .start-quiz-btn:hover,
    .green-button:hover {
        background: #218838;
        color: #fff;
        box-shadow: 0 0.25rem 0.75rem rgba(40,167,69,0.13);
        transform: translateY(-2px);
    }

    .expand-card-btn {
        background: #28a745 !important;
        color: #fff !important;
        border-color: #28a745 !important;
    }

    .hidden-details {
        opacity: 0;
        height: 0; 
        overflow: visible !important;
        max-height: none !important;
        pointer-events: none;
        transition: opacity 0.3s ease, height 0.5s ease-out;
        display: flex;
        flex-direction: column;
        align-items: center;
        width: 100%;
    }

    .sub-options-grid {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 12px; 
        width: 100%;
        overflow: visible !important;
        max-height: none !important;
        height: auto !important;
        display: block !important;
    }

    .sub-button {
        padding: 0.63rem 1.25rem;
        font-size: 1rem;
        font-weight: 500;
        border-radius: 0.5rem;
        transition: background 0.2s, color 0.2s, box-shadow 0.2s, transform 0.2s;
        outline: none;
    }
    .sub-button:focus {
        outline: 2px solid #0056b3;
        outline-offset: 2px;
    }
    .sub-button:hover {
        background: #b3e0ff;
        color: #004a99;
        box-shadow: 0 0.19rem 0.63rem rgba(0,86,179,0.13);
        transform: translateY(-2px);
    }


    .quiz-card-options {
        width: 100%;
    }

    .quiz-card.expanded {
        box-shadow: 0 15px 30px rgba(0,0,0,0.2);
        transform: translateY(-10px);
        z-index: 50;
        justify-content: flex-start; 
    }

    .quiz-card.expanded .expand-card-btn {
        opacity: 0;
        pointer-events: none;
        height: 0;
        padding: 0;
        margin: 0;
        border: 0;
    }

    .quiz-card.expanded .hidden-details {
        opacity: 1;
        height: auto;
        pointer-events: auto;
        margin-top: 20px; 
    }

    .quiz-card-container.blurred .quiz-card:not(.expanded) {
        opacity: 0.3;
        filter: blur(2px);
        pointer-events: none;
        box-shadow: none;
        transform: none;
    }

    /* ================= استایل های کارت زبان آموز ================= */
    .student-quiz-card .quiz-card-title {
        font-family: 'Estedad', sans-serif;
        font-size: 1.5rem; 
    }

    .student-quiz-card .quiz-code-input-style { 
        background-color: #f8f9fa; 
        border: 2px solid #e9ecef; 
        border-radius: 8px;
        box-sizing: border-box;
        display: block; 
        font-size: 0.90rem;
        margin: 0 auto 10px auto;
        max-width: 200px;
        padding: 12px;
        text-align: right; 
        transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
        width: 100%;
    }
    .student-quiz-card .quiz-code-input-style:focus {
        background-color: #ffffff; 
        border-color: #80bdff; 
        box-shadow: 0 0 0 4px rgba(0, 123, 255, 0.25); 
        outline: none;
    }

    .green-button {
        background-color: #28a745 !important;
        border-color: #28a745 !important;
    }
    .green-button:hover {
        background-color: #218838 !important;
    }

    #code-error-message {
        background: none !important;
        color: #dc3545 !important;
        text-shadow: none;
        margin-bottom: 0.31rem;
        font-weight: bold;
        font-size: 0.95rem;
        text-align: center;
        min-height: 1.2em;
        border-radius: 0;
        padding: 0;
    }

    /* === قانون متناقض قبلی از اینجا حذف شد === */
    /* h1[data-key="tests-title"], p[data-key="tests-desc"] { all: unset; } */


    /* ==================================================================== */
    /* === بخش مودال و دکمه‌ها (اصلاح شده برای ظاهر استاندارد) === */
    /* ==================================================================== */

    .modal-overlay{position:fixed;top:0;left:0;width:100%;height:100%;background-color:rgba(0,0,0,.6);display:flex;justify-content:center;align-items:center;z-index:1000;backdrop-filter:blur(5px);-webkit-backdrop-filter:blur(5px)}
    .modal {
        background-color: #fff;
        padding: 1.88rem 2.5rem;
        border-radius: 1rem;
        box-shadow: 0 0.31rem 1.25rem rgba(0,0,0,0.2);
        text-align: center;
        max-width: 25rem;
        width: 90%;
        transition: box-shadow 0.3s, background 0.3s;
        outline: none;
    }
    .modal:focus {
        outline: 2px solid #007bff;
        outline-offset: 2px;
    }
    .modal h2{margin-top:0;font-size:2rem}.modal p{font-size: 1.1rem; color: #666; line-height: 1.6;}
    .modal form{display:flex;flex-direction:column;gap:15px;margin-top:20px}
    .modal input[type=text]{padding:12px;border:1px solid #ccc;border-radius:8px;font-size:1rem}

    /* استایل پایه برای همه دکمه‌های مودال */
    .modal-button {
        padding: 0.75rem 1.5rem;
        font-size: 1rem;
        font-weight: 700;
        border-radius: 0.5rem;
        cursor: pointer;
        border: 2px solid transparent;
        transition: background 0.2s, color 0.2s, box-shadow 0.2s, transform 0.2s;
        background-color: transparent;
        outline: none;
    }
    .modal-button:focus {
        outline: 2px solid #007bff;
        outline-offset: 2px;
    }
    .modal-button:hover {
        background: #007bff;
        color: #fff;
        box-shadow: 0 0.25rem 0.75rem rgba(0,123,255,0.13);
        transform: translateY(-2px);
    }

    /* استایل دکمه ثانویه (برای گزینه امن "خیر، ادامه می‌دهم") */
    .modal-button.secondary-btn {
        background-color: #6c757d; /* خاکستری */
        color: white;
        border-color: #6c757d;
    }
    .modal-button.secondary-btn:hover {
        background-color: #5a6268;
        border-color: #545b62;
    }


    /* استایل دکمه خطرناک (برای گزینه "بله، خارج شو") */
    .modal-button.danger-btn {
        background-color: #dc3545; /* قرمز */
        color: white;
        border-color: #dc3545;
    }
    .modal-button.danger-btn:hover {
        background-color: #c82333;
        border-color: #bd2130;
    }

    /* استایل دکمه مثبت (برای گزینه "بله، نمایش بده") */
    .modal-button.primary-btn {
        background-color: #007bff; /* آبی */
        color: white;
        border-color: #007bff;
    }
    .modal-button.primary-btn:hover {
        background-color: #0056b3;
        border-color: #0056b3;
    }

    .hidden{display:none}
    .confirm-modal {
        background-color: #fff;
        padding: 1.88rem 2.5rem;
        border-radius: 1rem;
        box-shadow: 0 0.31rem 1.25rem rgba(0,0,0,0.2);
        text-align: center;
        max-width: 28.13rem;
        width: 90%;
        transition: box-shadow 0.3s, background 0.3s;
        outline: none;
    }
    .confirm-modal:focus {
        outline: 2px solid #007bff;
        outline-offset: 2px;
    }

    /* Responsive styles for name modal */
    @media (max-width: 600px) {
        .confirm-modal {
            padding: 1.5rem 1.25rem;
            max-width: 20rem;
            width: 85%;
            margin-left: 16px !important;
            margin-right: 16px !important;
            padding-left: 16px !important;
            padding-right: 16px !important;
        }
        
        .confirm-modal h2 {
            font-size: 1.3rem;
            margin-bottom: 1rem;
        }
        
        .confirm-modal input[type="text"] {
            width: 100% !important;
            margin: 8px 0 !important;
            padding: 10px !important;
            font-size: 0.9rem !important;
        }
        
        .confirm-modal .modal-button {
            padding: 0.6rem 1.2rem;
            font-size: 0.9rem;
        }
    }

    @media (max-width: 600px) {
        .confirm-modal h2 {
            font-size: 1.05rem !important;
        }
    }

    .confirm-buttons {
        display: flex;
        justify-content: center;
        gap: 0.94rem;
        margin-top: 1.25rem;
    }


    /* بقیه استایل‌های عمومی آزمون */
    .button {display: inline-block;text-decoration: none;}
    .button:hover {transform: translateY(-2px);}
    .secondary-btn {background-color: white;color: #007bff;border: 2px solid #007bff;}
    .secondary-btn:hover {background-color: #007bff;color: white;}
    .quiz-container{background-color:#fff;position:relative;width:100%;max-width:600px;
        border-radius:16px;border:2px solid #e5e5e5;
        box-shadow:0 4px 0 #cecece;display:flex;
        flex-direction:column;font-family:'Open Sans',sans-serif}.close-btn{position:absolute;top:10px;
            right:20px;font-size:2.5rem;color:#f08080;text-decoration:none;
            line-height:1;margin:0;z-index:10;transition:color .2s ease}.close-btn:hover{color:#cd5c5c;text-decoration:none}.quiz-header{padding:20px;border-bottom:2px solid #e5e5e5}.quiz-header h1{margin:0;text-align:center;font-size:1.8rem;font-family:'Inter',sans-serif;font-weight:700}.progress-bar{width:100%;height:16px;background-color:#e5e5e5;border-radius:8px;margin-top:15px;overflow:hidden}.progress-bar-inner{height:100%;background-color:#58a700;border-radius:8px;transition:width .4s ease}.question-prompt{padding:30px 40px;text-align:center}.question-text-style{font-size:1.7rem;margin:10px 0;color:#333;font-family:'Open Sans',sans-serif;line-height:1.4;font-weight:600}.question-counter{text-align:center;font-size:.9rem;color:#888;margin-top:10px;font-family:'Open Sans',sans-serif}.options-grid{display:grid;grid-template-columns:1fr 1fr;gap:15px;padding:0 20px 20px;direction:rtl}.option-btn{width:100%;padding:15px;font-size:1.2rem;font-weight:700;color:#4a4a4a;background-color:#fff;border:2px solid #e5e5e5;border-radius:12px;box-shadow:0 2px 0 #cecece;cursor:pointer;transition:background-color .2s,transform .1s;font-family:'Open Sans',sans-serif;font-weight:600;direction:ltr;text-align:left}.option-btn:hover{background-color:#f7f7f7}.option-btn:active{transform:translateY(2px);box-shadow:none}.quiz-footer{padding:20px;border-top:2px solid #e5e5e5;display:flex;justify-content:center}.check-btn{width:200px;padding:15px;font-size:1.2rem;font-weight:700;color:#fff;background-color:#58a700;border:none;border-bottom:4px solid #4a8d00;cursor:pointer;text-transform:uppercase;border-radius:12px}.check-btn:hover{background-color:#64bc00}.check-btn:active{transform:translateY(2px);border-bottom:2px solid #4a8d00}.option-btn.correct{background-color:#d7ffb8;color:#58a700;border-color:#58a700}.option-btn.incorrect{background-color:#ffdfe0;color:#ea2b2b;border-color:#ea2b2b}.option-btn:disabled:not(.correct):not(.incorrect){background-color:#f7f7f7;color:#cecece;cursor:not-allowed;box-shadow:none}.check-btn:disabled{background-color:#e5e5e5;border-bottom:4px solid #cecece;cursor:not-allowed}.quiz-results{padding:40px 20px;text-align:center}#results-text{font-size:1.5rem;margin-bottom:30px}.results-buttons{display:flex;flex-direction:column;align-items:center;gap:15px;margin-top:20px}.results-buttons .check-btn{width:100%;max-width:300px}
@media (max-width: 600px){body{padding:1rem}h1{font-size:1.8rem;top:100px}.quiz-card-container{display:grid;grid-template-columns:1fr 1fr;gap:14px;width:100%;justify-items:center;align-items:stretch}.quiz-card{width:95%;min-width:120px;max-width:210px;margin:0;box-sizing:border-box;padding-left:0;padding-right:0;display:flex;flex-direction:column;justify-content:space-between}.quiz-card .card-button,
    .quiz-card .start-quiz-btn {
        width: 90%;
        margin: 0 auto 12px auto;
        display: block;
        border-radius: 10px;
        box-sizing: border-box;
    }
    .quiz-card .quiz-card-header{flex-grow:1;display:flex;align-items:center;justify-content:center}
    .options-grid{grid-template-columns:1fr}.quiz-container{margin:10px}.results-buttons{width:100%}}

    /* ==================================================================== */
    /* === استایل‌های هدر جدید === */
    /* ==================================================================== */

    /* ==================================================================== */
    /* === استایل‌های هدر اصلاح شده (دسکتاپ + موبایل) === */
    /* ==================================================================== */

    /* === استایل بخش تامبنیل ویدیوهای یوتیوب === */
    .youtube-thumbnails-section {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
    }
    .youtube-slider-wrapper {
        width: 100%;
        max-width: 1200px;
        position: relative;
        margin: 0 auto;
        padding: 0;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    .youtube-slider {
        direction: rtl;
        display: flex;
        flex-wrap: nowrap;
        overflow-x: auto;
        scroll-behavior: smooth;
        width: 100%;
        margin: 0 auto;
        padding: 8px 0;
        scrollbar-width: none;
        align-items: center;
        justify-content: center;
        position: relative;
    }
    .youtube-thumb-card {
        background: #fff;
        border-radius: 18px;
        box-shadow: 0 2px 8px rgba(0,0,0,0.10);
        padding: 10px 8px 14px 8px;
        display: flex;
        align-items: center;
        justify-content: center;
        min-width: 210px;
        min-height: 125px;
        transition: box-shadow 0.3s, transform 0.3s;
    }
    .youtube-thumb-card:hover {
        box-shadow: 0 8px 32px rgba(0,123,255,0.13);
        transform: translateY(-6px) scale(1.03);
    }
    .thumbnails-inner {
        display: flex;
        gap: 18px;
        width: 100%;
        justify-content: center;
    }
    .thumbnails-inner .youtube-thumb-link:first-child {
        margin-right: 44px;
    }
    .thumbnails-inner .youtube-thumb-link:last-child {
        margin-left: 44px;
    }
    .youtube-slider::-webkit-scrollbar {
        display: none !important;
        height: 0 !important;
        background: transparent !important;
    }

    /* ریسپانسیو کردن کل صفحه اصلی و تمام سکشن‌ها */

    .main-header {
        text-align: center;
        margin: 40px 0;
    }

    .main-header h1 {
        font-size: 2.5rem;
        margin-bottom: 1rem;
    }

    .main-header p {
        font-size: 1.2rem;
        color: #666;
    }

    .main-card-container {
        display: flex;
        justify-content: center;
        gap: 2rem;
        flex-wrap: wrap;
        max-width: 75rem;
        margin: 0 auto;
        padding: 1.25rem;
        margin-top: 10px;
    }

    .e-card.playing {
        position: relative;
        width: 18.75rem;
        height: 18.75rem;
        border-radius: 1.25rem;
        background: #ffffff;
        box-shadow: 0 0.625rem 1.25rem rgba(0,0,0,0.1);
        overflow: hidden;
        cursor: pointer;
        transition: box-shadow 0.3s, transform 0.3s;
    }

    .e-card.playing:focus {
        outline: 2px solid #007bff;
        outline-offset: 2px;
    }

    .e-card.playing:hover {
        transform: translateY(-0.625rem);
        box-shadow: 0 0.94rem 1.88rem rgba(0,0,0,0.15);
    }

    @media (max-width: 1100px) {
        .main-card-container {
            gap: 1rem;
            padding: 1rem;
        }
        }

    @media (max-width: 900px) {
        .main-header h1 {
            font-size: 2rem;
        }
        .main-card-container {
            gap: 0.75rem;
            padding: 0.75rem;
        }
        .e-card.playing {
            transform: scale(1.02);
            box-shadow: 0 0.5rem 1.56rem rgba(0, 0, 0, 0.15);
        }
    }

    @media (max-width: 600px) {
        .home-header {
            margin-right: auto;
            margin-left: auto;
            margin-top: 20px;
        }
        .home-header h1 {
            font-size: 1.4rem;
        }
        .home-desc {
            font-size: 1rem;
            margin-bottom: 18px;
        }
        .main-card-container {
            gap: 0.63rem;
            padding: 0.63rem;
            margin-top: 30px;
            margin-left: auto;
            margin-right: auto;
        }
        .e-card.playing {
            width: 100%;
            max-width: 18.75rem;
            height: 16.38rem;
            transform: scale(1.01);
            box-shadow: 0 0.38rem 1.25rem rgba(0, 0, 0, 0.12);
            margin-left: auto;
            margin-right: auto;
        }
        .quiz-card-container {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 10px;
            width: 100%;
            justify-items: stretch;
            align-items: stretch;
        }
        .quiz-card {
            width: 100%;
            aspect-ratio: 1/1;
            margin: 0;
            box-sizing: border-box;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: space-between;
            padding: 12px 6px 16px 6px;
        }
        .quiz-card-title {
            font-size: 1.1rem;
            margin-bottom: 0.7em;
            text-align: center;
            padding-left: 12px;
            padding-right: 12px;
        }
        .quiz-card .card-button,
        .quiz-card .start-quiz-btn {
            width: 90%;
            margin: 0 auto 12px auto;
            display: block;
            border-radius: 10px;
            box-sizing: border-box;
            font-size: 0.95rem;
            padding: 10px 0;
        }
        .quiz-card input[type="text"] {
            width: 90%;
            margin: 0 auto 10px auto;
            display: block;
            box-sizing: border-box;
            font-size: 0.9rem;
            padding: 7px 6px;
        }
        .student-quiz-card .quiz-code-input-style {
            font-size: 0.48rem;
            max-width: 140px;
            padding: 8px;
        }
        .student-quiz-card .quiz-code-input-style::placeholder {
            font-size: 0.68rem;
        }
        .start-quiz-btn,
        .expand-card-btn {
            font-size: 0.8rem;
            padding: 0.6rem 1.2rem;
        }
    }

    /* ================= Video Slider Section ================= */
    .video-slider-section {
        max-width: 1200px;
        margin: 0 auto;
    }

    .video-swiper {
        padding-left: 32px;
        padding-right: 32px;
        overflow: hidden;
    }

    .section-title {
        font-size: 1.8rem;
        color: #2c3e50;
        margin-bottom: 20px;
        text-align: right;
        margin-top: 70px;
    }

    .video-card {
        display: block;
        border-radius: 12px;
        overflow: hidden;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
        transition: transform 0.3s ease, box-shadow 0.3s ease;
    }

    .video-card:hover {
        transform: translateY(-5px);
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    }

    .video-thumbnail {
        width: 100%;
        height: auto;
        aspect-ratio: 16/9;
        object-fit: cover;
        display: block;
    }

    /* Swiper Navigation Buttons */
    .swiper-button-next,
    .swiper-button-prev {
        width: 30px !important;
        height: 30px !important;
        border-radius: 50% !important;
        background: #dedbdb;
        box-shadow: 0 4px 24px rgba(0,0,0,0.13);
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 0 !important;
        box-sizing: border-box !important;
        top: 50%;
        transform: translateY(-50%) scale(1);
        z-index: 10;
        border: none;
        outline: none;
        opacity: 0.98;
        transition: box-shadow 0.2s, transform 0.18s, background 0.18s;
    }

    .swiper-button-next:hover, .swiper-button-prev:hover {
        box-shadow: 0 8px 32px rgba(0,0,0,0.18);
        background: #f5f5f5;
        transform: translateY(-50%) scale(1.10);
        opacity: 1;
    }

    .swiper-button-next, .swiper-rtl .swiper-button-prev {
        right: -20px;
        left: auto;
    }

    .swiper-button-prev, .swiper-rtl .swiper-button-next {
        left: -20px;
        right: auto;
    }

    .arrow-svg {
        width: 16px;
        height: 24px;
        display: block;
    }

    .swiper-button-next:after, .swiper-button-prev:after { display: none !important; }

    /* Responsive Styles */
    @media (max-width: 768px) {
        .video-slider-section {
            margin: 30px auto;
            padding: 0 15px;
        }

        .section-title {
            font-size: 1.5rem;
            margin-bottom: 15px;
        }

        .swiper-button-next,
        .swiper-button-prev {
            width: 35px;
            height: 35px;
        }

        .swiper-button-next:after,
        .swiper-button-prev:after {
            font-size: 16px;
        }
    }

    @media (max-width: 480px) {
        .video-slider-section {
            margin: 20px auto;
            padding: 0 10px;
        }

        .section-title {
            font-size: 1.3rem;
            margin-bottom: 10px;
        }

        .swiper-button-next,
        .swiper-button-prev {
            width: 30px;
            height: 30px;
        }

        .swiper-button-next:after,
        .swiper-button-prev:after {
            font-size: 14px;
        }
    }

    @media (max-width: 600px) {
        .video-slider-section {
            padding-right: 12px;
            padding-left: 12px;
        }
        .video-swiper {
            padding-right: 0;
            padding-left: 0;
        }
        .video-swiper {
            padding: 10px 0;
            max-width: 380px;
            margin: 0 auto;
        }
        .video-card {
            border-radius: 8px;
            box-shadow: 0 2px 8px rgba(0,0,0,0.08);
            max-width: 180px;
            min-width: 150px;
            margin: 0 auto;
        }
        .video-thumbnail {
            border-radius: 8px;
            aspect-ratio: 16/9;
            height: auto;
            max-width: 100%;
            min-width: 120px;
        }
        .swiper-button-next, .swiper-rtl .swiper-button-prev {
            right: 2px;
        }
        .swiper-button-prev, .swiper-rtl .swiper-button-next {
            left: 2px;
        }
        .section-title {
            font-size: 1.15rem;
        }
    }

    .custom-slider-next {
        right: -20px !important;
        left: auto !important;
        position: absolute;
        top: 50%;
        transform: translateY(-50%);
        width: 56px;
        height: 56px;
        border-radius: 50%;
        background: #fff;
        box-shadow: 0 4px 24px rgba(0,0,0,0.13);
        display: flex;
        align-items: center;
        justify-content: center;
        border: none;
        outline: none;
        cursor: pointer;
        z-index: 20;
        transition: box-shadow 0.2s, transform 0.18s, background 0.18s;
    }
    .custom-slider-next:hover {
        box-shadow: 0 8px 32px rgba(0,0,0,0.18);
        background: #f5f5f5;
        transform: translateY(-50%) scale(1.08);
    }
    .custom-slider-next svg {
        width: 20px;
        height: 32px;
        display: block;
    }
    @media (max-width: 600px) {
        .custom-slider-next {
            right: -12px !important;
            left: auto !important;
            width: 44px;
            height: 44px;
        }
        .custom-slider-next svg {
            width: 16px;
            height: 24px;
        }
    }

    input[type="text"],
    input[type="email"],
    input[type="password"] {
        padding: 0.75rem;
        border-radius: 0.5rem;
        font-size: 1rem;
        border: 1px solid #ccc;
        transition: border-color 0.2s, box-shadow 0.2s;
        outline: none;
        }
    input[type="text"]:focus,
    input[type="email"]:focus,
    input[type="password"]:focus {
        border-color: #007bff;
        box-shadow: 0 0 0 0.25rem rgba(0,123,255,0.15);
        outline: none;
    }

    body.blurred-bg > *:not(#language-modal-overlay) {
    filter: blur(6px) brightness(0.8);
    pointer-events: none;
    user-select: none;
    }
    #language-modal-overlay {
    display: none;
    }
    .language-modal {
    background: #fff;
    border-radius: 1.2rem;
    box-shadow: 0 4px 32px rgba(0,0,0,0.18);
    padding: 2.5rem 2rem 2rem 2rem;
    text-align: center;
    min-width: 270px;
    max-width: 90vw;
    }
    .language-buttons {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    margin-top: 2rem;
    }
    .language-buttons .modal-button {
    font-size: 1.2rem;
    padding: 0.7rem 2.2rem;
    border-radius: 0.7rem;
    background: #1976d2;
    color: #fff;
    border: none;
    transition: background 0.2s;
    font-weight: bold;
    cursor: pointer;
    }
    .language-buttons .modal-button:hover {
    background: #0d47a1;
    }

    /* Language Modal Overlay */
    .language-modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    width: 100vw; height: 100vh;
    background: rgba(30, 30, 30, 0.55);
    backdrop-filter: blur(6px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    }
    .language-modal {
    background: #fff;
    border-radius: 1.2rem;
    box-shadow: 0 8px 32px rgba(0,0,0,0.18);
    padding: 2.5rem 2rem 2rem 2rem;
    text-align: center;
    min-width: 260px;
    max-width: 90vw;
    }
    .language-modal h2 {
    font-size: 1.3rem;
    margin-bottom: 1.5rem;
    color: #222;
    }
    .language-buttons {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    }
    .language-buttons .modal-button {
    min-width: 90px;
    font-size: 1.1rem;
    padding: 0.7rem 1.2rem;
    }

    /* Remove blur when modal is hidden */
    .no-blur {
    filter: none !important;
    pointer-events: auto !important;
    }

    .code-input-wrapper {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        width: 100%;
    }
    #quiz-code-input {
        margin-bottom: 0.5rem;
        text-align: center;
    }
    #submit-code-btn {
        margin-top: 0.2rem;
    }

    /* Base styles for fullname input */
    #fullname-input {
        width: calc(100% - 20px);
        margin: 10px auto;
        padding: 8px;
        font-size: 1rem;
        border: 1px solid #ccc;
        border-radius: 8px;
        outline: none;
        display: block;
    }

    #fullname-input:focus {
        border-color: #007bff;
        box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
    }

    /* ===== Tests Page Header Styles ===== */
    .tests-header {
        width: 100%;
        text-align: center;
        margin-top: 10px;
        margin-bottom: 0;
    }
    .tests-header h1 {
        color: #000;
        font-size: 2.2rem;
        font-weight: 800;
        margin-bottom: 10px;
        display: block;
    }
    .tests-desc {
        color: #333;
        font-size: 1.1rem;
        font-weight: 500;
        margin-top: 0;
        margin-bottom: 30px;
        display: block;
    }
    @media (max-width: 600px) {
        .tests-header {
            margin-top: 24px;
        }
        .tests-header h1 {
            font-size: 1.4rem;
        }
        .tests-desc {
            font-size: 1rem;
            margin-bottom: 18px;
        }
    }

    /* ===== Home Page Header Styles ===== */
    .home-header {
        width: 100%;
        text-align: center;
        margin-bottom: 0;
    }
    .home-header h1 {
        color: #222;
        font-size: 2.4rem;
        font-weight: 800;
        margin-bottom: 10px;
        display: block;
    }
    .home-desc {
        color: #444;
        font-size: 1.15rem;
        font-weight: 500;
        margin-top: 0;
        margin-bottom: 30px;
        display: block;
    }
    @media (max-width: 600px) {
        .home-header {
            margin-top: 20px;
        }
        .home-header h1 {
            font-size: 1.3rem;
        }
        .home-desc {
            font-size: 0.98rem;
            margin-bottom: 18px;
        }
    }

    /* ===== Quiz Page Header Styles ===== */
    .quizpage-header {
        width: 100%;
        text-align: center;
        margin-top: 40px;
        margin-bottom: 0;
    }
    .quizpage-header h1 {
        color: #222;
        font-size: 2.1rem;
        font-weight: 800;
        margin-bottom: 10px;
        display: block;
    }
    .quizpage-desc {
        color: #444;
        font-size: 1.08rem;
        font-weight: 500;
        margin-top: 0;
        margin-bottom: 30px;
        display: block;
    }
    @media (max-width: 600px) {
        .quizpage-header {
            margin-top: 18px;
        }
        .quizpage-header h1 {
            font-size: 1.1rem;
        }
        .quizpage-desc {
            font-size: 0.95rem;
            margin-bottom: 16px;
        }
    }

    /* Remove padding-top from card containers */
    .main-card-container,
    .quiz-card-container,
    .quiz-container {
        padding-top: 0 !important;
    }

    /* Ensure h1 in headers has no extra margin */
    .home-header h1,
    .tests-header h1,
    .quizpage-header h1 {
        margin-top: 0;
    }

    .content.quiz-page {
        padding-top: 0 !important;
    }

    .content.quiz-page > .quiz-container {
        margin-top: 0 !important;
        margin-bottom: auto !important;
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    /* Remove padding-top for quiz page specifically */
    #main-content-wrapper:has(.quiz-container) .content,
    #main-content-wrapper .quiz-container {
        padding-top: 0 !important;
        margin-top: 0 !important;
    }

    /* Specific fix for quiz page - remove all top spacing */
    #main-content-wrapper:has(.quiz-container) {
        padding-top: 0 !important;
        margin-top: 0 !important;
    }

    #main-content-wrapper .quiz-container {
        padding-top: 0 !important;
        margin-top: 0 !important;
    }

    .swiper.video-swiper, .video-swiper {
        overflow: hidden !important;
    }

    .custom-slider-next {
        width: 40px;
        height: 40px;
    }
    .custom-slider-next svg {
        width: 16px;
        height: 24px;
    }
    @media (max-width: 600px) {
        .custom-slider-next {
            width: 32px;
            height: 32px;
        }
        .custom-slider-next svg {
            width: 12px;
            height: 18px;
        }
    }

    .custom-slider-prev {
        position: absolute;
        top: 50%;
        left: -20px;
        transform: translateY(-50%);
        width: 40px;
        height: 40px;
        border-radius: 50%;
        background: #fff;
        box-shadow: 0 4px 24px rgba(0,0,0,0.13);
        display: flex;
        align-items: center;
        justify-content: center;
        border: none;
        outline: none;
        cursor: pointer;
        z-index: 20;
        transition: box-shadow 0.2s, transform 0.18s, background 0.18s;
    }
    .custom-slider-prev:hover {
        box-shadow: 0 8px 32px rgba(0,0,0,0.18);
        background: #f5f5f5;
        transform: translateY(-50%) scale(1.08);
    }
    .custom-slider-prev svg {
        width: 16px;
        height: 24px;
        display: block;
    }
    @media (max-width: 600px) {
        .custom-slider-prev {
            left: -12px;
            width: 32px;
            height: 32px;
        }
        .custom-slider-prev svg {
            width: 12px;
            height: 18px;
        }
    }

    .video-swiper .swiper-slide {
        margin: 0 8px;
    }
    .video-swiper .swiper-slide:first-child {
        margin-right: 0;
    }
    .video-swiper .swiper-slide:last-child {
        margin-left: 0;
    }

    @media (max-width: 640px) {
    .video-swiper .swiper-slide {
        margin: 0 4px;
    }
    .video-swiper .swiper-slide:first-child {
        margin-right: 0;
    }
    .video-swiper .swiper-slide:last-child {
        margin-left: 0;
    }
    .custom-slider-prev {
        left: -12px !important;
    }
    .custom-slider-next {
        right: -12px !important;
        left: auto !important;
    }
    }

    .video-card,
    .video-card img,
    .swiper-slide:last-child .video-card,
    .swiper-slide:last-child .video-card img {
        border-radius: 12px !important;
        overflow: hidden;
    }

    @media (max-width: 600px) {
    .name-input {
        width: 100% !important;
        box-sizing: border-box;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }
    }

    @media (max-width: 600px) {
  .header-logo-responsive {
    height: 75px !important;
    margin-right: 12px !important;
    margin-top: -14px !important;
    vertical-align: middle;
  }
}

/* اطمینان از نمایش صحیح هدر در حالت موبایل */
@media (max-width: 767.98px) {
    .navbar,
    .navbar.fixed-top,
    .navbar .container-fluid {
        padding-left: 0.75rem !important;
        padding-right: 0.75rem !important;
    }
    .navbar.fixed-top {
        position: fixed !important;
        top: 0.5rem !important;
        left: 0.5rem !important;
        right: 0.5rem !important;
        width: calc(100% - 1rem) !important;
        max-width: calc(100% - 1rem) !important;
        box-sizing: border-box !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    
    .navbar-brand img {
        height: 60px !important;
        width: auto !important;
    }
    
    .btn-sm {
        font-size: 0.75rem !important;
        padding: 0.25rem 0.5rem !important;
    }
}

/* حذف padding اضافی body در موبایل که ممکن است روی هدر تأثیر بگذارد */
@media (max-width: 600px) {
    body {
        padding: 0 !important;
        margin: 0 !important;
    }
    
    .container {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
        max-width: 100% !important;
    }
    
    .card {
        margin-left: 1rem !important;
        margin-right: 1rem !important;
        border-radius: 0.5rem !important;
    }
    
    .table-responsive {
        border-radius: 0.5rem !important;
        overflow: hidden !important;
    }
    
    .table {
        font-size: 0.75rem !important;
    }
    
    .table th, .table td {
        padding: 0.5rem 0.25rem !important;
    }
}



.offcanvas.offcanvas-end {
  right: 0 !important;
  left: auto !important;
  transform: translateX(100%);
}
.offcanvas.offcanvas-end.show {
  transform: translateX(0);
}

.offcanvas.offcanvas-end .navbar-nav {
  align-items: flex-end !important;
}
.offcanvas.offcanvas-end .nav-item {
  width: 100%;
  margin-left: 0 !important;
  margin-right: 0 !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
}
.offcanvas.offcanvas-end .nav-link {
  text-align: right !important;
  padding-right: 1.5rem !important;
  padding-left: 0 !important;
}
.rtl-nav {
  direction: rtl;
}
.rtl-nav .nav-link {
  text-align: right;
  width: 100%;
}

/* فاصله آیکن‌های منوی موبایل از سمت راست */
.offcanvas .nav-item .bi {
    margin-right: 1rem;
    vertical-align: middle;
    display: flex;
    align-items: center;
    height: 1.5em;
    margin-top: 1.5rem; /* آیکن کمی پایین‌تر بیاید */
}
.offcanvas .dropdown-divider {
    border-top: 1px solid #e0e0e0; /* رنگ ملایم و ضخامت نازک */
    margin: 0 1.25rem; /* فاصله از چپ و راست */
    opacity: 1; /* کاملاً واضح */
    }

@media (max-width: 991px) {
  /* فاصله کارت‌های آزمون از چپ و راست صفحه */
  .tests-container, .quiz-cards-container, .row, .container {
    padding-left: 0.7rem !important;
    padding-right: 0.7rem !important;
  }
  /* کارت‌های آزمون کوچکتر و وسط با فاصله از دو طرف */
  .test-card, .quiz-card, .card {
    width: 92% !important;
    margin: 0.5rem auto !important;
    min-width: 0 !important;
    max-width: 350px;
    box-sizing: border-box;
    padding: 0.5rem 0.5rem !important;
    gap: 0.3rem !important;
  }
  /* عنوان کارت‌های آزمون کوچکتر */
  .card-title, .test-card-title, .quiz-card-title, .card h2, .card h3 {
    font-size: 0.9rem !important;
    margin-bottom: 0.5rem !important;
  }
  /* فاصله زیرمجموعه‌ها از هم و از عنوان */
  .test-card a, .quiz-card a, .card a,
  .test-card button, .quiz-card button, .card button,
  .test-card span, .quiz-card span, .card span,
  .test-card p, .quiz-card p, .card p {
    margin-top: 0.3rem !important;
    margin-bottom: 0.3rem !important;
    transition: background 0.2s;
    font-size: 0.92rem !important;
  }
  .test-card a:hover, .quiz-card a:hover, .card a:hover,
  .test-card button:hover, .quiz-card button:hover, .card button:hover,
  .test-card span:hover, .quiz-card span:hover, .card span:hover,
  .test-card p:hover, .quiz-card p:hover, .card p:hover {
    background: #e3f0ff !important;
  }
  /* دکمه شروع آزمون کوچکتر */
  .start-btn, .check-btn {
    font-size: 1rem !important;
    padding: 0.5rem 0 !important;
    min-height: 36px !important;
    height: auto !important;
  }
}

@media (max-width: 600px) {
    .check-btn {
        padding-top: 18px !important;
        padding-bottom: 18px !important;
        min-height: 48px !important;
        font-size: 1.15rem;
    }
}

/* ================= Test Mode Selector Styles ================= */
.test-mode-selector {
    background: #ffffff;
    border-radius: 16px;
    padding: 20px;
    margin: 20px auto;
    max-width: 800px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    border: 1px solid #e5e5e5;
}

.mode-options {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

.mode-option {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 12px 20px;
    border-radius: 12px;
    border: 2px solid #e5e5e5;
    background: #ffffff;
    transition: all 0.3s ease;
    min-width: 140px;
    justify-content: center;
    white-space: nowrap;
}

.mode-option:hover {
    border-color: #007bff;
    background: #f8f9ff;
}

.mode-option input[type="radio"] {
    display: none;
}

.mode-option input[type="radio"]:checked + .mode-label {
    color: #007bff;
    font-weight: 600;
}

.mode-option input[type="radio"]:checked ~ .mode-option {
    border-color: #007bff;
    background: #f8f9ff;
}

.mode-label {
    font-size: 1.1rem;
    font-weight: 500;
    color: #666;
    transition: all 0.3s ease;
}

.mode-option input[type="radio"]:checked + .mode-label {
    color: #007bff;
    font-weight: 600;
}

/* ================= Combined Test Controls Styles ================= */
.combined-test-controls {
    background: #ffffff;
    border-radius: 16px;
    padding: 25px;
    margin: 20px auto;
    max-width: 800px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    border: 1px solid #e5e5e5;
}

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

.combined-header h3 {
    margin: 0;
    font-size: 1.3rem;
    color: #333;
    font-weight: 600;
}



.combined-actions {
    display: flex;
    gap: 10px;
}

.select-all-btn, .deselect-all-btn {
    padding: 8px 16px;
    border: 2px solid #007bff;
    background: #ffffff;
    color: #007bff;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.select-all-btn:hover, .deselect-all-btn:hover {
    background: #007bff;
    color: #ffffff;
}

.grammar-checkboxes {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-bottom: 25px;
    height: auto;             /* ارتفاع بر اساس محتوا */
    max-height: 320px;        /* در صورت زیاد بودن آیتم‌ها اسکرول فعال شود */
    overflow-y: auto;
    padding: 15px;
    border: 1px solid #e5e5e5;
    border-radius: 12px;
    background: #fafafa;
    align-items: start;
    grid-auto-rows: min-content;
}

.grammar-checkbox-item {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    background: #ffffff;
    border-radius: 8px;
    border: 1px solid #e5e5e5;
    transition: all 0.3s ease;
    cursor: pointer;
    height: fit-content;
    min-height: 50px;
    user-select: none;
}

.grammar-checkbox-item:hover {
    border-color: #007bff;
    background: #f8f9ff;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 123, 255, 0.15);
}

.grammar-checkbox-item:active {
    transform: translateY(0);
    box-shadow: 0 1px 4px rgba(0, 123, 255, 0.1);
}

.grammar-checkbox-item input[type="checkbox"] {
    margin-left: 10px;
    width: 18px;
    height: 18px;
    accent-color: #007bff;
}

.grammar-checkbox-item label {
    flex: 1;
    font-size: 1rem;
    color: #333;
    cursor: pointer;
    margin: 0;
    transition: color 0.3s ease;
}

.grammar-checkbox-item label:hover {
    color: #007bff;
}

.combined-test-actions {
    text-align: center;
}

.start-combined-test-btn {
    padding: 15px 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #ffffff;
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.start-combined-test-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
}

.start-combined-test-btn:disabled {
    background: #cccccc;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

/* Hide quiz cards when in combined mode */
.quiz-card-container.combined-mode .quiz-card {
    display: none;
}

/* Always show student quiz card in single mode */
.quiz-card-container:not(.combined-mode) .quiz-card.student-quiz-card {
    display: block !important;
}

/* Responsive styles */
@media (max-width: 768px) {
    .test-mode-selector {
        margin: 15px;
        padding: 15px;
    }
    
    .mode-options {
        flex-direction: row;
        gap: 10px;
        justify-content: center;
    }
    
    .mode-option {
        min-width: auto;
        flex: 1;
        max-width: 160px;
        white-space: nowrap;
    }
    
    .combined-test-controls {
        margin: 15px;
        padding: 20px;
    }
    
    .combined-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .combined-actions {
        width: 100%;
        justify-content: center;
    }
    
    .grammar-checkboxes {
        grid-template-columns: repeat(2, 1fr);
        height: auto;
        max-height: 260px;
        gap: 10px;
    }
    
    .grammar-checkbox-item {
        padding: 8px 10px;
    }
    
    .grammar-checkbox-item:hover {
        transform: translateY(-1px);
        box-shadow: 0 2px 6px rgba(0, 123, 255, 0.15);
    }
    
    .grammar-checkbox-item label {
        font-size: 0.9rem;
        transition: color 0.3s ease;
    }
    
    .grammar-checkbox-item label:hover {
        color: #007bff;
    }
}

@media (max-width: 600px) {
    .test-mode-selector {
        margin: 10px;
        padding: 12px;
    }
    
    .mode-options {
        gap: 8px;
    }
    
    .mode-option {
        max-width: 130px;
        padding: 10px 15px;
        white-space: nowrap;
    }
    
    .mode-label {
        font-size: 1rem;
    }
    
    .combined-test-controls {
        margin: 10px;
        padding: 15px;
    }
    
    .combined-header h3 {
        font-size: 1.1rem;
    }
    
    .select-all-btn, .deselect-all-btn {
        padding: 6px 12px;
        font-size: 0.85rem;
    }
    
    .start-combined-test-btn {
        padding: 12px 24px;
        font-size: 1rem;
    }
    
    .grammar-checkboxes {
        grid-template-columns: repeat(2, 1fr);
        height: auto;
        max-height: 220px;
        gap: 8px;
    }
    
    .grammar-checkbox-item {
        padding: 6px 8px;
    }
    
    .grammar-checkbox-item label {
        font-size: 0.85rem;
        transition: color 0.3s ease;
    }
    
    .grammar-checkbox-item label:hover {
        color: #007bff;
    }
}

@media (max-width: 480px) {
    .test-mode-selector {
        margin: 8px;
        padding: 10px;
    }
    
    .mode-options {
        gap: 6px;
    }
    
    .mode-option {
        max-width: 110px;
        padding: 8px 12px;
        white-space: nowrap;
    }
    
    .mode-label {
        font-size: 0.9rem;
    }
    
    .grammar-checkboxes {
        grid-template-columns: repeat(2, 1fr);
        height: auto;
        max-height: 200px;
        gap: 6px;
        padding: 10px;
    }
    
    .grammar-checkbox-item {
        padding: 5px 6px;
        min-height: 40px;
    }
    
    .grammar-checkbox-item label {
        font-size: 0.8rem;
        transition: color 0.3s ease;
    }
    
    .grammar-checkbox-item label:hover {
        color: #007bff;
    }
    
    .grammar-checkbox-item input[type="checkbox"] {
        width: 16px;
        height: 16px;
        margin-left: 8px;
    }
}

/* ================= Celebration Styles ================= */
.celebration-container {
    text-align: center;
    margin-bottom: 15px;
    animation: celebration-bounce 0.6s ease-in-out;
}

.celebration-emoji {
    font-size: 3rem;
    margin-bottom: 10px;
    animation: celebration-rotate 2s ease-in-out infinite;
}

.celebration-text {
    font-size: 1.2rem;
    color: #28a745;
    font-weight: 600;
    margin-bottom: 10px;
    animation: celebration-pulse 1s ease-in-out infinite;
}

.celebration-sparkle {
    position: fixed;
    font-size: 1.5rem;
    pointer-events: none;
    z-index: 10000;
    animation: sparkle-fall 5s linear forwards;
    top: -50px;
}

.firework {
    position: fixed;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    pointer-events: none;
    z-index: 10001;
    animation: firework-explode 3s ease-out forwards;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.8);
}

.firework-particle {
    position: absolute;
    width: 3px;
    height: 3px;
    border-radius: 50%;
    animation: particle-fly 3s ease-out forwards;
    box-shadow: 0 0 5px rgba(255, 255, 255, 0.6);
}

@keyframes celebration-bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-20px);
    }
    60% {
        transform: translateY(-10px);
    }
}

@keyframes celebration-rotate {
    0% {
        transform: rotate(0deg) scale(1);
    }
    25% {
        transform: rotate(90deg) scale(1.2);
    }
    50% {
        transform: rotate(180deg) scale(1);
    }
    75% {
        transform: rotate(270deg) scale(1.2);
    }
    100% {
        transform: rotate(360deg) scale(1);
    }
}

@keyframes celebration-pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.1);
        opacity: 0.8;
    }
}

@keyframes sparkle-fall {
    0% {
        transform: translateY(-50px) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) rotate(360deg);
        opacity: 0;
    }
}

@keyframes firework-explode {
    0% {
        transform: scale(0);
        opacity: 1;
    }
    50% {
        transform: scale(1);
        opacity: 1;
    }
    100% {
        transform: scale(0);
        opacity: 0;
    }
}

@keyframes particle-fly {
    0% {
        transform: rotate(var(--rotation)) translateY(0) scale(1);
        opacity: 1;
    }
    100% {
        transform: rotate(var(--rotation)) translateY(100px) scale(0);
        opacity: 0;
    }
}

/* Responsive celebration styles */
@media (max-width: 768px) {
    .celebration-emoji {
        font-size: 2.5rem;
    }
    
    .celebration-text {
        font-size: 1rem;
    }
    
    .celebration-sparkle {
        font-size: 1.2rem;
    }
}

@media (max-width: 480px) {
    .celebration-emoji {
        font-size: 2rem;
    }
    
    .celebration-text {
        font-size: 0.9rem;
    }
    
    .celebration-sparkle {
        font-size: 1rem;
    }
}

.firework-rocket {
    position: fixed;
    width: 8px;
    height: 28px;
    border-radius: 4px 4px 12px 12px;
    background: #ffd93d;
    z-index: 10002;
    left: 50%;
    bottom: -40px;
    box-shadow: 0 0 12px 2px #fffbe6, 0 0 2px 1px #ffd93d;
    transition: bottom 0.7s cubic-bezier(0.22, 1, 0.36, 1);
    /* Add a little shake */
    animation: rocket-shake 0.7s linear infinite alternate;
}
@keyframes rocket-shake {
    0% { transform: translateX(0); }
    20% { transform: translateX(-2px); }
    40% { transform: translateX(2px); }
    60% { transform: translateX(-1px); }
    80% { transform: translateX(1px); }
    100% { transform: translateX(0); }
}
.firework {
    position: fixed;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    pointer-events: none;
    z-index: 10001;
    animation: firework-burst 1.2s cubic-bezier(0.22, 1, 0.36, 1) forwards;
    box-shadow: 0 0 18px 4px #fffbe6, 0 0 2px 1px #ffd93d;
}
@keyframes firework-burst {
    0% {
        transform: scale(0.5);
        opacity: 1;
    }
    60% {
        transform: scale(1.5);
        opacity: 1;
    }
    100% {
        transform: scale(0.2);
        opacity: 0;
    }
}
.firework-particle {
    position: absolute;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    animation: particle-burst 1.2s cubic-bezier(0.22, 1, 0.36, 1) forwards;
    box-shadow: 0 0 8px 2px #fffbe6;
}
@keyframes particle-burst {
    0% {
        transform: rotate(var(--rotation)) translateY(0) scale(1);
        opacity: 1;
    }
    80% {
        transform: rotate(var(--rotation)) translateY(60px) scale(1.2);
        opacity: 1;
    }
    100% {
        transform: rotate(var(--rotation)) translateY(80px) scale(0.2);
        opacity: 0;
    }
}

#fireworks-canvas {
    position: fixed;
    left: 0;
    top: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: auto;
    z-index: 10010;
    background: transparent;
    display: block;
}

/* Ensure quiz buttons and modals are above fireworks canvas */
.quiz-results {
    z-index: 10020;
    position: relative;
}

.quiz-results button,
.results-buttons button,
#restart-btn,
#close-quiz-btn,
#return-to-list-btn {
    z-index: 10025;
    position: relative;
}

.modal-overlay,
#confirm-modal-overlay,
#public-result-modal-overlay {
    z-index: 10030;
}

.modal,
.confirm-modal {
    z-index: 10035;
}