/* =========================================================
   YAZEED ENGLISH — STEP LISTENING PRACTICE
   CLEAN STYLE.CSS
   ========================================================= */

/* =========================================================
   VARIABLES
   ========================================================= */

:root {
    --paper: #F5F6F2;
    --ink: #00273A;
    --ink-soft: #5B645F;

    --indigo: #00689B;
    --indigo-dark: #00567F;

    --line: #DCDFD6;
    --card: #FFFFFF;
    --white: #FFFFFF;

    --correct: #16A34A;
    --correct-bg: #F0FDF4;
    --correct-border: #86EFAC;

    --incorrect: #DC2626;
    --incorrect-bg: #FEF2F2;
    --incorrect-border: #FCA5A5;

    --player: #0B1115;

    --shadow: 0 18px 45px rgba(0, 39, 58, 0.07);
}

/* =========================================================
   DARK MODE
   ========================================================= */

body.dark {
    --paper: #15181C;
    --ink: #E8EAE4;
    --ink-soft: #9AA39B;

    --card: #1E2227;
    --line: #33383B;

    --indigo: #0088C7;
    --indigo-dark: #0075AA;

    --correct: #4ADE80;
    --correct-bg: #12271A;
    --correct-border: #277A42;

    --incorrect: #F87171;
    --incorrect-bg: #2A1618;
    --incorrect-border: #8F3438;

    --player: #0B1115;
}

/* =========================================================
   RESET
   ========================================================= */

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: "Tajawal", sans-serif;
    background: var(--paper);
    color: var(--ink);
    transition: background 0.25s ease, color 0.25s ease;
}

button,
input,
select {
    font-family: inherit;
}

button {
    -webkit-tap-highlight-color: transparent;
}

.hidden {
    display: none !important;
}

/* =========================================================
   TOP HEADER
   ========================================================= */

.top-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 35px;
    border-bottom: 1px solid var(--line);
    background: var(--card);
    position: relative;
    z-index: 10;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-logo {
    width: 42px;
    height: 42px;
    object-fit: contain;
    flex-shrink: 0;
}

.brand-text {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.brand-text strong {
    font-size: 15px;
    font-weight: 900;
}

.brand-text span {
    font-size: 11px;
    color: var(--ink-soft);
    margin-left: 8%;
    text-align: center;
}

.theme-buttons {
    display: flex;
    align-items: center;
}

.theme-btn {
    width: 38px;
    height: 38px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--card);
    color: var(--ink);
    cursor: pointer;
    transition: 0.2s;
    font-size: 16px;
}

.theme-btn:hover {
    border-color: var(--indigo);
    transform: translateY(-2px);
}

/* =========================================================
   MAIN
   ========================================================= */

.main-website {
    width: 100%;
    max-width: 1050px;
    margin: 0 auto;
    padding: 0 25px 70px;
}

.listening-page {
    width: 100%;
}

/* =========================================================
   PAGE HEADER
   ========================================================= */

.page-header {
    text-align: center;
    padding: 68px 20px 35px;
}

.page-label {
    color: var(--indigo);
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 2px;
}

.page-header h1 {
    margin: 8px 0;
    font-size: 46px;
    line-height: 1.2;
    font-weight: 900;
}

.page-header p {
    max-width: 620px;
    margin: 0 auto;
    color: var(--ink-soft);
    line-height: 1.9;
    font-size: 15px;
}

/* =========================================================
   STATUS
   ========================================================= */

.practice-status {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    margin-bottom: 18px;
}

.listening-number {
    font-size: 14px;
    color: var(--ink-soft);
    font-weight: 700;
}

.listening-number strong {
    color: var(--indigo);
    font-size: 18px;
    font-weight: 900;
}

.live-score {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 14px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--card);
    font-size: 12px;
    font-weight: 800;
}

.correct-score {
    color: var(--correct);
}

.incorrect-score {
    color: var(--incorrect);
}

.score-separator {
    color: var(--ink-soft);
}

/* =========================================================
   AUDIO CARD
   ========================================================= */

.audio-card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 22px;
    box-shadow: var(--shadow);
    overflow: hidden;
    margin-bottom: 35px;
}

.audio-card-header {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 22px 25px 18px;
}

.audio-icon {
    width: 48px;
    height: 48px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    background: var(--paper);
    border: 1px solid var(--line);
    font-size: 21px;
}

.audio-card-header h2 {
    margin: 0 0 3px;
    font-size: 19px;
    font-weight: 900;
}

.audio-card-header p {
    margin: 0;
    color: var(--ink-soft);
    font-size: 12px;
}

/* =========================================================
   CUSTOM AUDIO PLAYER
   ========================================================= */

.custom-player {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0 20px;
    padding: 15px 16px;
    background: var(--player);
    border-radius: 15px;
    color: white;
}

.play-btn {
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
    border: none;
    border-radius: 50%;
    background: var(--indigo);
    color: white;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    transition: transform 0.18s ease, opacity 0.18s ease;
    -webkit-appearance: none;
    appearance: none;
}

.play-btn:hover {
    transform: scale(1.06);
    opacity: 0.92;
}

/* CSS PLAY ICON — NO EMOJI / NO UNICODE */
.play-symbol {
    display: block;
    width: 0;
    height: 0;
    border-top: 9px solid transparent;
    border-bottom: 9px solid transparent;
    border-left: 14px solid currentColor;
    margin-left: 3px;
}

/* CSS PAUSE ICON — NO UNICODE */
.pause-symbol {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    width: 14px;
    height: 18px;
}

.pause-symbol::before,
.pause-symbol::after {
    content: "";
    display: block;
    width: 5px;
    height: 18px;
    background: currentColor;
    border-radius: 1px;
}

.player-main {
    min-width: 0;
    flex: 1;
}

.time-row {
    display: flex;
    justify-content: space-between;
    color: #B8C1C7;
    font-size: 10px;
    margin-bottom: 4px;
    direction: ltr;
}

.audio-progress {
    display: block;
    width: 100%;
    height: 5px;
    margin: 0;
    accent-color: var(--indigo);
    cursor: pointer;
}

.player-icon-btn {
    border: none;
    background: transparent;
    color: white;
    width: 30px;
    height: 30px;
    padding: 0;
    cursor: pointer;
    font-size: 16px;
}

.volume-bar {
    width: 80px;
    accent-color: var(--indigo);
    cursor: pointer;
}

.speed-select {
    min-width: 62px;
    padding: 7px 8px;
    border: 1px solid #39434A;
    border-radius: 8px;
    background: #11191E;
    color: white;
    outline: none;
    cursor: pointer;
    font-size: 11px;
}

.player-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    padding: 13px 25px 18px;
}

.restart-btn {
    border: none;
    background: transparent;
    color: var(--indigo);
    padding: 4px 0;
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
}

.restart-btn:hover {
    text-decoration: underline;
}

.unlimited-label {
    color: var(--ink-soft);
    font-size: 11px;
}

/* =========================================================
   QUESTIONS
   ========================================================= */

.questions-section {
    margin-top: 15px;
}

.questions-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 15px;
    margin-bottom: 17px;
}

.section-label {
    color: var(--indigo);
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 2px;
}

.questions-heading h2 {
    margin: 3px 0 0;
    font-size: 27px;
    font-weight: 900;
}

.question-count {
    color: var(--ink-soft);
    font-size: 12px;
    font-weight: 700;
}

.questions-container {
    display: flex;
    flex-direction: column;
    gap: 17px;
}

/* =========================================================
   QUESTION CARD
   ========================================================= */

.question-card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 23px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.question-card:hover {
    box-shadow: 0 10px 30px rgba(0, 39, 58, 0.05);
}

.question-top {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 28px;
    direction: ltr;
}

.question-number {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    border-radius: 9px;
    background: var(--paper);
    border: 1px solid var(--line);
    color: var(--indigo);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 900;
}

.question-text {
    margin: 0;
    padding-top: 4px;
    font-size: 17px;
    line-height: 1.65;
    font-weight: 800;
    direction: ltr;
    text-align: left;
}

.answers {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    direction: ltr;
    margin-top: 5px;
}

.answer-btn {
    min-height: 54px;
    padding: 11px 14px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--paper);
    color: var(--ink);
    cursor: pointer;
    text-align: left;
    font-size: 14px;
    line-height: 1.45;
    font-weight: 700;
    transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}

.answer-btn:hover:not(:disabled) {
    border-color: var(--indigo);
    transform: translateY(-2px);
}

.answer-btn:disabled {
    cursor: default;
}

.answer-btn.correct {
    border-color: var(--correct-border);
    background: var(--correct-bg);
    color: var(--correct);
}

.answer-btn.incorrect {
    border-color: var(--incorrect-border);
    background: var(--incorrect-bg);
    color: var(--incorrect);
}

.answer-btn.correct-reveal {
    border-color: var(--correct-border);
    background: var(--correct-bg);
    color: var(--correct);
}

.answer-result {
    display: flex;
    align-items: center;
    gap: 7px;
    margin-top: 13px;
    min-height: 22px;
    font-size: 13px;
    font-weight: 900;
    direction: rtl;
    text-align: right;
}

.answer-result.correct-message {
    color: var(--correct);
}

.answer-result.incorrect-message {
    color: var(--incorrect);
}

.result-icon {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 12px;
}

.correct-message .result-icon {
    background: var(--correct);
}

.incorrect-message .result-icon {
    background: var(--incorrect);
}

.answer-explanation {
    margin: 4px 0 0;
    color: var(--ink-soft);
    font-size: 11px;
    direction: rtl;
    text-align: right;
}

/* =========================================================
   NEXT / PREVIOUS NAVIGATION
   ========================================================= */

.next-section {
    margin-top: 32px;
    padding: 24px;
    text-align: center;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 18px;
}

.next-section p {
    margin: 0 0 15px;
    color: var(--ink-soft);
    font-size: 13px;
}

/* IMPORTANT:
   The two buttons are controlled together here. */
.listening-navigation {
    width: 100%;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 12px;
    direction: rtl;
}

.listening-navigation button {
    min-width: 170px;
    min-height: 48px;
    padding: 12px 22px;
    border-radius: 12px;
    font-family: "Tajawal", sans-serif;
    font-size: 14px;
    font-weight: 900;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    transition: transform 0.18s ease, opacity 0.18s ease, border-color 0.18s ease;
}

/* NEXT BUTTON — KEEP ORIGINAL BLUE */
.listening-navigation .next-btn {
    background: var(--indigo);
    color: white;
    border: none;
    box-shadow: none;
}

/* PREVIOUS BUTTON — WHITE */
.listening-navigation .previous-btn {
    background: #FFFFFF;
    color: #00273A;
    border: 1px solid #DCDFD6;
    box-shadow: 0 4px 14px rgba(0, 39, 58, 0.06);
}

/* Previous button stays white in dark mode */
body.dark .listening-navigation .previous-btn {
    background: #FFFFFF;
    color: #00273A;
    border-color: #FFFFFF;
}

.listening-navigation button:hover:not(:disabled) {
    transform: translateY(-2px);
    border-color: var(--indigo);
}

.listening-navigation button:active:not(:disabled) {
    transform: translateY(0);
}

.listening-navigation button:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    transform: none;
}

/* =========================================================
   FOOTER
   ========================================================= */

.site-footer {
    margin-top: 20px;
    padding: 0 25px 30px;
    text-align: center;
}

.footer-line {
    width: 100%;
    height: 1px;
    margin-bottom: 20px;
    background: var(--line);
}

.site-footer p {
    margin: 0;
    color: var(--ink-soft);
    font-size: 12px;
    font-weight: 500;
}

/* =========================================================
   TABLET
   ========================================================= */

@media (max-width: 800px) {

    .main-website {
        padding-left: 18px;
        padding-right: 18px;
    }

    .page-header {
        padding-top: 50px;
    }

    .page-header h1 {
        font-size: 39px;
    }

    .answers {
        grid-template-columns: 1fr;
    }

    .custom-player {
        flex-wrap: wrap;
    }

    .player-main {
        min-width: calc(100% - 65px);
    }

    .volume-bar {
        width: 95px;
    }

    .speed-select {
        margin-left: auto;
    }
}

/* =========================================================
   MOBILE
   ========================================================= */

@media (max-width: 550px) {

    .top-header {
        padding: 14px 15px;
    }

    .brand-logo {
        width: 38px;
        height: 38px;
    }

    .theme-btn {
        width: 36px;
        height: 36px;
    }

    .main-website {
        padding-left: 13px;
        padding-right: 13px;
    }

    .page-header {
        padding: 42px 8px 28px;
    }

    .page-header h1 {
        font-size: 32px;
    }

    .page-header p {
        font-size: 13px;
    }

    .practice-status {
        align-items: flex-start;
        flex-direction: column;
        gap: 10px;
    }

    .live-score {
        width: 100%;
        justify-content: center;
    }

    .audio-card-header {
        padding: 19px;
    }

    .custom-player {
        margin: 0 12px;
        padding: 13px;
        gap: 9px;
    }

    .player-icon-btn {
        display: none;
    }

    .volume-bar {
        flex: 1;
        width: auto;
    }

    .speed-select {
        margin-left: 0;
    }

    .player-footer {
        padding-left: 19px;
        padding-right: 19px;
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }

    .question-card {
        padding: 17px;
    }

    .question-text {
        font-size: 15px;
    }

    .answers {
        grid-template-columns: 1fr;
    }

    /* MOBILE NAVIGATION */
    .listening-navigation {
        flex-direction: row;
        gap: 8px;
    }

    .listening-navigation button {
        min-width: 0;
        flex: 1;
        width: 50%;
        min-height: 48px;
        padding: 11px 8px;
        font-size: 14px;
    }
}
