/* ============================================================
   Personality Quiz – Frontend Styles  v2.1 (Modal + Neutral Options)
   ============================================================ */

/* ── "Take the Quiz Now" Button ── */
.pq-button-wrapper {
    text-align: center;
    margin: 40px 0;
}

.pq-open-quiz-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 18px 48px;
    font-size: 19px;
    font-weight: 700;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    letter-spacing: 0.5px;
    box-shadow: 0 6px 30px rgba(102, 126, 234, 0.4);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.pq-open-quiz-btn:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 10px 40px rgba(102, 126, 234, 0.5);
}

.pq-open-quiz-btn:active {
    transform: translateY(-1px) scale(1);
}

.pq-btn-icon {
    font-size: 22px;
    animation: iconSpin 3s linear infinite;
}

@keyframes iconSpin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.pq-btn-arrow {
    font-size: 20px;
    transition: transform 0.3s ease;
}

.pq-open-quiz-btn:hover .pq-btn-arrow {
    transform: translateX(5px);
}

/* ── Modal Overlay ── */
.pq-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    z-index: 999999;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    padding: 20px;
    overflow-y: auto;
}

.pq-modal-overlay.pq-modal-open {
    display: flex;
    opacity: 1;
}

.pq-modal-close-area {
    position: absolute;
    inset: 0;
    cursor: pointer;
    z-index: 0;
}

.pq-modal-close-btn {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.15);
    border: none;
    border-radius: 50%;
    color: rgba(255, 255, 255, 0.8);
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    z-index: 10;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pq-modal-close-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    color: #fff;
    transform: scale(1.1);
}

/* ── Quiz Wrapper (inside modal) ── */
.pq-quiz-wrapper {
    position: relative;
    max-width: 680px;
    width: 100%;
    margin: auto;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    border-radius: 16px;
    box-shadow: 0 12px 60px rgba(0,0,0,0.3);
    background: #fff;
    min-height: 520px;
    z-index: 1;
    animation: modalZoomIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes modalZoomIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* ── Screen base ── */
.pq-screen {
    display: none;
    opacity: 0;
    transform: translateX(40px);
    position: absolute;
    top: 0; left: 0;
    width: 100%;
    min-height: 520px;
    box-sizing: border-box;
}

.pq-screen-active {
    display: flex;
    flex-direction: column;
    opacity: 1;
    transform: translateX(0);
    position: relative;
    animation: pqScreenIn 0.4s ease forwards;
}

.pq-screen-exit {
    display: flex;
    animation: pqScreenOut 0.4s ease forwards;
    pointer-events: none;
    position: absolute;
}

@keyframes pqScreenIn {
    from { opacity: 0; transform: translateX(40px); }
    to   { opacity: 1; transform: translateX(0); }
}
@keyframes pqScreenOut {
    from { opacity: 1; transform: translateX(0); }
    to   { opacity: 0; transform: translateX(-40px); }
}

/* ============================================================
   SCREEN 1 – LANDING
   ============================================================ */
#pq-screen-landing {
    background: linear-gradient(145deg, #1a1a2e 0%, #16213e 60%, #0f3460 100%);
    color: #fff;
    justify-content: center;
    align-items: center;
    padding: 48px 40px;
    text-align: center;
    border-radius: 16px;
}

.pq-landing-inner {
    width: 100%;
    max-width: 440px;
}

.pq-landing-title {
    font-size: 28px;
    font-weight: 700;
    margin: 0 0 8px;
    color: #fff;
    line-height: 1.25;
}

.pq-landing-subtitle {
    font-size: 15px;
    color: rgba(255,255,255,0.65);
    margin: 0 0 36px;
}

.pq-landing-form {
    text-align: left;
}

.pq-field {
    margin-bottom: 18px;
}

.pq-field label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: rgba(255,255,255,0.8);
    margin-bottom: 6px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.pq-field input {
    width: 100%;
    padding: 14px 16px;
    font-size: 15px;
    border: 2px solid rgba(255,255,255,0.15);
    border-radius: 8px;
    background: rgba(255,255,255,0.1);
    color: #fff;
    box-sizing: border-box;
    transition: border-color 0.25s ease, background 0.25s ease;
    outline: none;
}

.pq-field input::placeholder {
    color: rgba(255,255,255,0.35);
}

.pq-field input:focus {
    border-color: rgba(255,255,255,0.5);
    background: rgba(255,255,255,0.15);
}

.pq-field-error {
    color: #ff6b6b;
    font-size: 13px;
    min-height: 18px;
    margin: -8px 0 12px;
    opacity: 0;
    transition: opacity 0.2s ease;
}
.pq-field-error.pq-visible { opacity: 1; }

.pq-btn-start {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 16px;
    font-size: 17px;
    font-weight: 700;
    background: linear-gradient(135deg, #e94560, #c0392b);
    color: #fff;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    letter-spacing: 0.3px;
    box-shadow: 0 4px 20px rgba(233,69,96,0.4);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    margin-top: 6px;
}
.pq-btn-start:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 28px rgba(233,69,96,0.5);
}

/* ============================================================
   SCREEN 2 – COUNTDOWN
   ============================================================ */
#pq-screen-countdown {
    background: linear-gradient(145deg, #1a1a2e, #0f3460);
    justify-content: center;
    align-items: center;
    border-radius: 16px;
}

.pq-countdown-wrap {
    text-align: center;
}

.pq-countdown-label {
    font-size: 18px;
    color: rgba(255,255,255,0.6);
    letter-spacing: 2px;
    text-transform: uppercase;
    margin: 0 0 16px;
}

.pq-countdown-number {
    font-size: 120px;
    font-weight: 900;
    color: #fff;
    line-height: 1;
    text-shadow: 0 0 60px rgba(255,255,255,0.3);
    transition: none;
}

.pq-num-in {
    animation: numIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}
.pq-num-out {
    animation: numOut 0.3s ease forwards;
}

@keyframes numIn {
    from { opacity: 0; transform: scale(0.4); }
    to   { opacity: 1; transform: scale(1); }
}
@keyframes numOut {
    from { opacity: 1; transform: scale(1); }
    to   { opacity: 0; transform: scale(1.6); }
}

/* ============================================================
   SCREEN 3 – QUESTIONS
   ============================================================ */
#pq-screen-question {
    background: #fff;
    padding: 0;
    flex-direction: column;
    border-radius: 16px;
}

.pq-question-header {
    padding: 0;
}

.pq-progress-bar {
    height: 5px;
    background: #eee;
    border-radius: 16px 16px 0 0;
}

.pq-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 16px 0 0 0;
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    width: 0%;
}

.pq-question-counter {
    text-align: right;
    font-size: 13px;
    color: #999;
    margin: 0;
    padding: 10px 24px 0;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.pq-question-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 28px 32px 36px;
}

.pq-question-text {
    font-size: 20px;
    font-weight: 600;
    color: #222;
    text-align: center;
    margin: 0 0 32px;
    line-height: 1.4;
}

/* Options 2×2 grid – NO COLOUR-SPECIFIC BORDERS */
.pq-options-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.pq-grid-exit {
    opacity: 0;
    transform: scale(0.97);
}

.pq-option {
    padding: 22px 16px;
    font-size: 17px;
    font-weight: 600;
    border: 2.5px solid #d0d0d0;
    border-radius: 12px;
    background: #fafafa;
    color: #333;
    cursor: pointer;
    text-align: center;
    transition: all 0.2s ease;
    line-height: 1.3;
    letter-spacing: 0.2px;
}

.pq-option:hover {
    border-color: #999;
    background: #f0f0f0;
    transform: translateY(-3px);
    box-shadow: 0 6px 18px rgba(0,0,0,0.1);
}

.pq-option.pq-option-selected {
    border-color: #667eea;
    background: #f0f4ff;
    color: #667eea;
    transform: scale(1.04) !important;
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.25) !important;
}

/* ============================================================
   SCREEN 4 – PROCESSING
   ============================================================ */
#pq-screen-processing {
    background: linear-gradient(145deg, #1a1a2e, #0f3460);
    justify-content: center;
    align-items: center;
    border-radius: 16px;
}

.pq-processing-inner {
    text-align: center;
    color: #fff;
}

.pq-processing-spinner {
    position: relative;
    width: 80px;
    height: 80px;
    margin: 0 auto 28px;
}

.pq-spinner-ring {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 4px solid transparent;
    animation: spinRing 1.6s linear infinite;
}
.pq-spinner-ring:nth-child(1) {
    border-top-color: #667eea;
    animation-duration: 1.2s;
}
.pq-spinner-ring.pq-ring-2 {
    inset: 10px;
    border-top-color: #FFC107;
    animation-duration: 1.6s;
    animation-direction: reverse;
}
.pq-spinner-ring.pq-ring-3 {
    inset: 22px;
    border-top-color: #4CAF50;
    animation-duration: 2s;
}

@keyframes spinRing {
    to { transform: rotate(360deg); }
}

.pq-processing-text {
    font-size: 20px;
    font-weight: 600;
    margin: 0 0 16px;
    letter-spacing: 0.5px;
}

.pq-processing-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
}
.pq-processing-dots span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255,255,255,0.6);
    animation: dotBounce 1.2s ease-in-out infinite;
}
.pq-processing-dots span:nth-child(2) { animation-delay: 0.2s; }
.pq-processing-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes dotBounce {
    0%, 100% { transform: translateY(0);    opacity: 0.6; }
    50%       { transform: translateY(-10px); opacity: 1; }
}

/* ============================================================
   SCREEN 5 – RESULTS
   ============================================================ */
#pq-screen-results {
    background: linear-gradient(145deg, #f9f9f9, #fff);
    justify-content: center;
    align-items: center;
    padding: 40px 32px;
    min-height: 520px;
    position: relative;
    border-radius: 16px;
}

#pq-confetti-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    border-radius: 16px;
}

.pq-results-inner {
    position: relative;
    z-index: 1;
    text-align: center;
    width: 100%;
    max-width: 480px;
}

.pq-results-greeting {
    font-size: 18px;
    color: #555;
    margin: 0 0 12px;
    font-weight: 500;
}
.pq-results-greeting span {
    font-weight: 700;
    color: #222;
}

.pq-result-badge {
    display: inline-block;
    padding: 10px 28px;
    border-radius: 50px;
    font-size: 22px;
    font-weight: 800;
    color: #fff;
    margin-bottom: 24px;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.18);
    animation: badgePop 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) 0.2s both;
}

@keyframes badgePop {
    from { transform: scale(0.4); opacity: 0; }
    to   { transform: scale(1);   opacity: 1; }
}

.pq-badge-red    { background: linear-gradient(135deg, #f44336, #c62828); }
.pq-badge-yellow { background: linear-gradient(135deg, #FFC107, #e65100); color: #fff; }
.pq-badge-green  { background: linear-gradient(135deg, #4CAF50, #2e7d32); }
.pq-badge-blue   { background: linear-gradient(135deg, #2196F3, #1565c0); }
.pq-badge-tie    { background: linear-gradient(135deg, #9C27B0, #4A148C); }

.pq-result-card {
    background: #fff;
    border-radius: 14px;
    padding: 28px 28px 24px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.08);
    text-align: center;
    animation: cardSlideUp 0.5s ease 0.4s both;
}

@keyframes cardSlideUp {
    from { opacity: 0; transform: translateY(24px); }
    to   { opacity: 1; transform: translateY(0); }
}

.pq-result-image-wrap {
    margin-bottom: 16px;
}
.pq-result-image-wrap img {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #eee;
}

.pq-result-heading {
    font-size: 22px;
    font-weight: 700;
    color: #222;
    margin: 0 0 6px;
}
.pq-result-subheading {
    font-size: 15px;
    font-weight: 500;
    color: #888;
    margin: 0 0 14px;
}
.pq-result-body {
    font-size: 15px;
    line-height: 1.7;
    color: #555;
}

.pq-btn-retake {
    display: inline-block;
    margin-top: 24px;
    padding: 12px 36px;
    font-size: 15px;
    font-weight: 600;
    color: #555;
    background: #fff;
    border: 2px solid #ddd;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}
.pq-btn-retake:hover {
    border-color: #aaa;
    color: #222;
    transform: translateY(-1px);
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 560px) {
    .pq-modal-overlay {
        padding: 0;
    }
    .pq-quiz-wrapper {
        border-radius: 0;
        min-height: 100svh;
        max-width: 100%;
    }
    #pq-screen-landing,
    #pq-screen-countdown,
    #pq-screen-processing,
    #pq-screen-results {
        padding: 36px 24px;
        border-radius: 0;
    }
    #pq-screen-question {
        border-radius: 0;
    }
    .pq-question-body {
        padding: 22px 20px 28px;
    }
    .pq-landing-title    { font-size: 23px; }
    .pq-countdown-number { font-size: 88px; }
    .pq-options-grid     { gap: 10px; }
    .pq-option           { padding: 18px 12px; font-size: 15px; }
}
