:root {
  --aprueba-blue: #283791;
  --aprueba-green: #3ab249;
  --aprueba-orange: #f18121;
  --aprueba-white: #ffffff;

  --aprueba-bg: #f8fafc;
  --aprueba-text: #334155;
  --aprueba-text-light: #64748b;
  --aprueba-border: #e2e8f0;
  --aprueba-radius: 16px;
  --aprueba-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --aprueba-error: #ef4444;
}

#aprueba-simulator-app {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background-color: var(--aprueba-bg);
  color: var(--aprueba-text);
  min-height: 600px;
  border-radius: var(--aprueba-radius);
  overflow: hidden;
  box-shadow: var(--aprueba-shadow);
  position: relative;
  border-bottom: 8px solid var(--aprueba-orange);
  /* Orange footer accent */
}

/* Typography */
#aprueba-simulator-app h1,
#aprueba-simulator-app h2 {
  color: var(--aprueba-blue);
  font-weight: 800;
  letter-spacing: -0.025em;
}

#aprueba-simulator-app h3 {
  color: var(--aprueba-green);
  font-weight: 700;
}

/* Utilities */
.aprueba-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  border-radius: 50px;
  /* More rounded for modern feel */
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
  background-color: var(--aprueba-blue);
  color: white;
  text-decoration: none;
  box-shadow: 0 4px 6px -1px rgba(40, 55, 145, 0.3);
}

.aprueba-btn:hover {
  background-color: #1e2b7a;
  color: white !important;
  /* Darker blue */
  transform: translateY(-1px);
  box-shadow: 0 6px 8px -1px rgba(40, 55, 145, 0.4);
}

.aprueba-btn-danger {
  background-color: var(--aprueba-error);
  box-shadow: 0 4px 6px -1px rgba(239, 68, 68, 0.3);
}

.aprueba-btn-danger:hover {
  background-color: #dc2626;
  color: white !important;
  box-shadow: 0 6px 8px -1px rgba(239, 68, 68, 0.4);
}

.aprueba-btn-action {
  background-color: var(--aprueba-orange);
  box-shadow: 0 4px 6px -1px rgba(241, 129, 33, 0.3);
}

.aprueba-btn-action:hover {
  background-color: #d97016;
}

.aprueba-btn-outline {
  background-color: transparent;
  border: 2px solid var(--aprueba-blue);
  color: var(--aprueba-blue);
  border-radius: 50px;
  font-weight: 600;
}

.aprueba-btn-outline:hover {
  background-color: var(--aprueba-blue);
  color: white;
}

.aprueba-container {
  padding: 2rem;
  max-width: 1200px;
  margin: 0 auto;
}

/* Loading */
.aprueba-loading {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100%;
  font-size: 1.2rem;
  color: var(--aprueba-blue);
  font-weight: 600;
  padding: 4rem;
}

/* Grid Layout for Selection */
.aprueba-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}

.aprueba-card {
  background: var(--aprueba-white);
  border-radius: var(--aprueba-radius);
  padding: 2.5rem;
  text-align: center;
  border: 1px solid transparent;
  box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.05);
  transition: all 0.3s ease;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.aprueba-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 6px;
  background: var(--aprueba-green);
  opacity: 0;
  transition: opacity 0.3s;
}

.aprueba-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.1);
  border-color: var(--aprueba-border);
}

.aprueba-card:hover::before {
  opacity: 1;
}

.aprueba-card h3 {
  margin-top: 1rem;
  margin-bottom: 0.5rem;
  font-size: 1.5rem;
}

.aprueba-icon {
  font-size: 3.5rem;
  margin-bottom: 1rem;
  display: block;
}

/* Simulator Interface */
.aprueba-simulator-layout {
  display: grid;
  grid-template-columns: 300px 1fr;
  height: 100%;
  min-height: 650px;
  background: white;
}

/* Sidebar */
.aprueba-sidebar {
  background: #f1f5f9;
  border-right: 1px solid var(--aprueba-border);
  padding: 2rem;
  display: flex;
  flex-direction: column;
}

.aprueba-timer {
  background: var(--aprueba-blue);
  color: white;
  padding: 1rem;
  border-radius: 12px;
  text-align: center;
  font-size: 1.8rem;
  font-weight: 800;
  margin-bottom: 2rem;
  box-shadow: 0 4px 6px -1px rgba(40, 55, 145, 0.2);
}

.aprueba-nav-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.5rem;
  margin-bottom: auto;
}

.aprueba-nav-item {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: white;
  border: 1px solid var(--aprueba-border);
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--aprueba-text-light);
  transition: all 0.2s;
}

.aprueba-nav-item:hover {
  border-color: var(--aprueba-blue);
  color: var(--aprueba-blue);
}

.aprueba-nav-item.active {
  border-color: var(--aprueba-blue);
  color: var(--aprueba-blue);
  background: #e0e7ff;
  font-weight: 800;
  transform: scale(1.1);
}

.aprueba-nav-item.answered {
  background: var(--aprueba-blue);
  color: white;
  border-color: var(--aprueba-blue);
}

/* Main Content */
.aprueba-content {
  padding: 3rem;
  display: flex;
  flex-direction: column;
  background: white;
}

.aprueba-question-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid #f1f5f9;
}

.aprueba-question-header span:first-child {
  font-weight: 700;
  color: var(--aprueba-blue);
  font-size: 1.1rem;
}

.aprueba-question-header span:last-child {
  font-weight: 600;
  color: var(--aprueba-green);
  text-transform: uppercase;
  font-size: 0.9rem;
  letter-spacing: 0.05em;
}

.aprueba-question-text {
  font-size: 1.4rem;
  line-height: 1.5;
  margin-bottom: 2.5rem;
  font-weight: 600;
  color: var(--aprueba-text);
}

.aprueba-options {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.aprueba-option {
  display: flex;
  align-items: center;
  padding: 1.25rem;
  border: 2px solid var(--aprueba-border);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s;
  background: white;
}

.aprueba-option:hover {
  border-color: var(--aprueba-blue);
  background: #f8fafc;
}

.aprueba-option.selected {
  border-color: var(--aprueba-blue);
  background: #eff6ff;
}

.aprueba-option-marker {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid var(--aprueba-border);
  margin-right: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-weight: 600;
  color: var(--aprueba-text-light);
}

.aprueba-option.selected .aprueba-option-marker {
  border-color: var(--aprueba-blue);
  background: var(--aprueba-blue);
  color: white;
}

.aprueba-option-marker::after {
  content: attr(data-letter);
  font-size: 0.9rem;
}

.aprueba-actions {
  margin-top: 3rem;
  display: flex;
  justify-content: space-between;
  padding-top: 2rem;
  border-top: 1px solid #f1f5f9;
}

/* Results */
.aprueba-results-header {
  text-align: center;
  margin-bottom: 3rem;
  padding: 2rem;
  background: white;
  border-radius: var(--aprueba-radius);
}

.aprueba-score-circle {
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: var(--aprueba-green);
  /* Green for score */
  color: white;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.5rem;
  font-size: 3.5rem;
  font-weight: 800;
  box-shadow: 0 20px 25px -5px rgba(58, 178, 73, 0.4);
  border: 8px solid rgba(255, 255, 255, 0.2);
}

.aprueba-score-label {
  font-size: 1.1rem;
  font-weight: 500;
  opacity: 0.95;
  margin-top: 0.5rem;
}

.aprueba-review-item {
  background: white;
  border: 1px solid var(--aprueba-border);
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 1rem;
  box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.05);
}

.aprueba-review-item.correct {
  border-left: 6px solid var(--aprueba-green);
}

.aprueba-review-item.incorrect {
  border-left: 6px solid var(--aprueba-orange);
  /* Orange for errors */
}

.aprueba-explanation {
  margin-top: 1rem;
  padding: 1rem;
  background: #f8fafc;
  border-radius: 8px;
  font-size: 0.95rem;
  color: var(--aprueba-text);
  border-left: 4px solid var(--aprueba-blue);
}

/* Leaderboard Form */
.aprueba-form-group {
  margin-bottom: 1rem;
  text-align: left;
}

.aprueba-input {
  width: 100%;
  padding: 0.875rem;
  border: 2px solid var(--aprueba-border);
  border-radius: 8px;
  font-size: 1rem;
  transition: border-color 0.2s;
}

.aprueba-input:focus {
  outline: none;
  border-color: var(--aprueba-blue);
}

/* Responsive */
@media (max-width: 768px) {
  .aprueba-simulator-layout {
    grid-template-columns: 1fr;
  }

  .aprueba-sidebar {
    display: none;
  }

  .aprueba-content {
    padding: 1.5rem;
  }

  .aprueba-question-text {
    font-size: 1.2rem;
  }
}

/* Question Bank Styles */
.aprueba-bank-list {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin-bottom: 3rem;
}

.aprueba-bank-item {
  background: white;
  border: 1px solid var(--aprueba-border);
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
}

.aprueba-bank-question {
  font-weight: 600;
  font-size: 1.1rem;
  margin-bottom: 1rem;
  display: flex;
  gap: 0.5rem;
  align-items: baseline;
  /* Align number with text baseline */
}

.aprueba-bank-text-content {
  flex: 1;
  /* Take remaining space */
  line-height: 1.5;
}

.aprueba-bank-number {
  color: var(--aprueba-blue);
  font-weight: 800;
  min-width: 40px;
}

.aprueba-bank-options-container {
  margin-top: 1rem;
  margin-bottom: 1rem;
  padding-left: 1rem;
  border-left: 2px solid var(--aprueba-border);
}

.aprueba-bank-option {
  padding: 0.5rem;
  margin-bottom: 0.25rem;
  border-radius: 6px;
  display: flex;
  align-items: center;
}

.aprueba-bank-option.correct-answer {
  background-color: #dcfce7;
  color: #166534;
  font-weight: 600;
}

.aprueba-bank-marker {
  font-weight: 700;
  margin-right: 0.75rem;
  color: var(--aprueba-text-light);
}

.aprueba-btn-sm {
  background: var(--aprueba-bg);
  border: 1px solid var(--aprueba-border);
  padding: 0.5rem 1rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--aprueba-text);
  font-weight: 600;
}

.aprueba-btn-sm:hover {
  background: #e2e8f0;
}

/* Pagination Styles */
.aprueba-pagination-container {
  display: flex;
  justify-content: center;
  margin-top: 2rem;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.aprueba-page-btn,
.aprueba-page-ellipsis {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 0.75rem;
  margin: 0;
  border: 1px solid #dee2e6;
  background-color: #fff;
  color: #007bff;
  font-size: 1rem;
  line-height: 1.5;
  text-decoration: none;
  cursor: pointer;
  transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.aprueba-page-btn:hover {
  color: #0056b3;
  background-color: #e9ecef;
  border-color: #dee2e6;
  z-index: 2;
}

.aprueba-page-btn:focus {
  z-index: 3;
  outline: 0;
  box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

.aprueba-page-btn.active {
  z-index: 3;
  color: #fff;
  background-color: #007bff;
  border-color: #007bff;
  cursor: default;
}

.aprueba-page-btn.disabled {
  color: #6c757d;
  pointer-events: none;
  background-color: #fff;
  border-color: #dee2e6;
}

.aprueba-page-ellipsis {
  color: #6c757d;
  pointer-events: none;
  cursor: default;
}

/* Remove gaps between buttons */
.aprueba-page-btn+.aprueba-page-btn,
.aprueba-page-btn+.aprueba-page-ellipsis,
.aprueba-page-ellipsis+.aprueba-page-btn {
  margin-left: -1px;
}

/* Rounded corners for first and last items */
.aprueba-pagination-container> :first-child {
  border-top-left-radius: 0.25rem;
  border-bottom-left-radius: 0.25rem;
}

.aprueba-pagination-container> :last-child {
  border-top-right-radius: 0.25rem;
  border-bottom-right-radius: 0.25rem;
}

.aprueba-badge {
  background: var(--aprueba-blue);
  color: white;
  padding: 0.25rem 0.75rem;
  border-radius: 50px;
  font-size: 0.85rem;
  font-weight: 700;
}

/* Mobile Optimization Styles */
.aprueba-mobile-toggle {
  display: none;
  background: #f8f9fa;
  border: 1px solid #dee2e6;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  color: var(--aprueba-text);
  padding: 0.5rem 0.75rem;
  margin-right: 0.75rem;
  line-height: 1;
  align-items: center;
  transition: background-color 0.2s, border-color 0.2s;
}

.aprueba-mobile-toggle:hover {
  background-color: #e9ecef;
  border-color: #ced4da;
}

.aprueba-sidebar-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 999;
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}

.aprueba-sidebar-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

@media (max-width: 768px) {
  .aprueba-mobile-toggle {
    display: block;
  }

  .aprueba-sidebar-overlay {
    display: block;
    /* But hidden by opacity until open */
  }

  .aprueba-sidebar {
    display: block !important;
    /* Override previous display: none */
    position: fixed;
    top: 0;
    left: -280px;
    /* Width of sidebar */
    height: 100vh;
    z-index: 1000;
    transition: left 0.3s ease;
    background: white;
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.1);
    width: 280px;
    padding: 1rem;
    overflow-y: auto;
  }

  .aprueba-sidebar.open {
    left: 0;
  }

  .aprueba-question-header {
    display: flex;
    align-items: center;
  }
}