/* Hide body/html scrollbars when intro page is active */
body.quiz-intro-active,
html.quiz-intro-active {
    overflow: hidden !important;
    height: 100%;
    margin: 0;
    padding: 0;
    scrollbar-width: none !important;
    -ms-overflow-style: none !important;
}

body.quiz-intro-active::-webkit-scrollbar,
html.quiz-intro-active::-webkit-scrollbar {
    display: none !important;
}

/* Hide Goftino widget immediately (prevents flash) */
#goftino_w,
[id*="goftino"],
[class*="goftino"] {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
}

@font-face {
    font-family: 'KalamehMehrRegular';
    src: url('../fonts/KalamehMehrRegular.ttf') format('truetype');
    font-weight: normal;
}

@font-face {
    font-family: 'KalamehMehrMedium';
    src: url('../fonts/KalamehMehrMedium.ttf') format('truetype');
    font-weight: 500;
}

.quiz-intro-page {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    width: 100vw;
    height: 100vh;
    height: 100dvh; /* Dynamic viewport height for mobile */
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn 0.6s ease-out;
    font-family: 'KalamehMehrRegular', sans-serif;
    overflow-x: hidden; /* No horizontal scroll */
    overflow-y: auto; /* Vertical scroll only when needed */
    scrollbar-width: none; /* Firefox - hide scrollbar */
    -ms-overflow-style: none; /* IE/Edge - hide scrollbar */
    padding: 70px 0 20px 0; /* Top padding clears the fixed copyright bar */
    direction: ltr; /* Ensure scrollbar appears on the right */
}

.quiz-intro-page::-webkit-scrollbar {
    display: none; /* Chrome/Safari - hide scrollbar */
}

.intro-content {
    background: rgba(255, 255, 255, 0.98);
    border-radius: 25px;
    padding: 20px 60px 50px 60px;
    max-width: 700px;
    width: 90%;
    text-align: center;
    direction: rtl;
    margin: 0 auto 20px auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

.intro-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.intro-logo {
    width: 185px;
    height: auto;
    margin: 0 auto;
    opacity: 0.9;
    display: block;
    padding-bottom: 60px;
}

.intro-header h1 {
    font-size: 32px;
    color: #2c3e50;
    margin: 0 0 30px 0;
    font-weight: 500;
    font-family: 'KalamehMehrMedium', sans-serif;
}

.intro-description {
    font-size: 20px;
    color: #555;
    line-height: 1.8;
    margin-bottom: 30px;
    font-family: 'KalamehMehrRegular', sans-serif;
}

.intro-instructions {
    background: #f8f9fa;
    border-radius: 15px;
    padding: 25px 30px;
    margin-bottom: 35px;
    text-align: right;
}

.intro-instructions h3 {
    font-size: 23px;
    color: #df9065;
    margin: 0 0 15px 0;
    font-family: 'KalamehMehrMedium', sans-serif;
    font-weight: 500;
}

.intro-instructions ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.intro-instructions li {
    font-size: 20px;
    color: #666;
    padding: 10px 0;
    padding-right: 30px;
    position: relative;
    line-height: 1.6;
    font-family: 'KalamehMehrRegular', sans-serif;
}

.intro-instructions li:before {
    content: "✓";
    position: absolute;
    right: 0;
    color: #df9065;
    font-weight: bold;
    font-size: 18px;
}

.start-quiz-btn {
    background: #df9065;
    color: white !important;
    border: none;
    border-radius: 50px;
    padding: 18px 50px;
    font-size: 20px;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 15px;
    font-family: 'KalamehMehrMedium', sans-serif;
    transition: background 0.15s ease;
    -webkit-tap-highlight-color: transparent;
}

.start-quiz-btn:hover,
.start-quiz-btn.pressed,
.start-quiz-btn:active {
  background: #c7764f;
  color: white !important;
}

.copyright-warning {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    padding: 10px 40px;
    background: #d32f2f;
    border-bottom: 3px solid #b71c1c;
    text-align: center;
    direction: rtl;
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.warning-icon {
    font-size: 32px;
    animation: pulse 2s infinite;
    flex-shrink: 0;
}

.warning-text {
    font-size: 18px;
    color: #ffffff;
    font-weight: bold;
    margin: 0;
    font-family: 'KalamehMehrMedium', sans-serif;
    line-height: 1.4;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.quiz-intro-page.hidden {
    animation: fadeOut 0.5s ease-out;
    pointer-events: none;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.15);
        opacity: 0.85;
    }
}

@media screen and (max-width: 768px) {
    .intro-content {
        padding: 20px 30px 40px 30px;
        margin: 0 auto 20px auto;
    }

    .intro-logo {
        width: 140px;
        padding-bottom: 40px;
    }

    .intro-header h1 {
        font-size: 26px;
        margin-bottom: 20px;
    }

    .intro-description {
        font-size: 17px;
        margin-bottom: 25px;
    }

    .intro-instructions {
        padding: 20px 25px;
        margin-bottom: 30px;
    }

    .intro-instructions h3 {
        font-size: 20px;
    }

    .intro-instructions li {
        font-size: 17px;
        padding: 8px 0;
        padding-right: 25px;
    }

    .start-quiz-btn {
        padding: 15px 40px;
        font-size: 18px;
    }

    .warning-text {
        font-size: 14px;
    }

    .copyright-warning {
        padding: 8px 20px;
    }
}

@media screen and (max-width: 480px) {
    .quiz-intro-page {
        padding: 55px 0 15px 0;
        align-items: flex-start; /* Allow content to scroll from top */
    }

    .intro-content {
        padding: 15px 20px 30px 20px;
        margin: 0 auto 15px auto;
        width: 95%;
    }

    .intro-logo {
        width: 120px;
        padding-bottom: 30px;
    }

    .intro-header h1 {
        font-size: 22px;
    }

    .intro-description {
        font-size: 15px;
        margin-bottom: 20px;
    }

    .intro-instructions {
        padding: 15px 20px;
        margin-bottom: 25px;
    }

    .intro-instructions h3 {
        font-size: 18px;
        margin-bottom: 12px;
    }

    .intro-instructions li {
        font-size: 15px;
        padding: 6px 0;
        padding-right: 22px;
    }

    .intro-instructions li:before {
        font-size: 16px;
    }

    .start-quiz-btn {
        padding: 12px 35px;
        font-size: 16px;
    }

    .warning-text {
        font-size: 11px;
    }

    .warning-icon {
        font-size: 24px;
    }

    .copyright-warning {
        padding: 6px 15px;
        gap: 10px;
    }
}
