/*
 * SabioPlay microlearning app – CSS
 *
 * This stylesheet defines the colours, typography and layout rules
 * for the SabioPlay prototype. The goal is to approximate the
 * clean, playful aesthetic seen in popular microlearning apps while
 * remaining simple and performant. Colours and spacing values are
 * defined as CSS variables at the root level for easy theming.
 */

:root {
  --blue: #0047ab;
  --dark-blue: #003a8c;
  --light-blue: #005bcc;
  --yellow: #ffcc00;
  --white: #ffffff;
  --gray: #f2f2f2;
  --text-color: var(--white);
  --card-bg-1: #0057d8;
  --card-bg-2: #008080;
  --card-bg-3: #b8860b;
  --card-bg-4: #8a2be2;
}

/* Reset default margins and set base typography */
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  font-family: Arial, Helvetica, sans-serif;
  background-color: var(--blue);
  color: var(--text-color);
}

h1, h2, h3, h4, h5, h6 {
  margin: 0;
  font-weight: 600;
  line-height: 1.2;
}

p {
  margin: 0.5rem 0;
  line-height: 1.4;
}

/* Buttons */
.button {
  display: inline-block;
  padding: 0.8rem 1.4rem;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  transition: background-color 0.2s ease;
}

.button.primary {
  background-color: var(--yellow);
  color: var(--blue);
}

.button.primary:hover {
  background-color: #e6b800;
}

/* Welcome screen */
.welcome {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  text-align: center;
  padding: 1.5rem;
}

.logo-large {
  width: 180px;
  height: 180px;
  margin-bottom: 1.5rem;
}

.tagline {
  margin-bottom: 2rem;
  font-size: 1.1rem;
  opacity: 0.9;
}

/* Login page */
.login {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 1rem;
  text-align: center;
}

.login-form {
  width: 100%;
  max-width: 320px;
  margin-top: 1rem;
}

.login-form input {
  width: 100%;
  padding: 0.75rem;
  margin-bottom: 0.75rem;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  color: var(--blue);
  background-color: var(--gray);
}

.login-form button {
  width: 100%;
  margin-top: 0.5rem;
}

.note {
  font-size: 0.85rem;
  opacity: 0.8;
  margin-top: 0.75rem;
}

/* Site header */
.site-header {
  background-color: var(--dark-blue);
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--light-blue);
  position: sticky;
  top: 0;
  z-index: 10;
}

.site-header.small {
  padding: 0.5rem 1rem;
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.header-inner h1 {
  font-size: 1.25rem;
}

.logo-small {
  width: 42px;
  height: 42px;
}

/* Main content areas */
.home-main, .summary-main, .profile-main {
  padding: 1rem;
  padding-bottom: 5rem; /* leave space for nav */
}

/* Grid of resumos */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  border-radius: 12px;
  text-align: center;
  color: var(--white);
  cursor: pointer;
  min-height: 140px;
  font-weight: 600;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
  transition: transform 0.15s ease;
}

.card:hover {
  transform: translateY(-4px);
}

.card .author {
  font-size: 0.75rem;
  margin-top: 0.25rem;
  opacity: 0.8;
}

.card.locked::after {
  content: '🔒';
  position: absolute;
  top: 8px;
  right: 8px;
  font-size: 1.2rem;
}

/* Summary content */
.summary-main h2 {
  margin-bottom: 0.5rem;
}

.summary-main .author {
  opacity: 0.8;
  margin-bottom: 1rem;
}

.summary-main .text {
  line-height: 1.5;
  margin-bottom: 1.5rem;
  white-space: pre-wrap;
}

.summary-main .note {
  font-size: 0.9rem;
  opacity: 0.9;
}

/* Profile */
.profile-main {
  text-align: center;
}

.profile-main .stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1rem;
  margin-top: 1.5rem;
}

.profile-main .stat {
  background-color: var(--dark-blue);
  border-radius: 12px;
  padding: 1rem;
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.profile-main .stat-value {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.profile-main .stat-label {
  font-size: 0.9rem;
  opacity: 0.8;
}

/* Bottom navigation */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background-color: var(--dark-blue);
  border-top: 1px solid var(--light-blue);
  display: flex;
  justify-content: space-around;
  padding: 0.4rem 0;
  z-index: 10;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: var(--text-color);
  font-size: 0.7rem;
}

.nav-item img.nav-icon {
  width: 22px;
  height: 22px;
  margin-bottom: 0.2rem;
  filter: brightness(0) invert(1);
}

.nav-item.active {
  color: var(--yellow);
}

.nav-item.active img.nav-icon {
  filter: brightness(0) invert(0.9) sepia(1) saturate(10000%) hue-rotate(20deg);
}

/* Back link */
.back-link {
  color: var(--text-color);
  text-decoration: none;
  font-size: 1rem;
  margin-right: 0.5rem;
}

.back-link:hover {
  text-decoration: underline;
}