@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;600;700&display=swap');

/* ==================== */
/* Variables CSS - Diseño Mejorado */
/* ==================== */
:root {
    /* Marca */
    --brand-dark: #152A1D;
    --brand-accent: #152A1D;

    /* Colores principales */
    --primary-color: var(--brand-dark);
    --primary-dark: #0f1f15;
    --primary-light: #1f3a29;

    /* Colores de acento */
    --accent-green: var(--brand-accent);
    --accent-mint: #7af6c0;
    --accent-cyan: #98e1f4;
    --accent-blue: #5be4eb;
    --accent-purple: #8858df;

    /* Colores de estado */
    --success-color: #7af6c0;
    --danger-color: #ff8f24;
    --warning-color: var(--brand-accent);

    /* Fondos y superficies */
    --bg-dark: var(--brand-dark);
    --bg-darker: #0f1f15;
    --bg-light: #f5f5f5;
    --surface: #ffffff;
    --surface-hover: rgba(191, 247, 94, 0.1);

    /* Helpers que usas en el CSS y no estaban definidos */
    --white: #ffffff;
    --light-bg: #f1f5f9;

    /* Textos */
    --text-primary: #152A1D;
    --text-secondary: #312f2f;
    --text-on-dark: #ffffff;
    --text-muted: #64748b;

    /* Bordes */
    --border-color: rgba(33, 33, 33, 0.08);
    --border-color-light: #e3e3e3;

    /* Sombras */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.15);
    --shadow-xl: 0 20px 40px rgba(0, 0, 0, 0.2);
    --shadow-glow: 0 0 20px rgba(191, 247, 94, 0.3);

    /* Bordes redondeados */
    --radius-sm: 8px;
    --radius: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;

    /* Transiciones */
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-fast: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==================== */
/* Reset y Base */
/* ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    color: var(--text-primary);
    background: linear-gradient(135deg, #f5f5f5 0%, #e3e3e3 100%);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ==================== */
/* Utilidades de Accesibilidad */
/* ==================== */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Focus visible para accesibilidad con teclado */
*:focus-visible {
    outline: 3px solid var(--primary-color);
    outline-offset: 2px;
}

/* ==================== */
/* Layout */
/* ==================== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.main-content {
    flex: 1;
    padding: 2rem 0;
}

/* ==================== */
/* Header */
/* ==================== */
.header {
    background: var(--brand-dark);
    color: var(--text-on-dark);
    padding: 2rem 0;
    box-shadow: var(--shadow-lg);
    border-bottom: 1px solid var(--border-color);
    position: relative;
}

.header-content {
    text-align: center;
}

.header a{
    text-decoration: none;
    color:inherit
}

.logo {
    font-family: 'Poppins', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    text-transform: lowercase;
    letter-spacing: 0.5px;
}

.logo img{
    height: 40px
}

.subtitle {
    font-size: 1.125rem;
    opacity: 0.9;
}

/* ==================== */
/* Views */
/* ==================== */
.view {
    animation: fadeIn 0.4s ease-in;
}

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

.section-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 2rem;
    text-align: center;
    color: var(--text-primary);
}

/* ==================== */
/* Search Bar */
/* ==================== */
.search-container {
    margin-bottom: 2rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.search-box {
    position: relative;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: 1.25rem;
    color: var(--text-secondary);
    pointer-events: none;
}

.search-input {
    width: 100%;
    padding: 1rem 1rem 1rem 3rem;
    font-size: 1rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    background: var(--white);
    transition: var(--transition);
}

.search-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(21, 42, 29, 0.12);
}

/* ==================== */
/* Subjects Grid */
/* ==================== */
.subjects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.subject-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    cursor: pointer;
    border: 1px solid var(--border-color);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.subject-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--brand-accent);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.subject-card:hover::before {
    transform: scaleX(1);
}

.subject-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl), var(--shadow-glow);
    border-color: var(--brand-accent);
    background: var(--surface-hover);
}

.subject-card:focus {
    border-color: var(--primary-color);
}

/* Iconos de temas: color #152A1D + fondo blanco */
.subject-icon {
    font-size: 3rem;
    color: var(--brand-dark);
    margin-bottom: 1rem;
    transition: var(--transition);

    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 4.5rem;
    height: 4.5rem;
    background: var(--white);
    border-radius: 999px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

.subject-card:hover .subject-icon {
    color: var(--brand-dark);
    transform: scale(1.08) rotate(3deg);
    border-color: var(--brand-accent);
    box-shadow: var(--shadow-md);
}

.subject-name {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.subject-info {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-secondary);
}

.empty-state i {
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* ==================== */
/* Tips Educativos */
/* ==================== */
.study-tips {
    margin-bottom: 2rem;
}

.tip-card {
  background-color: #ff8f24;
  position: relative;
  color: #fff;

  border-radius: var(--radius-lg);
  padding: 1.5rem;
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
  box-shadow: var(--shadow-md);
  animation: slideIn 0.5s ease;
}

.tip-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: rgba(0, 0, 0, 0.16); /* un poco menos oscuro */
  pointer-events: none;
}

.tip-card > * {
  position: relative;
}



@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.tip-card i {
    font-size: 2.5rem;
    color: var(--bg-light);
    flex-shrink: 0;
}

.tip-content h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--bg-light);
    margin-bottom: 0.5rem;
}

.tip-content p {
    color: var(--light-bg);
    line-height: 1.6;
    margin: 0;
}

/* ==================== */
/* Exam View */
/* ==================== */
.exam-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border-color);
}

.exam-meta {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.exam-timer {
    background: var(--surface);
    padding: 0.5rem 1rem;
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
}

.exam-timer i {
    color: var(--accent-cyan);
}

.btn-back {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    background: var(--white);
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.btn-back:hover {
    background: var(--light-bg);
    border-color: var(--primary-color);
}

.exam-subject-name {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    flex: 1;
    text-align: center;
}

.exam-progress {
    background: var(--primary-color);
    color: var(--white);
    padding: 0.5rem 1.25rem;
    border-radius: 50px;
    font-weight: 600;
}

/* Question Card */
.question-container {
    margin-bottom: 2rem;
}

.question-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
}

.question-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--brand-accent);
}

.question-text {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2rem;
    line-height: 1.6;
}

/* Code blocks */
.question-text pre, .answer-label pre, .result-explanation pre, .result-answer pre {
    background: #0f172a;
    color: #e2e8f0;
    border-radius: var(--radius);
    padding: 1rem;
    overflow: auto;
    border: 1px solid var(--border-color);
}

.question-text code, .answer-label code, .result-explanation code, .result-answer code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: 0.95rem;
}

/* Answers */
.answers-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.answer-option {
    position: relative;
    display: flex;
    align-items: center;
    padding: 1.25rem 1.5rem;
    background: var(--light-bg);
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    cursor: pointer;
    transition: var(--transition);
}

.answer-option:hover {
    background: #f1f5f9;
    border-color: var(--primary-color);
}

.answer-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

.answer-option input[type="radio"]:checked ~ .answer-label {
    font-weight: 600;
}

.answer-option input[type="radio"]:checked ~ .custom-radio::after {
    opacity: 1;
}

.answer-option.selected {
    background: linear-gradient(135deg, rgba(191, 247, 94, 0.15) 0%, rgba(122, 246, 192, 0.15) 100%);
    border-color: var(--accent-green);
    border-width: 2px;
    box-shadow: 0 0 0 3px rgba(191, 247, 94, 0.1);
}

.custom-radio {
    position: relative;
    width: 24px;
    height: 24px;
    border: 2px solid var(--border-color);
    border-radius: 50%;
    margin-right: 1rem;
    flex-shrink: 0;
    transition: var(--transition);
}

.answer-option:hover .custom-radio,
.answer-option.selected .custom-radio {
    border-color: var(--primary-color);
}

.custom-radio::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-green), var(--accent-mint));
    opacity: 0;
    transition: var(--transition);
    box-shadow: 0 0 8px rgba(191, 247, 94, 0.6);
}

.answer-option.selected .custom-radio::after {
    opacity: 1;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { transform: translate(-50%, -50%) scale(1); }
    50% { transform: translate(-50%, -50%) scale(1.1); }
}

.answer-label {
    flex: 1;
    font-size: 1rem;
    color: var(--text-primary);
}

/* Quick Actions */
.quick-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: var(--surface);
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    flex-wrap: wrap;
}

.btn-mark {
    background: var(--surface);
    border: 2px solid var(--border-color);
    color: var(--text-primary);
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-mark:hover {
    border-color: var(--accent-green);
    background: var(--surface-hover);
    transform: translateY(-2px);
}

.btn-mark.marked {
    background: linear-gradient(135deg, var(--accent-green), var(--accent-mint));
    border-color: var(--accent-green);
    color: var(--primary-color);
    font-weight: 700;
}

.btn-mark.marked i {
    animation: bookmarkPop 0.3s ease;
}

@keyframes bookmarkPop {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.3); }
}

.keyboard-hint {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--text-muted);
    font-size: 0.875rem;
    padding: 0.5rem 1rem;
    background: var(--bg-light);
    border-radius: var(--radius);
}

.keyboard-hint i {
    color: var(--accent-cyan);
}

/* Exam Navigation */
.exam-navigation {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 2rem;
}

/* Questions Map */
.questions-map {
    background: var(--white);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
}

.questions-map h4 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.questions-map-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(45px, 1fr));
    gap: 0.5rem;
}

.question-map-item {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--light-bg);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    transition: var(--transition);
}

.question-map-item:hover {
    transform: scale(1.05);
    border-color: var(--primary-color);
}

.question-map-item.answered {
    background: #dbeafe;
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.question-map-item.current {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    border-color: var(--accent-green);
    color: var(--text-on-dark);
    box-shadow: 0 0 12px rgba(191, 247, 94, 0.5);
    font-weight: 700;
}

.question-map-item.marked {
    position: relative;
    background: linear-gradient(135deg, var(--accent-green) 0%, var(--accent-mint) 100%);
    border-color: var(--accent-green);
    color: var(--primary-color);
    font-weight: 700;
}

.question-map-item.marked.current {
    background: linear-gradient(135deg, var(--primary-color), var(--accent-green));
    color: var(--text-on-dark);
}

/* ==================== */
/* Buttons */
/* ==================== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 1.75rem;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    color: var(--text-on-dark);
    border: 1px solid transparent;
    position: relative;
    overflow: hidden;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(191, 247, 94, 0.3), transparent);
    transition: left 0.5s;
}

.btn-primary:hover::before {
    left: 100%;
}

.btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary-color) 100%);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg), 0 0 20px rgba(21, 42, 29, 0.35);
    border-color: var(--accent-green);
}

.btn-secondary {
    background: var(--white);
    color: var(--text-primary);
    border: 2px solid var(--border-color);
}

.btn-secondary:hover:not(:disabled) {
    background: var(--light-bg);
    border-color: var(--primary-color);
}

.btn-success {
    background: linear-gradient(135deg, var(--accent-mint) 0%, var(--accent-cyan) 100%);
    color: var(--text-primary);
    font-weight: 700;
    border: 1px solid transparent;
}

.btn-success:hover:not(:disabled) {
    background: linear-gradient(135deg, var(--accent-green) 0%, var(--accent-mint) 100%);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg), var(--shadow-glow);
    border-color: var(--accent-green);
}

/* ==================== */
/* Results View */
/* ==================== */
.results-header {
    text-align: center;
    margin-bottom: 3rem;
}

.score-display {
    margin-top: 2rem;
}

.score-circle {
    display: inline-block;
    padding: 3rem;
    background: linear-gradient(135deg, var(--surface) 0%, #f5f5f5 100%);
    border-radius: 50%;
    box-shadow: var(--shadow-xl), 0 0 40px rgba(21, 42, 29, 0.08);
    border: 4px solid transparent;
    background-clip: padding-box;
    position: relative;
}

.score-circle::before {
    content: '';
    position: absolute;
    top: -4px;
    left: -4px;
    right: -4px;
    bottom: -4px;
    background: linear-gradient(135deg, var(--accent-green), var(--accent-cyan), var(--accent-mint));
    border-radius: 50%;
    z-index: -1;
    animation: rotate 3s linear infinite;
}

@keyframes rotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.score-percentage {
    display: block;
    font-size: 4rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1;
    margin-bottom: 0.5rem;
}

.score-text {
    font-size: 1.125rem;
    color: var(--text-secondary);
}

.score-time {
    font-size: 1rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.score-time i {
    color: var(--accent-cyan);
}

/* Detailed Results */
.detailed-results {
    margin-bottom: 2rem;
}

.result-item {
    background: var(--white);
    border-radius: var(--radius);
    padding: 2rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-sm);
    border-left: 4px solid transparent;
}

.result-item.correct {
    border-left-color: var(--success-color);
    background: linear-gradient(to right, rgba(122, 246, 192, 0.05), transparent);
}

.result-item.correct:hover {
    border-left-width: 6px;
    box-shadow: var(--shadow-md), -4px 0 12px rgba(122, 246, 192, 0.2);
}

.result-item.incorrect {
    border-left-color: var(--danger-color);
    background: linear-gradient(to right, rgba(230, 148, 90, 0.05), transparent);
}

.result-item.incorrect:hover {
    border-left-width: 6px;
    box-shadow: var(--shadow-md), -4px 0 12px rgba(230, 148, 90, 0.2);
}

.result-item-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.result-question {
    flex: 1;
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
}

.result-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 50px;
    font-size: 0.875rem;
    font-weight: 600;
    white-space: nowrap;
}

.result-badge.correct {
    background: linear-gradient(135deg, var(--accent-mint), var(--accent-cyan));
    color: var(--text-primary);
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(122, 246, 192, 0.3);
}

.result-badge.incorrect {
    background: linear-gradient(135deg, var(--danger-color), #f4a261);
    color: var(--text-on-dark);
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(230, 148, 90, 0.3);
}

.result-answers {
    margin-bottom: 1rem;
}

.result-answer {
    padding: 0.75rem 1rem;
    margin-bottom: 0.5rem;
    border-radius: 8px;
    font-size: 0.9375rem;
}

.result-answer.your-answer {
    background: #fef3c7;
    border-left: 3px solid var(--warning-color);
}

.result-answer.correct-answer {
    background: #d1fae5;
    border-left: 3px solid var(--success-color);
}

.result-answer strong {
    font-weight: 600;
}

.result-explanation {
    padding: 1rem;
    background: var(--light-bg);
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 0.9375rem;
    line-height: 1.6;
}

.result-explanation strong {
    color: var(--text-primary);
    display: block;
    margin-bottom: 0.5rem;
}

/* Results Actions */
.results-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 2rem;
}

/* ==================== */
/* Footer */
/* ==================== */
.footer {
    background: var(--white);
    border-top: 1px solid var(--border-color);
    padding: 2rem 0;
    text-align: center;
    color: var(--text-secondary);
    margin-top: auto;
}

/* ==================== */
/* Loading Overlay */
/* ==================== */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.spinner {
    text-align: center;
    color: var(--white);
}

/* ==================== */
/* Responsive Design */
/* ==================== */
@media (max-width: 768px) {
    .container {
        padding: 0 1rem;
    }

    .logo {
        font-size: 2rem;
    }

    .subtitle {
        font-size: 1rem;
    }

    .section-title {
        font-size: 1.5rem;
    }

    .subjects-grid {
        grid-template-columns: 1fr;
    }

    .tip-card {
        flex-direction: column;
        text-align: center;
    }

    .tip-card i {
        font-size: 2rem;
    }

    .exam-header {
        flex-direction: column;
        align-items: stretch;
    }

    .exam-subject-name {
        text-align: left;
        order: -1;
    }

    .exam-meta {
        flex-direction: column;
        gap: 0.75rem;
    }

    .exam-progress,
    .exam-timer {
        text-align: center;
        justify-content: center;
    }

    .quick-actions {
        flex-direction: column;
    }

    .keyboard-hint {
        width: 100%;
        justify-content: center;
        text-align: center;
    }

    .keyboard-hint span {
        font-size: 0.75rem;
    }

    .question-card {
        padding: 1.5rem;
    }

    .question-text {
        font-size: 1.125rem;
    }

    .exam-navigation {
        flex-direction: column;
    }

    .btn {
        width: 100%;
        justify-content: center;
    }

    .questions-map-grid {
        grid-template-columns: repeat(auto-fill, minmax(40px, 1fr));
    }

    .score-circle {
        padding: 2rem;
    }

    .score-percentage {
        font-size: 3rem;
    }

    .result-item {
        padding: 1.5rem;
    }

    .result-item-header {
        flex-direction: column;
    }

    .results-actions {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .logo {
        font-size: 1.75rem;
    }

    .question-map-item {
        font-size: 0.75rem;
    }
}

/* ==================== */
/* Print Styles */
/* ==================== */
@media print {
    .header,
    .footer,
    .exam-navigation,
    .questions-map,
    .results-actions,
    .btn-back {
        display: none;
    }

    body {
        background: white;
    }

    .question-card,
    .result-item {
        box-shadow: none;
        border: 1px solid var(--border-color);
        page-break-inside: avoid;
    }
}

/* ==================== */
/* Dark Mode Support (opcional) */
/* ==================== */
@media (prefers-color-scheme: dark) {
    /* Puedes añadir estilos dark mode si lo deseas */
}

/* ==================== */
/* Pomodoro flotante (draggable + colapsable) */
/* ==================== */
.pomodoro-widget {
    position: fixed;
    z-index: 9999;
    display: none; /* se muestra cuando el JS está listo */
    left: 24px;
    top: 24px;
    width: 320px;
    max-width: calc(100vw - 24px - 24px);
    user-select: none;
    -webkit-user-select: none;
    touch-action: none;
}

.pomodoro-widget[data-ready="true"] {
    display: block;
}

.pomodoro-collapsed,
.pomodoro-expanded {
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(33, 33, 33, 0.10);
    box-shadow: var(--shadow-md);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.pomodoro-collapsed {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px;
    border-radius: 999px;
    width: fit-content;
    max-width: 100%;
}

.pomodoro-collapsed-main {
    border: 0;
    background: transparent;
    display: flex;
    align-items: baseline;
    gap: 10px;
    padding: 6px 10px;
    border-radius: 999px;
    cursor: grab;
    color: var(--text-primary);
}

.pomodoro-collapsed-main:active {
    cursor: grabbing;
}

.pomodoro-expanded {
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.pomodoro-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    background: rgba(21, 42, 29, 0.06);
    border-bottom: 1px solid rgba(33, 33, 33, 0.10);
    cursor: grab;
}

.pomodoro-header:active {
    cursor: grabbing;
}

.pomodoro-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
}

.pomodoro-title i {
    color: var(--primary-color);
}

.pomodoro-header-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.pomodoro-body {
    padding: 12px;
}

.pomodoro-timer {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.pomodoro-time {
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.5px;
    font-weight: 700;
}

.pomodoro-time-lg {
    font-size: 2.2rem;
    line-height: 1;
}

.pomodoro-phase {
    font-size: 0.85rem;
    color: var(--text-muted);
    white-space: nowrap;
}

.pomodoro-phase-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.pomodoro-phase-badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(21, 42, 29, 0.10);
    border: 1px solid rgba(21, 42, 29, 0.15);
    font-size: 0.85rem;
    font-weight: 600;
}

.pomodoro-link-btn {
    border: 0;
    background: transparent;
    color: var(--text-muted);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    border-radius: 10px;
    cursor: pointer;
}

.pomodoro-link-btn:hover {
    background: rgba(33, 33, 33, 0.06);
    color: var(--text-primary);
}

.pomodoro-controls {
    display: flex;
    gap: 10px;
    margin-top: 12px;
    flex-wrap: wrap;
}

.pomodoro-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    border: 0;
    cursor: pointer;
    padding: 10px 12px;
    border-radius: 12px;
    background: var(--primary-color);
    color: var(--text-on-dark);
    font-weight: 700;
    box-shadow: var(--shadow-sm);
    transition: var(--transition-fast);
}

.pomodoro-btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.pomodoro-btn-ghost {
    background: rgba(33, 33, 33, 0.06);
    color: var(--text-primary);
    font-weight: 600;
}

.pomodoro-btn-ghost:hover {
    background: rgba(33, 33, 33, 0.10);
}

.pomodoro-btn-compact {
    padding: 10px 12px;
}

.pomodoro-icon-btn {
    border: 0;
    background: rgba(33, 33, 33, 0.06);
    color: var(--text-primary);
    width: 38px;
    height: 38px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition-fast);
}

.pomodoro-icon-btn:hover {
    background: rgba(33, 33, 33, 0.10);
    transform: translateY(-1px);
}

.pomodoro-settings {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px dashed rgba(33, 33, 33, 0.18);
}

.pomodoro-settings-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.pomodoro-setting {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto;
    gap: 6px 8px;
    align-items: center;
    padding: 10px;
    border-radius: 12px;
    background: rgba(33, 33, 33, 0.04);
    border: 1px solid rgba(33, 33, 33, 0.08);
}

.pomodoro-setting span {
    font-weight: 700;
    font-size: 0.85rem;
}

.pomodoro-setting input {
    width: 50px;
    padding: 8px 10px;
    border-radius: 10px;
    border: 1px solid rgba(33, 33, 33, 0.15);
    font-weight: 700;
    background: rgba(255, 255, 255, 0.85);
    font-size: 12px
}

.pomodoro-setting small {
    grid-column: 1 / -1;
    color: var(--text-muted);
    font-size: 0.75rem;
}

.pomodoro-settings-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 10px;
}

.pomodoro-hint {
    color: var(--text-muted);
    font-size: 0.8rem;
    line-height: 1.2;
}

#pomodoro-settings-toggle{
    display:none
}

/* Drag feedback */
.pomodoro-widget.is-dragging {
    opacity: 0.92;
    transition: none;
}

/* Mobile tweaks */
@media (max-width: 520px) {
    .pomodoro-widget {
        width: 292px;
    }

    .pomodoro-time-lg {
        font-size: 2rem;
    }
}
