/* =========================================================
   PAST QUESTIONS SETTINGS SCENE
   Namespace: pqss
   ========================================================= */

/* =========================================================
   ROOT SCENE
   ========================================================= */

.pqss-settings-root {
    position: absolute;
    inset: 0;

    background-color: #09103f;
    background-image: url("/client/assets/images/bg/quiz_bg_portrait.jpg");
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

@media (orientation: landscape) {
    .pqss-settings-root {
        background-image: url("/client/assets/images/bg/quiz_bg_landscape.jpg");
    }
}

/* =========================================================
   TOPBAR
   ========================================================= */

.pqss-topbar {
    position: absolute;
    top: 0;
    left: 0;

    width: 100%;

    display: flex;
    align-items: center;

    padding: 0 20px;

    background: #0a2a43;
    color: white;

    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);

    z-index: 1000;

    font-family: "Poppins", sans-serif;
}

/* Center title relative to topbar */

.pqss-topbar .pqss-exam-title {
    position: absolute;

    left: 50%;

    transform: translateX(-50%);

    font-weight: 600;
}

/* Back button */

.pqss-back-btn {
    position: absolute;

    left: 20px;

    background: #123d5c;

    border: none;

    padding: 8px 14px;

    border-radius: 6px;

    color: white;

    font-size: 12px;
    font-weight: 600;

    cursor: pointer;

    transition: transform 0.2s ease;
}

.pqss-back-btn:hover {
    transform: scale(1.05);
}

/* =========================================================
   MAIN SETTINGS CONTAINER
   ========================================================= */

.pqss-settings-container {
    position: absolute;

    top: 60px;
    left: 0;
    right: 0;
    bottom: 0;

    border-radius: 16px 16px 0 0;

    padding: 20px;

    display: flex;
    flex-direction: column;

    gap: 20px;

    overflow-y: auto;

    animation: pqss-fadeIn 0.5s ease forwards;
}

/* =========================================================
   EXAM FORMAT SECTION
   ========================================================= */

.pqss-format-section {
    display: grid;

    grid-template-columns: repeat(2, 1fr);

    gap: 16px;

    margin-bottom: 20px;
}

/* Format cards */

.pqss-format-card {
    flex: 1;

    min-width: 0;

    text-align: center;

    padding: 20px;

    font-weight: 500;

    border-radius: 12px;

    cursor: pointer;

    background: #0a2a43;
    color: white;

    transition:
        transform 0.25s ease,
        box-shadow 0.25s ease,
        background 0.2s ease;
}

.pqss-format-card:hover {
    background: #06325b;

    transform: translateY(-3px);

    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.2);
}

/* Selected format card */

.pqss-format-card.pqss-format-card-selected {
    background: #1e88e5;

    transform: translateY(-2px);

    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

/* =========================================================
   QUESTION FORMAT / GRADE CARDS
   ========================================================= */

.pqss-question-format {
    display: grid;

    grid-template-columns: repeat(2, 1fr);

    gap: 16px;
}

/* =========================================================
   SETTINGS SECTIONS
   ========================================================= */

.pqss-section {
    display: flex;

    align-items: center;
    justify-content: flex-start;

    gap: 12px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(255, 255, 255, 0.9);
    border-radius: 13px;
    box-shadow:
        0 4px 10px rgba(0, 0, 0, 0.08),
        0 1px 2px rgba(0, 0, 0, 0.05);
}

/* Section labels */

.pqss-section label {
    font-size: 13px;

    font-weight: 600;

    color: #333;

    white-space: nowrap;

    flex: 0 0 38%;
}

/* =========================================================
   CUSTOM DROPDOWNS
   ========================================================= */

.pqss-section .pqss-dropdown {
    position: relative;

    width: 60%;

    min-width: 100px;
    max-width: 160px;

    flex: 0 0 auto;

    margin-left: auto;
}

/* Selected dropdown value */

.pqss-dropdown-selected {
    display: flex;

    align-items: center;

    width: 100%;

    box-sizing: border-box;

    padding: 8px 10px;

    background: white;

    border: 1px solid #d0d7de;

    border-radius: 6px;

    color: #0a2a43;

    font-size: 12px;

    cursor: pointer;

    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease;
}

/* Down-arrow visual guide */

.pqss-dropdown-selected::after {
    content: "▼";

    margin-left: auto;

    flex-shrink: 0;

    font-size: 9px;

    color: #666;
}

.pqss-dropdown-selected:hover {
    border-color: #1e88e5;

    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
}

/* =========================================================
   DROPDOWN OPTIONS
   ========================================================= */

.pqss-dropdown-options {
    position: absolute;

    top: calc(100% + 4px);

    left: 0;
    right: 0;

    background: white;

    border: 1px solid #d0d7de;

    border-radius: 6px;

    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.18);

    z-index: 1500;

    overflow: hidden;

    max-height: 200px;

    overflow-y: auto;
}

/* Hidden dropdown state */

.pqss-dropdown-options.pqss-dropdown-options-hidden {
    display: none;
}

/* Open dropdown state */

.pqss-dropdown-options.pqss-dropdown-options-open {
    display: block;
}

/* Dropdown option */

.pqss-dropdown-option {
    padding: 8px 10px;

    background: white;

    color: #0a2a43;

    font-size: 12px;

    cursor: pointer;

    transition:
        background 0.2s ease,
        color 0.2s ease;
}

.pqss-dropdown-option:hover {
    background: #eaf4ff;

    color: #1e88e5;
}

/* =========================================================
   START QUIZ BUTTON
   ========================================================= */

.pqss-start-quiz-btn {
    width: 100%;

    padding: 16px;

    background: #0a2a43;

    color: white;

    font-weight: 600;

    font-size: 16px;

    border: none;

    border-radius: 12px;

    cursor: pointer;

    transition: all 0.25s ease;
}

.pqss-start-quiz-btn:hover {
    background: #06325b;

    transform: scale(1.02);

    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.2);
}

/* =========================================================
   VARIANT MODAL OVERLAY
   ========================================================= */

.pqss-variant-modal-overlay {
    position: fixed;

    top: 0;
    left: 0;
    right: 0;
    bottom: 0;

    background: rgba(10, 42, 67, 0.6);

    display: flex;

    align-items: center;
    justify-content: center;

    z-index: 2000;

    animation: pqss-fadeInOverlay 0.25s ease forwards;
}

/* =========================================================
   VARIANT MODAL
   ========================================================= */

.pqss-variant-modal {
    width: 85%;

    max-width: 320px;

    background: white;

    border-radius: 16px;

    padding: 20px;

    text-align: center;

    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);

    animation: pqss-scaleIn 0.25s ease forwards;

    font-family: "Poppins", sans-serif;
}

/* Modal title */

.pqss-variant-modal h3 {
    margin-bottom: 16px;

    color: #0a2a43;

    font-size: 18px;

    font-weight: 600;
}

/* =========================================================
   VARIANT OPTIONS
   ========================================================= */

.pqss-variant-options {
    display: flex;

    flex-direction: column;

    gap: 12px;

    margin-bottom: 16px;
}

/* Variant buttons */

.pqss-variant-btn {
    padding: 12px;

    border-radius: 10px;

    border: none;

    background: #0a2a43;

    color: white;

    font-weight: 500;

    cursor: pointer;

    transition: all 0.25s ease;
}

.pqss-variant-btn:hover {
    background: #1e88e5;

    transform: translateY(-2px);

    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

/* Cancel button */

.pqss-variant-cancel {
    background: transparent;

    border: none;

    color: #0a2a43;

    font-size: 14px;

    cursor: pointer;

    opacity: 0.7;

    transition: opacity 0.2s ease;
}

.pqss-variant-cancel:hover {
    opacity: 1;
}

/* =========================================================
   ANIMATIONS
   ========================================================= */

@keyframes pqss-fadeIn {
    0% {
        opacity: 0;

        transform: translateY(10px);
    }

    100% {
        opacity: 1;

        transform: translateY(0);
    }
}

@keyframes pqss-fadeInOverlay {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes pqss-scaleIn {
    from {
        transform: scale(0.9);

        opacity: 0;
    }

    to {
        transform: scale(1);

        opacity: 1;
    }
}

/* =========================================================
   RESPONSIVE TWEAKS
   ========================================================= */

@media (max-width: 400px) {
    .pqss-start-quiz-btn {
        padding: 14px;

        font-size: 15px;
    }

    .pqss-topbar {
        height: 65px;

        padding: 0 16px;

        font-size: 16px;
    }

    .pqss-settings-container {
        top: 65px;
    }
}
