/* CSS Puro - Variáveis e Reset */
:root {
  --bg-color: #f0f4f8;
  --primary-color: #2563eb;
  --primary-hover: #1d4ed8;
  --text-main: #1f2937;
  --text-muted: #6b7280;
  --card-bg: #ffffff;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --gray-light: #e5e7eb;
  --nav-height: 60px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Poppins', sans-serif;
}

body {
  background-color: var(--bg-color);
  color: var(--text-main);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Utilitários */
.hidden { display: none !important; }
.fade-in { animation: fadeIn 0.3s ease-in-out; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* Header */
header {
  background-color: var(--card-bg);
  padding: 15px 20px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 10;
}

.user-info { display: flex; flex-direction: column; }
.user-name { font-weight: 600; font-size: 1.1rem; color: var(--primary-color); }
.user-class { font-size: 0.8rem; color: var(--text-muted); }

.btn {
  background-color: var(--primary-color);
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 500;
  transition: background 0.2s;
}
.btn:hover { background-color: var(--primary-hover); }
.btn-outline { background: transparent; border: 1px solid var(--primary-color); color: var(--primary-color); }
.btn-outline:hover { background: var(--primary-color); color: white; }

/* Layout Principal */
main {
  flex: 1;
  padding: 20px;
  padding-bottom: calc(var(--nav-height) + 20px);
  max-width: 800px;
  margin: 0 auto;
  width: 100%;
}

/* View: Login */
#view-login {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 80vh;
  text-align: center;
}
.login-box {
  background: var(--card-bg);
  padding: 40px;
  border-radius: 16px;
  box-shadow: 0 4px 6px rgba(0,0,0,0.05);
  width: 100%;
  max-width: 400px;
}
.login-box h1 { color: var(--primary-color); margin-bottom: 20px; font-size: 1.5rem; }
.input-group { margin-bottom: 15px; text-align: left; }
.input-group label { display: block; font-size: 0.9rem; margin-bottom: 5px; font-weight: 500; }
.input-group input, .input-group select {
  width: 100%; padding: 10px; border: 1px solid var(--gray-light); border-radius: 8px; font-size: 1rem;
}
.login-box button { width: 100%; margin-top: 10px; padding: 12px; font-size: 1rem; }

/* View: Home (Mapa de Habilidades) */
.motivational-msg {
  background: linear-gradient(135deg, var(--primary-color), #60a5fa);
  color: white;
  padding: 15px 20px;
  border-radius: 12px;
  margin-bottom: 20px;
  font-weight: 500;
}

.section-title { font-size: 1.2rem; font-weight: 600; margin-bottom: 15px; }

.skills-grid { display: grid; grid-template-columns: 1fr; gap: 15px; }
@media(min-width: 600px) { .skills-grid { grid-template-columns: 1fr 1fr; } }

.skill-card {
  background: var(--card-bg);
  border-radius: 12px;
  padding: 15px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  position: relative;
  border-left: 5px solid var(--gray-light);
}
.skill-card:hover:not(.locked) { transform: translateY(-3px); box-shadow: 0 4px 8px rgba(0,0,0,0.1); }
.skill-card.status-novo { border-left-color: var(--warning); }
.skill-card.status-revisar { border-left-color: var(--danger); }
.skill-card.status-concluido { border-left-color: var(--success); }

.skill-card.locked { opacity: 0.6; cursor: not-allowed; }
.skill-title { font-weight: 600; font-size: 1rem; margin-bottom: 5px; padding-right: 20px; }
.skill-desc { font-size: 0.8rem; color: var(--text-muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.badge { display: inline-block; padding: 3px 8px; border-radius: 12px; font-size: 0.7rem; font-weight: 600; margin-top: 10px; color: white; }
.badge.novo { background: var(--warning); color: #fff; }
.badge.revisar { background: var(--danger); }
.badge.concluido { background: var(--success); }
.lock-icon { position: absolute; top: 15px; right: 15px; font-size: 1.2rem; }

/* View: Tutor Socrático (Chat) */
.study-header { margin-bottom: 15px; }
.progress-bar-container { width: 100%; height: 8px; background: var(--gray-light); border-radius: 4px; overflow: hidden; margin-top: 10px; }
.progress-bar { height: 100%; background: var(--primary-color); width: 0%; transition: width 0.3s; }

.chat-container { display: flex; flex-direction: column; gap: 15px; padding-bottom: 20px; }
.chat-bubble { max-width: 85%; padding: 12px 16px; border-radius: 16px; font-size: 0.95rem; line-height: 1.4; animation: fadeIn 0.3s; }
.chat-bubble.tutor { background: white; align-self: flex-start; border-bottom-left-radius: 4px; box-shadow: 0 1px 2px rgba(0,0,0,0.05); }
.chat-bubble.user { background: var(--primary-color); color: white; align-self: flex-end; border-bottom-right-radius: 4px; }

.options-container { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; }
.option-btn { background: white; border: 1px solid var(--primary-color); color: var(--primary-color); padding: 12px; border-radius: 8px; text-align: left; cursor: pointer; transition: all 0.2s; font-size: 0.95rem; }
.option-btn:hover { background: var(--primary-color); color: white; }

/* View: Dashboard */
.stats-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 20px; }
.stat-card { background: white; padding: 15px; border-radius: 12px; text-align: center; box-shadow: 0 1px 3px rgba(0,0,0,0.05); }
.stat-value { font-size: 1.5rem; font-weight: 700; color: var(--primary-color); }
.stat-label { font-size: 0.8rem; color: var(--text-muted); }

.chart-container { background: white; padding: 15px; border-radius: 12px; margin-bottom: 20px; position: relative; height: 300px; width: 100%; }

.history-table { width: 100%; border-collapse: collapse; background: white; border-radius: 12px; overflow: hidden; font-size: 0.85rem; }
.history-table th, .history-table td { padding: 10px; text-align: left; border-bottom: 1px solid var(--gray-light); }
.history-table th { background: var(--gray-light); font-weight: 600; }

.achievements-container { display: flex; gap: 10px; overflow-x: auto; padding: 10px 0; }
.achievement { background: white; padding: 10px; border-radius: 8px; display: flex; flex-direction: column; align-items: center; min-width: 100px; opacity: 0.5; filter: grayscale(1); transition: all 0.3s; }
.achievement.unlocked { opacity: 1; filter: grayscale(0); box-shadow: 0 2px 4px rgba(0,0,0,0.1); }
.achievement-icon { font-size: 1.5rem; margin-bottom: 5px; }
.achievement-text { font-size: 0.7rem; text-align: center; }

/* Navegação Inferior */
nav {
  position: fixed;
  bottom: 0;
  width: 100%;
  background: white;
  height: var(--nav-height);
  display: flex;
  justify-content: space-around;
  align-items: center;
  box-shadow: 0 -2px 10px rgba(0,0,0,0.05);
  z-index: 100;
}
.nav-item { display: flex; flex-direction: column; align-items: center; color: var(--text-muted); text-decoration: none; font-size: 0.75rem; cursor: pointer; transition: color 0.2s; flex: 1; padding: 10px 0; }
.nav-item.active { color: var(--primary-color); font-weight: 600; }
.nav-icon { font-size: 1.2rem; margin-bottom: 2px; }