/* ================================================================
   CIÊNCIA 360 – Dashboard Styles
   ================================================================ */

/* ---------- Reset & base ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
}

body {
  font-family: 'Inter', system-ui, sans-serif;
  min-height: 100vh;
  background-color: #051731;
  color: #e8edf4;
  display: flex;
  overflow-x: hidden;
}

/* ================================================================
   SIDEBAR
   ================================================================ */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: 210px;
  height: 100vh;
  background: #051731;
  border-right: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  flex-direction: column;
  z-index: 300;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Logo */
.sidebar__logo-wrap {
  display: flex;
  justify-content: center;
  padding: 1.5rem 1rem 1.25rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.sidebar__logo {
  width: 110px;
  height: 110px;
  object-fit: contain;
  border-radius: 50%;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.35));
  transition: transform 0.3s ease;
}

.sidebar__logo:hover {
  transform: scale(1.05) rotate(-2deg);
}

/* Nav */
.sidebar__nav {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 1.25rem 0.75rem;
  gap: 0.2rem;
  overflow-y: auto;
}

.sidebar__link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.9rem;
  border-radius: 10px;
  font-size: 0.875rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.65);
  text-decoration: none;
  transition: background 0.18s ease, color 0.18s ease;
}

.sidebar__link:hover {
  background: rgba(255, 255, 255, 0.07);
  color: #fff;
}

.sidebar__link--active {
  background: rgba(59, 130, 246, 0.15);
  color: #fff;
}

.sidebar__link--active .sidebar__icon {
  color: #3b82f6;
}

.sidebar__icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

/* Footer / Sair */
.sidebar__footer {
  padding: 1.25rem 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.btn-sair {
  width: 100%;
  height: 38px;
  border: none;
  border-radius: 999px;
  background: #2563eb;
  color: #fff;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  letter-spacing: 0.02em;
  box-shadow: 0 3px 10px rgba(37, 99, 235, 0.4);
  transition: background 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
}

.btn-sair:hover {
  background: #1d4ed8;
  transform: translateY(-1px);
  box-shadow: 0 5px 16px rgba(37, 99, 235, 0.55);
}

.btn-sair:active {
  transform: translateY(0);
}

/* Overlay mobile */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 200;
  backdrop-filter: blur(2px);
}

/* ================================================================
   LAYOUT (main area beside sidebar)
   ================================================================ */
.layout {
  margin-left: 210px;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ================================================================
   TOP BAR
   ================================================================ */
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0 1.75rem;
  height: 64px;
  background: rgba(5, 23, 49, 0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.topbar__hamburger {
  display: none;
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.75);
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  transition: color 0.2s ease, background 0.2s ease;
}

.topbar__hamburger:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.07);
}

.topbar__spacer {
  flex: 1;
}

/* Bell */
.topbar__bell {
  position: relative;
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.75);
  cursor: pointer;
  padding: 6px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s ease, background 0.2s ease;
}

.topbar__bell:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.07);
}

.topbar__bell-dot {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 7px;
  height: 7px;
  background: #ef4444;
  border-radius: 50%;
  border: 1.5px solid #0d1b2e;
}

/* User */
.topbar__user {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  cursor: pointer;
  border-radius: 10px;
  padding: 4px 10px 4px 6px;
  transition: background 0.2s ease;
}

.topbar__user:hover {
  background: rgba(255, 255, 255, 0.07);
}

.topbar__username {
  font-size: 0.875rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.9);
}

.topbar__avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3b82f6, #8b5cf6);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.4);
}

/* ================================================================
   MAIN CONTENT
   ================================================================ */
.main-content {
  flex: 1;
  padding: 1.75rem 1.75rem 2.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* ================================================================
   STATS ROW (Admin/Teacher view)
   ================================================================ */
.stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}

.stat-card {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 14px;
  padding: 1.1rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
  animation: fadeUp 0.5s ease both;
}

.stat-card:nth-child(1) {
  animation-delay: 0.05s;
}

.stat-card:nth-child(2) {
  animation-delay: 0.12s;
}

.stat-card:nth-child(3) {
  animation-delay: 0.19s;
}

.stat-card:hover {
  background: rgba(255, 255, 255, 0.08);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

.stat-card__icon-wrap {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.8);
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.stat-card__body {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.stat-card__label {
  font-size: 0.72rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.8);
  letter-spacing: 0.02em;
}

.stat-.card__title {
  margin: 0;
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.25rem;
  letter-spacing: 0.04em;
  font-weight: 400;
  color: #fff;
}

.stat-card__value {
  font-size: 1.2rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.01em;
}

/* ================================================================
   GAMIFIED DASHBOARD HEADER
   ================================================================ */
.gamified-dash {
  display: grid;
  grid-template-columns: 1fr 260px 260px;
  gap: 1.25rem;
  animation: fadeUp 0.5s ease both;
}

.gamified-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 16px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.gamified-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
  background: rgba(255, 255, 255, 0.06);
}

/* ── 1. Recomendado (Action) ── */
.gamified-card--action {
  justify-content: center;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.1), rgba(124, 58, 237, 0.05));
  border-color: rgba(59, 130, 246, 0.25);
}

.gamified-card__header {
  margin-bottom: 0.85rem;
}

.gamified-badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.gamified-card__title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.8rem;
  line-height: 1.1;
  margin-bottom: 0.5rem;
  letter-spacing: 0.02em;
}

.gamified-card__desc {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.7);
  line-height: 1.6;
  margin-bottom: 1.5rem;
  max-width: 90%;
}

.ld-btn-primary {
  align-self: flex-start;
  background: #2563eb;
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 0.65rem 1.5rem;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.4);
}

.ld-btn-primary:hover {
  background: #1d4ed8;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.6);
}

/* ── 2. Streak ── */
.gamified-card--streak {
  align-items: center;
  text-align: center;
  justify-content: center;
}

.streak-circle {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: linear-gradient(135deg, #fb923c, #ef4444);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(239, 68, 68, 0.4);
  margin-bottom: 1rem;
  position: relative;
}

.streak-icon {
  width: 22px;
  height: 22px;
  color: #fff;
  margin-bottom: 0.1rem;
}

.streak-count {
  font-size: 1.2rem;
  font-weight: 800;
  color: #fff;
  line-height: 1;
}

.streak-title {
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 0.2rem;
}

.streak-sub {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.6);
}

/* ── 3. Progress ── */
.gamified-card--progress {
  align-items: center;
  text-align: center;
  justify-content: center;
}

.progress-title {
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 1rem;
}

.progress-ring-container {
  position: relative;
  width: 100px;
  height: 100px;
  margin-bottom: 1rem;
}

.progress-ring {
  transform: rotate(-90deg);
}

.progress-ring__bg {
  stroke: rgba(255, 255, 255, 0.1);
}

.progress-ring__circle {
  stroke: #4ade80;
  stroke-linecap: round;
  transition: stroke-dashoffset 1s ease-in-out;
  filter: drop-shadow(0 0 6px rgba(74, 222, 128, 0.5));
}

.progress-ring__label {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  font-weight: 800;
  color: #fff;
}

.progress-sub {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.6);
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ================================================================
   BOTTOM ROW
   ================================================================ */
.bottom-row {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 1.25rem;
  flex: 1;
}

/* ================================================================
   CARD BASE
   ================================================================ */
.card {
  background: #fff;
  border-radius: 16px;
  padding: 1.4rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  animation: fadeUp 0.5s 0.25s ease both;
}

.card__header {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.card__header-icon {
  width: 18px;
  height: 18px;
  color: #475569;
  flex-shrink: 0;
}

.card__title {
  font-size: 0.875rem;
  font-weight: 600;
  color: #334155;
}

/* ================================================================
   CALENDAR
   ================================================================ */
.calendar {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.calendar__nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.calendar__nav-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  color: #64748b;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.18s ease, color 0.18s ease;
}

.calendar__nav-btn:hover {
  background: rgba(59, 130, 246, 0.08);
  color: #3b82f6;
}

.calendar__month-label {
  font-size: 1.35rem;
  font-weight: 800;
  color: #1e293b;
  letter-spacing: -0.02em;
}

/* Grid: 7 columns (SUN MON TUE WED THU FRI SAT) */
.calendar__grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px 0;
  text-align: center;
}

.calendar__weekday {
  font-size: 0.68rem;
  font-weight: 600;
  color: #94a3b8;
  letter-spacing: 0.06em;
  padding-bottom: 0.5rem;
}

.calendar__day {
  position: relative;
  padding: 0.5rem 0;
  font-size: 0.875rem;
  font-weight: 500;
  color: #334155;
  border-radius: 8px;
  cursor: default;
  transition: background 0.15s ease;
  user-select: none;
}

.calendar__day:not(.calendar__day--empty):hover {
  background: rgba(59, 130, 246, 0.08);
  cursor: pointer;
}

.calendar__day--empty {
  color: #c7d2db;
}

.calendar__day--today {
  background: #1e3a5f;
  color: #fff !important;
  font-weight: 700;
  border-radius: 10px;
}

.calendar__day--event::after {
  content: '';
  position: absolute;
  bottom: 4px;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #3b82f6;
}

/* ================================================================
   NEWS CARD
   ================================================================ */
.news-card {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.07);
  animation-delay: 0.32s;
}

.news-card .card__title {
  color: rgba(255, 255, 255, 0.85);
}

.news-card .card__header-icon {
  color: rgba(255, 255, 255, 0.5);
}

.news-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  overflow-y: auto;
  max-height: 360px;
  padding-right: 2px;
}

/* Scrollbar */
.news-list::-webkit-scrollbar {
  width: 4px;
}

.news-list::-webkit-scrollbar-track {
  background: transparent;
}

.news-list::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 4px;
}

.news-item {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 0.75rem;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  transition: background 0.18s ease, transform 0.18s ease;
}

.news-item:hover {
  background: rgba(255, 255, 255, 0.07);
  transform: translateX(2px);
}

.news-item__thumb {
  width: 58px;
  height: 50px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.news-item__body {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  flex: 1;
}

.news-item__text {
  font-size: 0.8rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.82);
  line-height: 1.4;
}

.btn-confira {
  align-self: flex-start;
  padding: 0.28rem 0.85rem;
  background: #2563eb;
  color: #fff;
  font-family: inherit;
  font-size: 0.72rem;
  font-weight: 600;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.15s ease;
}

.btn-confira:hover {
  background: #1d4ed8;
  transform: translateY(-1px);
}

/* ================================================================
   WHATSAPP FAB (reused from login)
   ================================================================ */
.fab-whatsapp {
  position: fixed;
  bottom: 1.75rem;
  right: 1.75rem;
  width: 54px;
  height: 54px;
  background: #25d366;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 18px rgba(37, 211, 102, 0.55);
  text-decoration: none;
  z-index: 200;
  transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.25s ease;
  animation: fabBounce 0.6s 0.8s ease both;
}

@keyframes fabBounce {
  from {
    opacity: 0;
    transform: scale(0.5);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

.fab-whatsapp:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 24px rgba(37, 211, 102, 0.75);
}

.fab-whatsapp::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid rgba(37, 211, 102, 0.6);
  animation: fabPulse 2s ease-out infinite;
}

@keyframes fabPulse {
  0% {
    transform: scale(1);
    opacity: 0.7;
  }

  100% {
    transform: scale(1.8);
    opacity: 0;
  }
}

/* ================================================================
   RESPONSIVE
   ================================================================ */
@media (max-width: 1024px) {
  .bottom-row {
    grid-template-columns: 1fr;
  }

  .news-list {
    max-height: 280px;
  }
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.4);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .sidebar-overlay.visible {
    display: block;
    animation: overlayIn 0.25s ease both;
  }

  @keyframes overlayIn {
    from {
      opacity: 0;
    }

    to {
      opacity: 1;
    }
  }

  .layout {
    margin-left: 0;
  }

  .topbar__hamburger {
    display: flex;
  }

  .stats-row {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 480px) {
  .stats-row {
    grid-template-columns: 1fr;
  }

  .topbar {
    padding: 0 1rem;
  }

  .topbar__username {
    display: none;
  }
}