/**
 * RM Pregunta del Día - Frontend Styles
 */

/* ========================================
   CSS VARIABLES (defaults, overridden by widget inline)
   ======================================== */
:root {
    /* Paleta principal - Theme Residencias Médicas */
    --rm-primary: #0E7490;
    --rm-primary-light: #22D3EE;
    --rm-cta: #F97316;
    --rm-accent: #06B6D4;
    --rm-success: #059669;
    --rm-error: #DC2626;
    --rm-warning: #D97706;
    --rm-bg: #FFFFFF;
    --rm-text: #164E63;

    /* Grises */
    --rm-gray-50: #F0FDFA;
    --rm-gray-100: #ECFEFF;
    --rm-gray-200: #e2e8f0;
    --rm-gray-300: #cbd5e0;
    --rm-gray-400: #a0aec0;
    --rm-gray-500: #718096;
    --rm-gray-600: #4a5568;
    --rm-gray-700: #2d3748;
    --rm-gray-800: #164E63;

    /* Diseño */
    --rm-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --rm-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --rm-radius: 12px;
    --rm-radius-sm: 8px;
    --rm-transition: all 0.2s ease;

    /* Mobile-first: touch targets */
    --rm-touch-target: 44px;
}

/* ========================================
   BASE STYLES
   ======================================== */
.rm-qotd-container,
.rm-ranking-container,
.rm-archive-container,
.rm-stats-container,
.rm-exam-container {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: var(--rm-bg);
    color: var(--rm-text);
    border-radius: var(--rm-radius);
    box-shadow: var(--rm-shadow);
    overflow: hidden;
}

/* ========================================
   SPINNER
   ======================================== */
.rm-qotd-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--rm-gray-200);
    border-top-color: var(--rm-accent);
    border-radius: 50%;
    animation: rm-spin 0.8s linear infinite;
    margin: 0 auto;
}

@keyframes rm-spin {
    to {
        transform: rotate(360deg);
    }
}

.rm-qotd-loading,
.rm-ranking-loading,
.rm-archive-loading,
.rm-stats-loading {
    padding: 60px 20px;
    text-align: center;
}

.rm-qotd-loading p {
    color: var(--rm-gray-500);
    margin-top: 15px;
}

/* ========================================
   HEADER
   ======================================== */
.rm-qotd-header,
.rm-ranking-header,
.rm-archive-header,
.rm-exam-header {
    background: var(--rm-primary);
    color: white;
    padding: 20px 24px;
    border-radius: var(--rm-radius) var(--rm-radius) 0 0;
}

.rm-qotd-title,
.rm-ranking-title,
.rm-archive-title,
.rm-exam-title {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
}

.rm-exam-description {
    margin: 8px 0 0;
    opacity: 0.9;
    font-size: 0.9rem;
}

/* Sponsor header */
.rm-qotd-sponsor-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.rm-qotd-sponsor-text {
    font-size: 0.75rem;
    opacity: 0.8;
}

.rm-qotd-sponsor-logo {
    max-height: 40px;
    max-width: 150px;
}

/* ========================================
   CONTENT
   ======================================== */
.rm-qotd-content {
    padding: 24px;
}

/* Meta badges */
.rm-qotd-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.rm-qotd-meta span {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
}

.rm-qotd-category {
    background: var(--rm-gray-100);
    color: var(--rm-gray-700);
}

.rm-qotd-difficulty {
    color: white;
}

.rm-qotd-difficulty.easy {
    background: var(--rm-success);
}

.rm-qotd-difficulty.medium {
    background: var(--rm-warning);
}

.rm-qotd-difficulty.hard {
    background: var(--rm-error);
}

.rm-qotd-points {
    background: var(--rm-accent);
    color: white;
}

/* Case description */
.rm-qotd-case {
    background: var(--rm-gray-50);
    border-left: 4px solid var(--rm-accent);
    padding: 16px;
    margin-bottom: 20px;
    border-radius: 0 var(--rm-radius-sm) var(--rm-radius-sm) 0;
}

.rm-qotd-case-image img {
    max-width: 100%;
    border-radius: var(--rm-radius-sm);
    margin-bottom: 12px;
}

.rm-qotd-case-text {
    color: var(--rm-gray-700);
    line-height: 1.6;
}

/* Question text */
.rm-qotd-question-text {
    font-size: 1.1rem;
    color: var(--rm-gray-800);
    line-height: 1.6;
    margin-bottom: 24px;
    font-weight: 500;
}

/* ========================================
   OPTIONS
   ======================================== */
.rm-qotd-options,
.rm-exam-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 24px;
}

.rm-qotd-option,
.rm-exam-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    border: 2px solid var(--rm-gray-200);
    border-radius: var(--rm-radius-sm);
    cursor: pointer;
    transition: var(--rm-transition);
    background: white;
}

.rm-qotd-option:hover,
.rm-exam-option:hover {
    border-color: var(--rm-accent);
    background: rgba(49, 130, 206, 0.05);
}

.rm-qotd-option.selected,
.rm-exam-option.selected {
    border-color: var(--rm-accent);
    background: rgba(49, 130, 206, 0.1);
}

.rm-qotd-option.correct {
    border-color: var(--rm-success);
    background: rgba(56, 161, 105, 0.15);
}

.rm-qotd-option.incorrect {
    border-color: var(--rm-error);
    background: rgba(229, 62, 62, 0.15);
}

.rm-qotd-option.disabled {
    cursor: not-allowed;
    opacity: 0.7;
}

.rm-qotd-option-letter {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--rm-gray-100);
    font-weight: 600;
    color: var(--rm-gray-600);
    flex-shrink: 0;
    transition: var(--rm-transition);
}

.rm-qotd-option.selected .rm-qotd-option-letter {
    background: var(--rm-accent);
    color: white;
}

.rm-qotd-option.correct .rm-qotd-option-letter {
    background: var(--rm-success);
    color: white;
}

.rm-qotd-option.incorrect .rm-qotd-option-letter {
    background: var(--rm-error);
    color: white;
}

.rm-qotd-option-text {
    flex: 1;
    color: var(--rm-gray-700);
    line-height: 1.5;
}

/* ========================================
   BUTTONS (Mobile-first: 44px touch targets)
   ======================================== */
.rm-qotd-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: var(--rm-touch-target);
    padding: 12px 24px;
    border: none;
    border-radius: var(--rm-radius-sm);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--rm-transition);
    text-decoration: none;
}

.rm-qotd-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.rm-qotd-btn-primary {
    background: var(--rm-cta);
    color: white;
}

.rm-qotd-btn-primary:hover:not(:disabled) {
    background: var(--rm-primary);
}

/* Focus states para accesibilidad */
.rm-qotd-btn:focus-visible,
.rm-qotd-option:focus-visible {
    outline: 3px solid var(--rm-accent);
    outline-offset: 2px;
}

.rm-qotd-submit {
    width: 100%;
}

/* ========================================
   RESULT
   ======================================== */
.rm-qotd-result {
    text-align: center;
    padding: 20px 0;
}

.rm-qotd-result-icon {
    font-size: 3rem;
    margin-bottom: 12px;
}

.rm-qotd-result-text {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.rm-qotd-result.correct .rm-qotd-result-text {
    color: var(--rm-success);
}

.rm-qotd-result.incorrect .rm-qotd-result-text {
    color: var(--rm-error);
}

.rm-qotd-result-points {
    font-size: 1.1rem;
    color: var(--rm-accent);
    font-weight: 500;
}

.rm-qotd-explanation {
    margin-top: 20px;
    padding: 16px;
    background: var(--rm-gray-50);
    border-radius: var(--rm-radius-sm);
    text-align: left;
    line-height: 1.6;
}

.rm-qotd-explanation h4 {
    margin: 0 0 8px;
    color: var(--rm-gray-800);
}

.rm-qotd-references {
    margin-top: 12px;
    padding: 12px;
    background: white;
    border: 1px solid var(--rm-gray-200);
    border-radius: var(--rm-radius-sm);
    font-size: 0.9rem;
    color: var(--rm-gray-600);
}

.rm-qotd-video {
    margin-top: 16px;
}

.rm-qotd-video iframe {
    max-width: 100%;
    border-radius: var(--rm-radius-sm);
}

/* ========================================
   SHARE BUTTONS
   ======================================== */
.rm-qotd-share,
.rm-exam-share {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--rm-gray-200);
    text-align: center;
}

.rm-qotd-share p,
.rm-exam-share p {
    margin: 0 0 12px;
    color: var(--rm-gray-600);
    font-size: 0.9rem;
}

.rm-qotd-share-buttons,
.rm-exam-share-buttons {
    display: flex;
    justify-content: center;
    gap: 12px;
}

.rm-qotd-share-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--rm-transition);
}

.rm-qotd-share-twitter {
    background: #1da1f2;
    color: white;
}

.rm-qotd-share-whatsapp {
    background: #25d366;
    color: white;
}

.rm-qotd-share-linkedin {
    background: #0077b5;
    color: white;
}

.rm-qotd-share-btn:hover {
    transform: scale(1.1);
}

/* ========================================
   COUNTDOWN
   ======================================== */
.rm-qotd-countdown {
    margin-top: 24px;
    padding: 16px;
    background: var(--rm-gray-50);
    border-radius: var(--rm-radius-sm);
    text-align: center;
}

.rm-qotd-countdown p {
    margin: 0 0 8px;
    color: var(--rm-gray-600);
    font-size: 0.9rem;
}

.rm-qotd-countdown-timer {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--rm-primary);
    font-variant-numeric: tabular-nums;
}

/* ========================================
   LOGIN FORMS
   ======================================== */
.rm-qotd-login {
    padding: 24px;
}

.rm-qotd-login h4 {
    margin: 0 0 20px;
    text-align: center;
    color: var(--rm-gray-800);
}

.rm-qotd-login-tabs {
    display: flex;
    margin-bottom: 20px;
    border-bottom: 2px solid var(--rm-gray-200);
}

.rm-qotd-tab {
    flex: 1;
    padding: 12px;
    background: none;
    border: none;
    color: var(--rm-gray-500);
    font-size: 0.95rem;
    cursor: pointer;
    transition: var(--rm-transition);
    position: relative;
}

.rm-qotd-tab.active {
    color: var(--rm-accent);
}

.rm-qotd-tab.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--rm-accent);
}

.rm-qotd-form-group {
    margin-bottom: 16px;
}

.rm-qotd-form-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 0.9rem;
    color: var(--rm-gray-700);
    font-weight: 500;
}

.rm-qotd-form-group input[type="text"],
.rm-qotd-form-group input[type="email"] {
    width: 100%;
    padding: 12px;
    border: 2px solid var(--rm-gray-200);
    border-radius: var(--rm-radius-sm);
    font-size: 1rem;
    transition: var(--rm-transition);
}

.rm-qotd-form-group input:focus {
    outline: none;
    border-color: var(--rm-accent);
}

.rm-qotd-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
}

.rm-qotd-checkbox input {
    width: 18px;
    height: 18px;
    accent-color: var(--rm-accent);
}

.rm-qotd-checkbox label {
    margin: 0;
    font-size: 0.85rem;
}

.rm-qotd-code-input {
    text-align: center;
    font-size: 1.5rem !important;
    letter-spacing: 0.5em;
    font-weight: 600;
}

.rm-qotd-verify-message {
    text-align: center;
    color: var(--rm-gray-600);
    margin-bottom: 16px;
}

.rm-qotd-resend-code {
    display: block;
    width: 100%;
    margin-top: 12px;
    background: none;
    border: 1px solid var(--rm-gray-300);
    color: var(--rm-gray-600);
}

/* ========================================
   RANKING
   ======================================== */
.rm-ranking-list {
    padding: 0;
}

.rm-ranking-row {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--rm-gray-100);
    transition: var(--rm-transition);
}

.rm-ranking-row:hover {
    background: var(--rm-gray-50);
}

.rm-ranking-row.current-user {
    background: rgba(49, 130, 206, 0.1);
}

.rm-ranking-position {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-weight: 600;
    margin-right: 16px;
    background: var(--rm-gray-100);
    color: var(--rm-gray-600);
}

.rm-ranking-position.gold {
    background: linear-gradient(135deg, #ffd700, #f0c000);
    color: #704d00;
}

.rm-ranking-position.silver {
    background: linear-gradient(135deg, #e0e0e0, #c0c0c0);
    color: #505050;
}

.rm-ranking-position.bronze {
    background: linear-gradient(135deg, #cd7f32, #b87333);
    color: #4a2800;
}

.rm-ranking-info {
    flex: 1;
}

.rm-ranking-name {
    font-weight: 500;
    color: var(--rm-gray-800);
    margin-bottom: 2px;
}

.rm-ranking-level {
    font-size: 0.8rem;
    color: var(--rm-gray-500);
}

.rm-ranking-stats {
    text-align: right;
}

.rm-ranking-points {
    font-weight: 600;
    color: var(--rm-primary);
}

.rm-ranking-streak {
    font-size: 0.85rem;
    color: var(--rm-gray-500);
}

.rm-ranking-separator {
    text-align: center;
    padding: 8px;
    color: var(--rm-gray-400);
}

.rm-ranking-user-position {
    background: var(--rm-gray-50);
}

/* ========================================
   ARCHIVE
   ======================================== */
.rm-archive-filters {
    padding: 16px 20px;
    display: flex;
    gap: 12px;
    border-bottom: 1px solid var(--rm-gray-100);
}

.rm-archive-filter {
    flex: 1;
    padding: 10px 12px;
    border: 2px solid var(--rm-gray-200);
    border-radius: var(--rm-radius-sm);
    font-size: 0.9rem;
    cursor: pointer;
}

.rm-archive-list {
    padding: 0;
}

.rm-archive-item {
    padding: 16px 20px;
    border-bottom: 1px solid var(--rm-gray-100);
    cursor: pointer;
    transition: var(--rm-transition);
}

.rm-archive-item:hover {
    background: var(--rm-gray-50);
}

.rm-archive-item-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.rm-archive-item-date {
    font-size: 0.8rem;
    color: var(--rm-gray-500);
}

.rm-archive-item-status {
    margin-left: auto;
}

.rm-archive-item-status.answered {
    color: var(--rm-success);
}

.rm-archive-item-status.correct::after {
    content: ' ✓';
}

.rm-archive-item-status.incorrect::after {
    content: ' ✗';
}

.rm-archive-item-question {
    color: var(--rm-gray-700);
    line-height: 1.5;
}

.rm-archive-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 16px;
    border-top: 1px solid var(--rm-gray-100);
}

.rm-archive-prev,
.rm-archive-next {
    padding: 8px 16px;
    background: var(--rm-gray-100);
    border: none;
    border-radius: var(--rm-radius-sm);
    cursor: pointer;
    transition: var(--rm-transition);
}

.rm-archive-prev:hover:not(:disabled),
.rm-archive-next:hover:not(:disabled) {
    background: var(--rm-gray-200);
}

.rm-archive-prev:disabled,
.rm-archive-next:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.rm-archive-page-info {
    color: var(--rm-gray-600);
    font-size: 0.9rem;
}

/* Archive Modal */
.rm-archive-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.rm-archive-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
}

.rm-archive-modal-content {
    position: relative;
    background: white;
    border-radius: var(--rm-radius);
    max-width: 600px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: var(--rm-shadow-lg);
}

.rm-archive-modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    border: none;
    background: var(--rm-gray-100);
    border-radius: 50%;
    font-size: 1.25rem;
    cursor: pointer;
    z-index: 1;
}

.rm-archive-modal-body {
    padding: 24px;
}

/* ========================================
   STATS
   ======================================== */
.rm-stats-content {
    padding: 24px;
}

.rm-stats-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
}

.rm-stats-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--rm-accent), var(--rm-primary));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
}

.rm-stats-name {
    margin: 0 0 4px;
    font-size: 1.25rem;
    color: var(--rm-gray-800);
}

.rm-stats-level {
    color: var(--rm-gray-500);
    font-size: 0.9rem;
}

.rm-stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.rm-stats-card {
    background: var(--rm-gray-50);
    padding: 16px;
    border-radius: var(--rm-radius-sm);
    text-align: center;
}

.rm-stats-card-value {
    display: block;
    font-size: 1.75rem;
    font-weight: 600;
    color: var(--rm-primary);
}

.rm-stats-card-label {
    font-size: 0.8rem;
    color: var(--rm-gray-500);
}

.rm-stats-level-progress {
    background: var(--rm-gray-50);
    padding: 16px;
    border-radius: var(--rm-radius-sm);
    margin-bottom: 24px;
}

.rm-stats-level-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 0.9rem;
}

.rm-stats-current-level {
    font-weight: 500;
    color: var(--rm-gray-700);
}

.rm-stats-next-level {
    color: var(--rm-gray-500);
}

.rm-stats-progress-bar {
    height: 8px;
    background: var(--rm-gray-200);
    border-radius: 4px;
    overflow: hidden;
}

.rm-stats-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--rm-accent), var(--rm-success));
    border-radius: 4px;
    transition: width 0.5s ease;
}

.rm-stats-points-to-next {
    display: block;
    text-align: center;
    margin-top: 8px;
    font-size: 0.8rem;
    color: var(--rm-gray-500);
}

.rm-stats-achievements h4 {
    margin: 0 0 16px;
    color: var(--rm-gray-800);
}

.rm-stats-achievements-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.rm-stats-achievement {
    text-align: center;
    padding: 12px;
    background: var(--rm-gray-50);
    border-radius: var(--rm-radius-sm);
}

.rm-stats-achievement-badge {
    font-size: 1.5rem;
    margin-bottom: 4px;
}

.rm-stats-achievement-name {
    font-size: 0.75rem;
    color: var(--rm-gray-600);
}

.rm-stats-achievement.locked {
    opacity: 0.4;
    filter: grayscale(1);
}

.rm-stats-view-all-achievements {
    display: block;
    width: 100%;
    margin-top: 12px;
    padding: 10px;
    background: none;
    border: 1px solid var(--rm-gray-300);
    border-radius: var(--rm-radius-sm);
    color: var(--rm-gray-600);
    cursor: pointer;
    font-size: 0.9rem;
}

.rm-stats-login-prompt {
    padding: 40px 20px;
    text-align: center;
    color: var(--rm-gray-600);
}

/* ========================================
   EXAM MODE
   ======================================== */
.rm-exam-setup {
    padding: 24px;
}

.rm-exam-form-group {
    margin-bottom: 20px;
}

.rm-exam-form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--rm-gray-700);
}

.rm-exam-quantity-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.rm-exam-quantity-btn {
    padding: 10px 20px;
    border: 2px solid var(--rm-gray-200);
    background: white;
    border-radius: var(--rm-radius-sm);
    cursor: pointer;
    transition: var(--rm-transition);
}

.rm-exam-quantity-btn.active {
    border-color: var(--rm-accent);
    background: rgba(49, 130, 206, 0.1);
    color: var(--rm-accent);
}

.rm-exam-custom-quantity input {
    width: 100%;
    padding: 10px;
    border: 2px solid var(--rm-gray-200);
    border-radius: var(--rm-radius-sm);
    margin-top: 8px;
}

.rm-exam-form-group select {
    width: 100%;
    padding: 12px;
    border: 2px solid var(--rm-gray-200);
    border-radius: var(--rm-radius-sm);
    font-size: 1rem;
}

.rm-exam-time-info {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px;
    background: var(--rm-gray-50);
    border-radius: var(--rm-radius-sm);
    margin-bottom: 20px;
}

.rm-exam-start-btn {
    width: 100%;
}

/* Exam progress */
.rm-exam-progress {
    padding: 24px;
}

.rm-exam-timer-bar {
    height: 4px;
    background: var(--rm-gray-200);
    border-radius: 2px;
    margin-bottom: 16px;
    overflow: hidden;
}

.rm-exam-timer-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--rm-success), var(--rm-warning), var(--rm-error));
    transition: width 1s linear;
}

.rm-exam-progress-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
    font-size: 0.9rem;
    color: var(--rm-gray-600);
}

.rm-exam-timer-display {
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.rm-exam-question-text {
    font-size: 1.1rem;
    color: var(--rm-gray-800);
    line-height: 1.6;
    margin-bottom: 20px;
}

.rm-exam-nav {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

.rm-exam-nav .rm-qotd-btn {
    flex: 1;
}

.rm-exam-abandon {
    margin-top: 24px;
    text-align: center;
}

.rm-exam-abandon-btn {
    background: none;
    border: none;
    color: var(--rm-gray-500);
    cursor: pointer;
    font-size: 0.9rem;
    text-decoration: underline;
}

/* Exam results */
.rm-exam-results {
    padding: 24px;
    text-align: center;
}

.rm-exam-results-header h3 {
    margin: 0 0 24px;
    color: var(--rm-gray-800);
}

.rm-exam-results-score {
    margin-bottom: 24px;
}

.rm-exam-score-circle {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--rm-accent), var(--rm-primary));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
}

.rm-exam-score-value {
    font-size: 2rem;
    font-weight: 600;
}

.rm-exam-score-details p {
    margin: 4px 0;
    color: var(--rm-gray-600);
}

.rm-exam-points-breakdown {
    background: var(--rm-gray-50);
    padding: 20px;
    border-radius: var(--rm-radius-sm);
    margin-bottom: 24px;
    text-align: left;
}

.rm-exam-points-breakdown h4 {
    margin: 0 0 12px;
    color: var(--rm-gray-700);
}

.rm-exam-points-breakdown ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.rm-exam-points-breakdown li {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid var(--rm-gray-200);
}

.rm-exam-points-breakdown li:last-child {
    border-bottom: none;
    padding-top: 12px;
    margin-top: 4px;
    border-top: 2px solid var(--rm-gray-300);
}

.rm-exam-points-value {
    color: var(--rm-success);
    font-weight: 500;
}

.rm-exam-actions {
    display: flex;
    gap: 12px;
}

.rm-exam-actions .rm-qotd-btn {
    flex: 1;
}

/* Exam rate limit */
.rm-exam-rate-limit {
    background: var(--rm-warning);
    color: white;
    padding: 16px;
    border-radius: var(--rm-radius-sm);
    margin-bottom: 20px;
    text-align: center;
}

.rm-exam-review-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.rm-exam-back-to-results {
    background: none;
    border: none;
    color: var(--rm-accent);
    cursor: pointer;
    font-size: 0.9rem;
}

/* ========================================
   EMPTY/ERROR STATES
   ======================================== */
.rm-qotd-no-question,
.rm-qotd-error,
.rm-ranking-empty,
.rm-archive-empty,
.rm-exam-disabled {
    padding: 40px 20px;
    text-align: center;
    color: var(--rm-gray-500);
}

/* ========================================
   RESPONSIVE
   ======================================== */
@media (max-width: 600px) {
    .rm-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .rm-stats-achievements-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .rm-exam-quantity-options {
        flex-wrap: wrap;
    }

    .rm-exam-quantity-btn {
        flex: 1;
        min-width: 80px;
    }

    /* Mobile: más espacio entre touch targets */
    .rm-qotd-share-buttons,
    .rm-exam-share-buttons {
        gap: 16px;
    }

    .rm-archive-filters {
        flex-direction: column;
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {

    .rm-qotd-option,
    .rm-qotd-btn,
    .rm-qotd-spinner {
        transition: none;
        animation: none;
    }
}

/* ========================================
   SIDEBAR LAYOUT MODE (compact)
   ======================================== */
.rm-qotd-container.rm-qotd--sidebar,
.rm-ranking-container.rm-sidebar,
.rm-archive-container.rm-sidebar,
.rm-stats-container.rm-sidebar,
.rm-exam-container.rm-sidebar {
    max-width: 380px;
    font-size: 0.9rem;
}

/* Headers compactos */
.rm-qotd--sidebar .rm-qotd-header,
.rm-sidebar .rm-ranking-header,
.rm-sidebar .rm-archive-header,
.rm-sidebar .rm-exam-header {
    padding: 14px 16px;
}

.rm-qotd--sidebar .rm-qotd-title,
.rm-sidebar .rm-ranking-title,
.rm-sidebar .rm-archive-title,
.rm-sidebar .rm-exam-title {
    font-size: 1rem;
}

/* Content compacto */
.rm-qotd--sidebar .rm-qotd-content {
    padding: 14px;
}

/* Meta badges compactos */
.rm-qotd--sidebar .rm-qotd-meta span {
    padding: 3px 8px;
    font-size: 0.7rem;
}

/* Opciones compactas (mantiene 44px touch target) */
.rm-qotd--sidebar .rm-qotd-option,
.rm-sidebar .rm-exam-option {
    padding: 10px 12px;
    min-height: var(--rm-touch-target);
}

.rm-qotd--sidebar .rm-qotd-option-letter {
    width: 28px;
    height: 28px;
    font-size: 0.85rem;
}

.rm-qotd--sidebar .rm-qotd-option-text {
    font-size: 0.85rem;
}

/* Botones sidebar */
.rm-qotd--sidebar .rm-qotd-btn {
    padding: 10px 16px;
    font-size: 0.9rem;
}

/* Stats grid compacto */
.rm-sidebar .rm-stats-grid {
    gap: 10px;
}

.rm-sidebar .rm-stats-card {
    padding: 12px;
}

/* Ranking compacto */
.rm-sidebar .rm-ranking-row {
    padding: 12px 14px;
}

.rm-sidebar .rm-ranking-position {
    width: 28px;
    height: 28px;
    font-size: 0.85rem;
}