@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700&display=swap');

:root {
  --primary: #4A6FA5;
  --secondary: #166088;
  --accent: #4FC3F7;
  --dark: #1A2639;
  --light: #F0F4F8;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Inter', sans-serif;
}

body {
  display: flex;
  min-height: 100vh;
  background-color: var(--light);
}

aside {
  width: 280px;
  background-color: white;
  padding: 20px;
  box-shadow: 2px 0 10px rgba(0,0,0,0.1);
}

.user-profile {
  text-align: center;
  margin-bottom: 30px;
}

.user-profile img {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: 10px;
}

nav {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

nav a {
  padding: 12px 15px;
  text-decoration: none;
  color: var(--dark);
  border-radius: 8px;
  transition: all 0.3s;
  display: flex;
  align-items: center;
  gap: 10px;
}

nav a:hover,
nav a.active {
  background-color: var(--light);
  color: var(--primary);
}

nav a button {
  background-color: #FFD166;
  color: var(--dark);
  border: none;
  border-radius: 8px;
  padding: 10px;
  width: 100%;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s;
}

nav a button:hover {
  background-color: #ceba7e;
}

main {
  flex: 1;
  padding: 30px;
  overflow-y: auto;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
}

.search-bar {
  padding: 10px 15px;
  border-radius: 25px;
  border: 1px solid #ddd;
  width: 300px;
}

.categories {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.category-card {
  background-color: white;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
  transition: transform 0.3s;
  cursor: pointer;
}

.category-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 6px 12px rgba(0,0,0,0.15);
}

.category-card h3 {
  color: var(--primary);
  margin-bottom: 10px;
}

/* Modales */
.flashcard-modal,
.difficulty-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0,0,0,0.7);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.flashcard-modal.active,
.difficulty-modal.active {
  display: flex;
}

.flashcard-content,
.difficulty-content {
  background-color: white;
  width: 90%;
  max-width: 800px;
  border-radius: 15px;
  padding: 30px;
  position: relative;
  box-shadow: 0 10px 25px rgba(0,0,0,0.2);
}

.close-modal {
  position: absolute;
  top: 15px;
  right: 15px;
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  color: #666;
}

/* Elementos de flashcard */
.flashcard-question {
  font-size: 24px;
  text-align: center;
  margin: 30px 0;
  min-height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.flashcard-answer {
  display: none;
  font-size: 20px;
  color: var(--secondary);
  text-align: center;
  margin: 30px 0;
  min-height: 100px;
  align-items: center;
  justify-content: center;
}

.controls {
  display: flex;
  justify-content: space-between;
  margin-top: 30px;
}

.controls button {
  padding: 12px 25px;
  border-radius: 8px;
  border: none;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s;
}

.show-answer-btn {
  background-color: var(--primary);
  color: white;
}

.next-btn {
  background-color: var(--accent);
  color: white;
}

.difficulty-btn {
  padding: 10px 20px;
  border-radius: 20px;
  border: none;
  color: white;
  font-weight: bold;
  cursor: pointer;
  transition: transform 0.3s;
}

.difficulty-btn:hover {
  transform: scale(1.05);
}

.easy { background-color: #43A047; }
.medium { background-color: #FB8C00; }
.hard { background-color: #E53935; }
.dont-know { background-color: #757575; }

.progress-container {
  margin-top: 30px;
}

.progress-bar {
  height: 8px;
  background-color: #e0e0e0;
  border-radius: 4px;
  overflow: hidden;
}

.progress {
  height: 100%;
  background-color: var(--primary);
  width: 0%;
  transition: width 0.3s;
}

/* ✅ Agrupación visual de flashcards por nivel */
.flashcard-list {
  display: flex;
  flex-direction: column;
  gap: 35px;
  margin-top: 20px;
}

.level-label {
  font-size: 20px;
  font-weight: 600;
  color: var(--dark);
  margin-bottom: 10px;
}

.flashcard-group {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 20px;
}

.flashcard-box {
  background-color: white;
  border: 1px solid #ddd;
  border-left: 6px solid;
  border-radius: 10px;
  padding: 20px;
  box-shadow: 0 5px 12px rgba(0,0,0,0.05);
  transition: transform 0.25s;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.flashcard-box:hover {
  transform: translateY(-6px);
}

.flashcard-box p {
  margin: 0;
  line-height: 1.4;
  color: #444;
  font-size: 15px;
}

.easy-group .flashcard-box { border-left-color: #43A047; }
.medium-group .flashcard-box { border-left-color: #FB8C00; }
.hard-group .flashcard-box { border-left-color: #E53935; }

@media (max-width: 768px) {
  body {
    flex-direction: column;
  }

  aside {
    width: 100%;
  }

  .topbar {
    flex-direction: column;
    gap: 15px;
  }

  .search-bar {
    width: 100%;
  }

  .difficulty-buttons {
    flex-direction: row;
    flex-wrap: wrap;
  }
}
/* Contenedor de botones: estilo horizontal y centrado */
.controls {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 20px;
  flex-wrap: wrap;
}

/* Contenedor de botones */
.controls {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 20px;
}

/* Estilo base para todos los botones */
.controls button {
  font-weight: 600;
  font-size: 16px;
  border: none;
  border-radius: 8px;
  padding: 12px 20px;
  min-width: 160px;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

/* Mostrar respuesta: azul oscuro */
.show-answer-btn {
  background-color: #4A6FA5;
  color: white;
}

.show-answer-btn:hover {
  background-color: #4A6FA5;
}

/* Siguiente: azul claro */
.next-btn {
  background-color: #6190d7;
  color: white;
}

.next-btn:hover {
  background-color: #2563eb;
}

/* Volver: gris claro con un toque violeta */
.back-btn {
  background-color: #bdc5d3;
  color: #9f21e3;
  border: 2px solid #e5e7eb;
}

.back-btn:hover {
  background-color: #e5e7eb;
}
