.gpq-container,
.gpq-question,
.gpq-form,
.gpq-textarea,
.gpq-text-answer {
    direction: ltr !important;
    text-align: left !important;
}

/* Container */
.gpq-container {
    border: 1px solid #e1e1e1;
    padding: 12px;
    margin-bottom: 18px;
    border-radius: 6px;
    background: #fff;
}

/* Question */
.gpq-question {
    margin-bottom: 10px;
    display: flex;
    flex-direction: column;
}

.gpq-question .gpq-media {
    order: -1;
}

/* Timer */
.gpq-timer {
    font-weight: 600;
    margin-bottom: 8px;
}

/* Result */
.gpq-result {
    margin-top: 10px;
    padding: 8px;
    background: #f7f7f7;
    border-radius: 4px;
}

.gpq-result.passed {
    background: #e8f8ee;
    border: 1px solid #c6f0d7;
}

/* Buttons */
.gpq-btn {
    display: inline-block;
    padding: 10px 14px;
    background: #0073aa;
    color: #fff;
    border-radius: 4px;
    text-decoration: none;
    margin-top: 8px;
}

.gpq-btn-next {
    background: #0c8c00;
}

/* Locked */
.gpq-locked {
    background: #fff3f3;
    border: 1px solid #ffd0d0;
    padding: 10px;
    border-radius: 6px;
}

.gpq-locked-btn {
    background: #ddd;
    color: #666;
    padding: 8px 12px;
    border-radius: 4px;
    border: none;
}

/* Certificate */
.gpq-certificate {
    text-align: center;
    margin-top: 12px;
}

.gpq-certificate-btn {
    display: inline-block;
    padding: 14px 22px;
    border-radius: 10px;
    border: 3px solid #cfa10a;
    background: linear-gradient(180deg, #fff6d6, #fff0b2);
    color: #6b4a00;
    font-weight: 700;
    text-decoration: none;
    box-shadow: 0 6px 18px rgb(0 0 0 / .12);
    font-size: 1.05rem;
}

/* Textarea */
.gpq-textarea {
    width: 100%;
    min-height: 300px;
    resize: vertical;
    font-size: 16px;
    padding: 10px;
    line-height: 1.6;
    border-radius: 8px;
    border: 1px solid #ccc;
}

/* Text Answer */
.gpq-text-answer {
    width: 100%;
    min-height: 300px;
    font-size: 16px;
    line-height: 1.6;
    padding: 12px;
    border-radius: 8px;
    border: 1px solid #ccc;
    box-sizing: border-box;
    resize: vertical;
    overflow-wrap: break-word;
    white-space: pre-wrap;
}

/* Overlay timer */
.gpq-overlay-timer {
    position: fixed;
    inset: 0;
    background: rgb(0 0 0 / .65);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 99999;
    backdrop-filter: blur(6px);
}

.gpq-overlay-box {
    background: #fff;
    border-radius: 18px;
    padding: 40px 60px;
    text-align: center;
    box-shadow: 0 0 25px rgb(0 0 0 / .3);
    font-family: 'Segoe UI', sans-serif;
    animation: gpqFadeIn 0.6s ease-out;
}

.gpq-overlay-box h2 {
    margin-bottom: 10px;
    color: #333;
}

.gpq-overlay-box p {
    font-size: 1.1em;
    color: #444;
}

@keyframes gpqFadeIn {
    from {
        opacity: 0;
        transform: scale(.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Pass/Fail overlays */
.gpq-overlay-fail,
.gpq-overlay-pass {
    animation: gpqFadeIn 0.4s ease-out;
}

/* Final overlay */
.final-overlay {
    position: fixed;
    inset: 0;
    background: rgb(222 222 222 / .95);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    text-align: center;
    font-family: 'Poppins', sans-serif;
    animation: final-fadein 0.5s ease;
}

.final-overlay-content {
    background: #fff;
    border-radius: 24px;
    padding: 40px 60px;
    box-shadow: 0 8px 25px rgb(0 0 0 / .1);
    max-width: 480px;
    position: relative;
}

.final-close-btn {
    position: absolute;
    top: 15px;
    right: 20px;
    background: none;
    border: none;
    font-size: 1.8rem;
    cursor: pointer;
    color: #555;
    transition: transform 0.2s ease;
}

.final-close-btn:hover {
    transform: rotate(90deg);
    color: #111;
}

.final-title {
    font-size: 2.2rem;
    color: #008f39;
    font-weight: 700;
    margin-bottom: 15px;
}

.final-text {
    font-size: 1.2rem;
    color: #444;
    margin-bottom: 30px;
    line-height: 1.5;
}

.final-btn-group {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.final-btn {
    display: inline-block;
    padding: 12px 22px;
    border-radius: 10px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
}

.final-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgb(0 0 0 / .1);
}

.final-btn-gold {
    background: #f5c400;
    color: #222;
}

.final-btn-green {
    background: #008f39;
    color: #fff;
}

/* Final responsive */
@media (max-width: 600px) {
    .final-overlay-content {
        padding: 30px 25px;
        width: 90%;
    }
    .final-title {
        font-size: 1.8rem;
    }
    .final-text {
        font-size: 1rem;
    }
    .final-btn {
        font-size: .95rem;
        padding: 10px 18px;
    }
}

@keyframes final-fadein {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Common overlay */
.gpq-overlay-common {
    position: fixed;
    inset: 0;
    background: rgb(0 0 0 / .62);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100000;
    font-family: "Segoe UI", Roboto, Arial, sans-serif;
}

.gpq-overlay-card {
    background: #fff;
    border-radius: 12px;
    width: 92%;
    max-width: 520px;
    box-shadow: 0 18px 50px rgb(12 20 30 / .45);
    overflow: visible;
    transform: translateY(4px);
    animation: gpq-card-in 260ms ease-out;
}

.gpq-overlay-card-body {
    padding: 26px 28px;
    text-align: center;
    color: #333;
}

.gpq-overlay-icon {
    font-size: 36px;
    margin-bottom: 10px;
}

.gpq-overlay-message {
    font-size: 18px;
    line-height: 1.4;
    margin-bottom: 16px;
}

.gpq-overlay-actions {
    margin-top: 8px;
}

.gpq-overlay-btn {
    display: inline-block;
    padding: 10px 18px;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 600;
    box-shadow: 0 6px 18px rgb(0 0 0 / .08);
}

.gpq-fail-overlay .gpq-overlay-card {
    border: 1px solid rgb(255 120 60 / .08);
}

.gpq-overlay-btn-fail {
    background: #ff7043;
    color: #fff;
}

.gpq-pass-overlay .gpq-overlay-card {
    border: 1px solid rgb(76 175 80 / .08);
}

.gpq-overlay-btn-pass {
    background: #4caf50;
    color: #fff;
}

@keyframes gpq-card-in {
    from {
        opacity: 0;
        transform: translateY(8px) scale(.99);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Part label */
.gpq-part-label {
    font-weight: 700;
    color: #008f39;
    margin-bottom: 8px;
    font-family: 'Segoe UI', sans-serif;
}

.gpq-wordcount {
    margin-top: 6px;
    font-size: .95rem;
    color: #666;
}

/* Pause progress */
.gpq-pause-progress {
    width: 300px;
    height: 8px;
    border-radius: 5px;
    background: rgb(255 255 255 / .2);
    overflow: hidden;
}

.gpq-pause-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #ffd700, #ffb400);
    transition: width 1s linear;
}

/* Error */
.gpq-error {
    color: #a94442;
    background: #f2dede;
    border: 1px solid #ebcccc;
    padding: 8px;
    border-radius: 6px;
}

.final-overlay a.final-btn {
    text-decoration: none;
}

/* Media */
.gpq-media audio {
    width: 100% !important;
    margin: 10px 0 !important;
}

/* Image */
.gpq-media-image {
    width: auto !important;
    max-width: 650px !important;
    height: auto !important;
    text-align: left !important;
    border-radius: 0px !important;

    /* ===== NEW ===== */
    margin: 20px 0 30px 0 !important; 
    /* 20px bala, 30px paein — dorosto professional */

    display: block !important;
    box-shadow: 0 2px 6px rgb(0 0 0 / .1) !important;
    object-fit: contain !important;
}
@media (max-width: 600px) {
    .gpq-media-image {
        margin: 15px 0 20px 0 !important;
        max-width: 100% !important;
    }
}


/* Question text */
.gpq-qtext {
    font-weight: 700;
    font-size: 1rem;
    margin-bottom: .5rem;
    line-height: 1;
}

/* Teil Description */
.gpq-teil-desc {
    color: #0B3EBA;
    font-size: 1.1rem;
    font-weight: 450;
    margin-bottom: .5rem;
    line-height: 1.4;
}

/* Aufgabe Hinweis */
.gpq-aufgabe-hinweis {
    color: #0a3d62;
    font-size: 1rem;
    font-weight: 400;
    margin-bottom: .5rem;
    line-height: 1.4;
    font-style: italic;
}

/* Fixed header */
.gpq-fixed-header {
    position: fixed;
    top: 80px;
    left: 0;
    right: 0;
    margin: 0 auto;
    max-width: 900px;
    background: #F5F5F5;
    border: 1px solid #ddd;
    border-radius: 8px;
    z-index: 999;
    padding: 12px 20px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    box-shadow: 0 2px 8px rgba(0,0,0,0.12);
}

.gpq-container {
    padding-top: calc(80px + 20px);
}

.gpq-media {
    width: 100% !important;
    max-width: 650px !important;
    height: auto;
    display: block;
    overflow: hidden !important;
}


@media (max-width: 768px) {
    .gpq-container {
        padding-top: calc(65px + 20px);
    }
}

.gpq-group-image {
    margin-bottom: 25px !important;  /* فاصله از سوال اول */
    display: block;
}

.gpq-group-image + .gpq-media + gpq-media-image + .gpq-question {
    margin-top: 15px !important;
}

.gpq-fixed-header .gpq-part-label,
.gpq-fixed-header .gpq-level-label {
    font-weight: bold;
    font-family: 'Segoe UI', sans-serif;
    margin-bottom: 4px;
    text-align: left;
    width: 100%;
}

.gpq-fixed-header .gpq-part-label {
    color: #008f39;
}

.gpq-fixed-header .gpq-level-label {
    color: #0057e7;
}

.gpq-fixed-header .gpq-timer {
    font-weight: bold;
    color: #333;
    font-family: 'Segoe UI', sans-serif;
    text-align: left;
    width: 100%;
    margin-top: 4px;
}

@media(max-width: 768px) {
    .gpq-fixed-header {
        top: 65px;
        max-width: 95%;
        padding: 10px 14px;
        align-items: center;
        text-align: center;
    }

    .gpq-fixed-header .gpq-part-label,
    .gpq-fixed-header .gpq-level-label,
    .gpq-fixed-header .gpq-timer {
        text-align: center;
        width: 100%;
    }
}

/* Submit */
.gpq-submit {
    background: #007BFF;
    color: #fff;
    font-weight: 600;
    font-family: 'Segoe UI', sans-serif;
    border: none;
    border-radius: 8px;
    padding: 10px 22px;
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

.gpq-submit:hover {
    background: #005ad1;
    box-shadow: 0 3px 8px rgba(0,0,0,0.18);
    transform: translateY(-1px);
}

.gpq-submit:active {
    background: #0046a3;
    transform: translateY(1px);
}
.final-writing-parts {
    background: #1f1f1f;
    border: 1px solid #444;
    padding: 12px 15px;
    border-radius: 10px;
    margin: 18px 0;
    color: #fff;
    text-align: left;
}

.final-writing-title {
    font-weight: bold;
    font-size: 16px;
    margin-bottom: 10px;
    color: #FFD700;
}

.final-writing-item {
    background: #2b2b2b;
    padding: 8px 10px;
    border-radius: 6px;
    margin-bottom: 6px;
    font-size: 14px;
}
@media(max-width: 480px){
    .final-writing-parts {
        font-size: 14px;
    }
    .final-writing-item {
        font-size: 13px;
        padding: 6px 8px;
    }
}

/* GPQ audio player */
.gpq-audio-wrapper {
  margin: 18px 0 30px 0;
  padding: 12px;
  background: #fbfbfb;
  border: 1px solid #e6e6e6;
  border-radius: 10px;
  max-width: 720px;
}

.gpq-audio-play-btn {
  padding: 10px 14px;
  background: #007BFF;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  font-size: 15px;
}

.gpq-audio-play-btn:disabled {
  background: #6c757d;
  cursor: default;
  opacity: 0.9;
}

.gpq-audio-note {
  margin-top: 8px;
  font-size: 0.95rem;
  color: #444;
}

/* ===========================
   Anti-Cheat Warnbox (GPQ)
   =========================== */

.gpq-anti-cheat-warning {
  max-width: 960px;
  margin: 0 auto 18px auto;            /* zentriert */
  padding: clamp(10px, 2.5vw, 18px) clamp(12px, 4vw, 24px);
  background: #fffbe6;
  border: 1px solid #ffe58f;
  border-radius: 12px;
  box-sizing: border-box;
  text-align: center;
  /* etwas „gewichtiger“ Look */
  font-family:
    "Vazir",
    "Vazirmatn",
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Roboto,
    Helvetica,
    Arial,
    sans-serif;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.03);
}

.gpq-anti-cheat-title {
  font-size: clamp(16px, 3.6vw, 20px);
  font-weight: 700;
  color: #ad6800;
  margin-bottom: 8px;
}

.gpq-anti-cheat-text {
  font-size: clamp(13px, 3.2vw, 15px);
  line-height: 1.6;
  color: #595959;
}

/* Deutsche Zeile */
.gpq-anti-cheat-text-de {
  margin-bottom: 6px;
}

/* Persische Zeile – Vazir + RTL */
.gpq-anti-cheat-text-fa {
  direction: rtl;
  text-align: center;  /* zentriert, aber RTL-Reihenfolge bleibt */
  font-weight: 600;    /* etwas fetter, damit es hervorsticht */
}

/* leichte Anpassungen für sehr kleine Screens */
@media (max-width: 480px) {
  .gpq-anti-cheat-warning {
    margin-bottom: 14px;
    border-radius: 10px;
  }

  .gpq-anti-cheat-title {
    margin-bottom: 6px;
  }
}


