/* public_html/assets/css/custom.css */

/* ═══════════════════════════════════════
   ANIMATIONS
═══════════════════════════════════════ */
@keyframes slideUp {
    from { opacity: 0; transform: translateY(28px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes slideDown {
    from { opacity: 1; transform: translateY(0); }
    to   { opacity: 0; transform: translateY(-28px); }
}
@keyframes pulse-gold {
    0%, 100% { box-shadow: 0 0 0 0 rgba(231, 194, 120, 0); }
    50%       { box-shadow: 0 0 0 6px rgba(231, 194, 120, 0.15); }
}
@keyframes checkmark {
    from { transform: scale(0) rotate(-45deg); opacity: 0; }
    to   { transform: scale(1) rotate(0deg); opacity: 1; }
}

.fade-enter-active {
    animation: slideUp 0.42s cubic-bezier(0.16, 1, 0.3, 1) both;
}
.fade-exit-active {
    animation: slideDown 0.35s cubic-bezier(0.16, 1, 0.3, 1) both;
}

/* ═══════════════════════════════════════
   QUESTION HEADER
═══════════════════════════════════════ */
.question-title {
    font-family: 'Playfair Display', serif;
    font-size: clamp(1.25rem, 3.5vw, 1.75rem);
    font-weight: 700;
    color: #f3f4f6;
    line-height: 1.35;
    margin-bottom: 1.75rem;
    letter-spacing: -0.01em;
}

/* ═══════════════════════════════════════
   RADIO / CHECKBOX OPTION CARDS
═══════════════════════════════════════ */
.custom-radio {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

.option-card {
    position: relative;
    display: flex;
    align-items: center;
    gap: 14px;
    border: 1.5px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    padding: 16px 20px;
    cursor: pointer;
    transition: border-color 0.22s, background 0.22s, box-shadow 0.22s, transform 0.15s;
    background: rgba(255, 255, 255, 0.025);
    color: #d1d5db;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.option-card:hover {
    border-color: rgba(231, 194, 120, 0.45);
    background: rgba(231, 194, 120, 0.05);
    box-shadow: 0 0 20px rgba(231, 194, 120, 0.1);
    color: #f9fafb;
    transform: translateY(-1px);
}

.option-card:active {
    transform: scale(0.985);
}

/* Selected state */
.custom-radio:checked + .option-card {
    border-color: #E7C278;
    background: rgba(231, 194, 120, 0.1);
    box-shadow: 0 0 24px rgba(231, 194, 120, 0.2), inset 0 0 0 1px rgba(231, 194, 120, 0.15);
    color: #fff;
    animation: pulse-gold 0.6s ease;
}

/* Letter badge */
.option-letter {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.07);
    color: #9ca3af;
    font-size: 13px;
    font-weight: 700;
    border: 1px solid rgba(255, 255, 255, 0.06);
    transition: background 0.22s, color 0.22s, border-color 0.22s, box-shadow 0.22s;
    letter-spacing: 0.02em;
}

.custom-radio:checked + .option-card .option-letter {
    background: #E7C278;
    color: #020B0C;
    border-color: #E7C278;
    box-shadow: 0 0 12px rgba(231, 194, 120, 0.6);
}

/* Checkmark icon for selected options */
.option-check {
    margin-left: auto;
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 1.5px solid rgba(255,255,255,0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.22s;
}
.custom-radio:checked + .option-card .option-check {
    background: #E7C278;
    border-color: #E7C278;
}
.custom-radio:checked + .option-card .option-check::after {
    content: '';
    display: block;
    width: 5px;
    height: 9px;
    border: 2px solid #020B0C;
    border-top: none;
    border-left: none;
    transform: rotate(42deg) translateY(-1px);
    animation: checkmark 0.2s ease both;
}

/* Option text */
.option-text {
    font-size: 0.9375rem;
    font-weight: 500;
    line-height: 1.4;
    flex: 1;
}

/* ═══════════════════════════════════════
   TEXTAREA DARK THEME
═══════════════════════════════════════ */
.quiz-textarea {
    width: 100%;
    background: rgba(255, 255, 255, 0.03);
    border: 1.5px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    padding: 16px 20px;
    color: #f3f4f6;
    font-size: 0.9375rem;
    font-family: 'Inter', sans-serif;
    line-height: 1.6;
    resize: vertical;
    min-height: 130px;
    outline: none;
    transition: border-color 0.25s, background 0.25s, box-shadow 0.25s;
    caret-color: #E7C278;
}
.quiz-textarea::placeholder {
    color: rgba(255, 255, 255, 0.25);
}
.quiz-textarea:focus {
    border-color: #E7C278;
    background: rgba(231, 194, 120, 0.04);
    box-shadow: 0 0 0 3px rgba(231, 194, 120, 0.1), 0 0 20px rgba(231, 194, 120, 0.08);
}

/* ═══════════════════════════════════════
   SELECT DARK THEME (Custom)
═══════════════════════════════════════ */
.quiz-select-wrapper {
    position: relative;
}
.quiz-select-wrapper::after {
    content: '';
    position: absolute;
    right: 18px;
    top: 50%;
    transform: translateY(-50%);
    width: 10px;
    height: 6px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23E7C278'/%3E%3C/svg%3E") no-repeat center;
    pointer-events: none;
    transition: transform 0.2s;
}
.quiz-select-wrapper:focus-within::after {
    transform: translateY(-50%) rotate(180deg);
}

.quiz-select {
    width: 100%;
    appearance: none;
    -webkit-appearance: none;
    background: rgba(255, 255, 255, 0.03);
    border: 1.5px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    padding: 16px 48px 16px 20px;
    color: #f3f4f6;
    font-size: 0.9375rem;
    font-family: 'Inter', sans-serif;
    outline: none;
    cursor: pointer;
    transition: border-color 0.25s, background 0.25s, box-shadow 0.25s;
}
.quiz-select option {
    background: #0d2022;
    color: #f3f4f6;
    padding: 10px;
}
.quiz-select:focus {
    border-color: #E7C278;
    background: rgba(231, 194, 120, 0.04);
    box-shadow: 0 0 0 3px rgba(231, 194, 120, 0.1), 0 0 20px rgba(231, 194, 120, 0.08);
}
.quiz-select.has-value {
    color: #f3f4f6;
}
.quiz-select:not(.has-value) {
    color: rgba(255, 255, 255, 0.35);
}

/* ═══════════════════════════════════════
   TOAST / VALIDATION
═══════════════════════════════════════ */
.quiz-toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.35);
    color: #fca5a5;
    padding: 12px 20px;
    border-radius: 12px;
    font-size: 0.875rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    opacity: 0;
    transition: opacity 0.3s, transform 0.3s;
    pointer-events: none;
    z-index: 999;
    backdrop-filter: blur(8px);
    white-space: nowrap;
}
.quiz-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ═══════════════════════════════════════
   PROGRESS BAR
═══════════════════════════════════════ */
#progress-bar {
    background: linear-gradient(90deg, #c8a24e, #E7C278, #f6d48a);
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 10px rgba(231, 194, 120, 0.6);
}

/* ═══════════════════════════════════════
   OPTIONS CONTAINER SPACING
═══════════════════════════════════════ */
.options-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* ═══════════════════════════════════════
   NEXT BUTTON
═══════════════════════════════════════ */
#btn-next {
    display: flex;
    transition: transform 0.15s, box-shadow 0.2s, background 0.2s;
}
#btn-next.hidden {
    display: none;
}
#btn-next:not(:disabled):hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(231, 194, 120, 0.35);
}
#btn-next:active {
    transform: scale(0.97);
}
#btn-next:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

/* ═══════════════════════════════════════
   RESPONSIVE
═══════════════════════════════════════ */
@media (max-width: 640px) {
    .option-card {
        padding: 14px 16px;
        border-radius: 12px;
    }
    .option-text {
        font-size: 0.875rem;
    }
    .quiz-textarea,
    .quiz-select {
        font-size: 1rem; /* Prevent iOS zoom */
    }
}
