/* =====================================================
   MeetLop AI Quiz — Frontend Styles
   ===================================================== */

#mlaq-wrapper {
    --mlaq-accent: #c8a96e;
    --mlaq-accent-dark: #a8843e;
    --mlaq-bg: #fdfaf5;
    --mlaq-border: #e8dcc8;
    --mlaq-radius: 12px;
    margin: 48px 0 32px;
    font-family: inherit;
}

/* Loading */
#mlaq-loading {
    text-align: center;
    padding: 32px;
    color: #888;
}
.mlaq-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid #e0d4be;
    border-top-color: var(--mlaq-accent);
    border-radius: 50%;
    animation: mlaq-spin 0.7s linear infinite;
    margin: 0 auto 12px;
}
@keyframes mlaq-spin { to { transform: rotate(360deg); } }

/* Quiz card */
.mlaq-quiz {
    background: var(--mlaq-bg);
    border: 1.5px solid var(--mlaq-border);
    border-radius: var(--mlaq-radius);
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}

/* Header */
.mlaq-header {
    display: flex;
    align-items: center;
    gap: 14px;
    background: var(--mlaq-accent);
    padding: 18px 24px;
}
.mlaq-icon {
    font-size: 32px;
    line-height: 1;
    flex-shrink: 0;
}
.mlaq-header-text {
    flex: 1;
}
.mlaq-title {
    font-size: 18px;
    font-weight: 700;
    color: #fff;
    margin: 0 0 2px;
}
.mlaq-subtitle {
    font-size: 13px;
    color: rgba(255,255,255,0.85);
}

/* Badge */
.mlaq-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
    cursor: default;
}
.mlaq-badge-ai {
    background: rgba(255,255,255,0.2);
    color: #fff;
    border: 1px solid rgba(255,255,255,0.4);
}
.mlaq-badge-rule {
    background: rgba(0,0,0,0.15);
    color: #fff;
    border: 1px solid rgba(255,255,255,0.3);
}

/* Questions */
.mlaq-questions {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}
.mlaq-question {
    background: #fff;
    border: 1px solid var(--mlaq-border);
    border-radius: 8px;
    padding: 18px 20px;
}
.mlaq-q-text {
    margin: 0 0 14px;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.5;
}
.mlaq-q-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: var(--mlaq-accent);
    color: #fff;
    border-radius: 50%;
    font-size: 12px;
    font-weight: 700;
    margin-right: 8px;
    vertical-align: middle;
    flex-shrink: 0;
}

/* Options */
.mlaq-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.mlaq-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border: 1.5px solid #e8e0d0;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    line-height: 1.4;
    transition: border-color 0.15s, background 0.15s;
}
.mlaq-option:hover {
    border-color: var(--mlaq-accent);
    background: #fdf5e8;
}
.mlaq-option input[type="radio"] {
    accent-color: var(--mlaq-accent);
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    cursor: pointer;
}
.mlaq-opt-correct {
    border-color: #4caf50 !important;
    background: #f0fff0 !important;
}
.mlaq-opt-wrong {
    border-color: #f44336 !important;
    background: #fff5f5 !important;
}

/* Feedback */
.mlaq-feedback {
    margin-top: 10px;
    padding: 10px 14px;
    background: #f9f6f0;
    border-radius: 6px;
    font-size: 13px;
    line-height: 1.5;
}
.mlaq-fb-lbl { font-weight: 700; margin-right: 4px; }
.mlaq-fb-ok  { color: #2e7d32; }
.mlaq-fb-no  { color: #c62828; }
.mlaq-fb-exp { color: #555; }

/* Actions */
.mlaq-actions {
    padding: 0 24px 24px;
    text-align: center;
}

/* Buttons */
.mlaq-btn {
    display: inline-block;
    padding: 12px 32px;
    background: var(--mlaq-accent);
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    text-decoration: none;
}
.mlaq-btn:hover {
    background: var(--mlaq-accent-dark);
    transform: translateY(-1px);
}
.mlaq-btn:active { transform: translateY(0); }
.mlaq-btn-retake {
    background: transparent;
    border: 2px solid var(--mlaq-accent);
    color: var(--mlaq-accent);
    margin-top: 12px;
}
.mlaq-btn-retake:hover {
    background: var(--mlaq-accent);
    color: #fff;
}

/* Results */
#mlaq-results {
    padding: 24px;
    border-top: 1.5px solid var(--mlaq-border);
}
.mlaq-score {
    text-align: center;
    padding: 24px;
    background: #fff;
    border: 1.5px solid var(--mlaq-border);
    border-radius: 10px;
    margin-bottom: 24px;
}
.mlaq-score-emoji { font-size: 48px; margin-bottom: 10px; }
.mlaq-score-num   { font-size: 20px; font-weight: 700; margin-bottom: 6px; }
.mlaq-score-note  { font-size: 14px; color: #777; margin-bottom: 16px; }

/* Related posts */
.mlaq-related-title {
    font-size: 18px;
    font-weight: 700;
    margin: 0 0 4px;
}
.mlaq-related-sub {
    font-size: 13px;
    color: #888;
    margin: 0 0 16px;
}
.mlaq-related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 14px;
}
.mlaq-card {
    display: flex;
    flex-direction: column;
    border: 1.5px solid var(--mlaq-border);
    border-radius: 10px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    background: #fff;
    transition: box-shadow 0.2s, transform 0.2s;
}
.mlaq-card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.10);
    transform: translateY(-2px);
    text-decoration: none;
    color: inherit;
}
.mlaq-thumb {
    width: 100%;
    height: 110px;
    background-size: cover;
    background-position: center;
    background-color: #f0e8d8;
}
.mlaq-thumb-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    background: #fdf5e8;
}
.mlaq-card-body {
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}
.mlaq-card-title   { font-size: 13px; font-weight: 700; line-height: 1.4; }
.mlaq-card-excerpt { font-size: 12px; color: #888; line-height: 1.4; }

/* Error */
.mlaq-error {
    color: #c62828;
    padding: 12px 16px;
    background: #fff5f5;
    border: 1px solid #ffcdd2;
    border-radius: 6px;
    font-size: 14px;
    text-align: center;
}

/* Responsive */
@media (max-width: 600px) {
    .mlaq-header    { padding: 14px 16px; }
    .mlaq-questions { padding: 16px; gap: 14px; }
    .mlaq-actions   { padding: 0 16px 16px; }
    #mlaq-results   { padding: 16px; }
    .mlaq-related-grid { grid-template-columns: 1fr 1fr; }
    .mlaq-btn { width: 100%; }
}
@media (max-width: 400px) {
    .mlaq-related-grid { grid-template-columns: 1fr; }
}
