/* --- ESTILOS GERAIS DO SISTEMA --- */
:root {
  --bg-body: #f8fafc;
  --surface: #ffffff;
  --surface-subtle: #f1f5f9;
  --border-color: #e2e8f0;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-light: #94a3b8;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --sidebar-bg: #0f172a;
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.02);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
  --shadow-lg: 0 12px 20px -3px rgba(37, 99, 235, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.04);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

body {
  background-color: var(--bg-body);
  color: var(--text-main);
  display: flex;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* --- TELA DE AUTENTICAÇÃO --- */
.auth-wrapper {
  position: fixed;
  inset: 0;
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  padding: 1.5rem;
  overflow-y: auto;
}
/*BOTÕES PÁGINA INICIAL LANDING PAGE*/
.btn1:hover{
background: #1d4ed8; /* Um azul um pouco mais escuro */
  transform: translateY(-3px);
  
}
.btn1-1:hover{
  background: #1d4ed8; /* Um azul um pouco mais escuro */
  transform: translateY(-3px);
 
}
.btn2:hover{
  background: #1d4ed8; /* Um azul um pouco mais escuro */
  transform: translateY(-3px);
  box-shadow: 0 12px 30px rgba(140, 145, 155, 0.6);
}
@media (max-width: 900px) {
  .auth-wrapper {
    align-items: flex-start;
    padding: 1rem;
  }
  
  .auth-wrapper > div,
  .auth-card-wrapper {
    flex-direction: column !important;
    width: 100% !important;
    max-width: 480px !important;
  }

  .auth-left-panel {
    display: flex !important;
    padding: 1.75rem !important;
  }
  
  .auth-card {
    width: 100% !important;
    max-width: 100% !important;
  }

  .auth-right-panel {
    padding: 1.75rem !important;
  }
}

/* --- SIDEBAR & LOGO --- */
.app-sidebar {
  width: 260px;
  background-color: var(--sidebar-bg);
  color: #fff;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 1.75rem 1.25rem;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 100;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.close-sidebar-btn {
  display: none;
  position: absolute;
  top: 16px;
  right: 16px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-sm);
  width: 32px;
  height: 32px;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  color: #94a3b8;
  cursor: pointer;
  z-index: 10;
  transition: all 0.2s;
}

.close-sidebar-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

@media (max-width: 768px) {
  .app-sidebar.mobile-open .close-sidebar-btn {
    display: flex !important;
  }
}

.sidebar-header {
  padding: 0.5rem 0 1.25rem 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sidebar-logo {
  max-width: 140px;
  height: auto;
  object-fit: contain;
}

.nav-group {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  overflow-y: auto;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.85rem 1rem;
  color: #94a3b8;
  text-decoration: none;
  font-weight: 500;
  font-size: 0.925rem;
  border-radius: var(--radius-md);
  transition: all 0.2s ease;
  cursor: pointer;
  background: transparent;
  border: none;
  width: 100%;
  text-align: left;
}

.nav-item:hover {
  background-color: rgba(255, 255, 255, 0.05);
  color: #f1f5f9;
}

.nav-item.active {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.2) 0%, rgba(37, 99, 235, 0.1) 100%);
  color: #60a5fa;
  border-left: 3px solid #3b82f6;
  font-weight: 600;
}

.user-footer {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding-top: 1.25rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.user-avatar {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-hover) 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.95rem;
  color: white;
  flex-shrink: 0;
  box-shadow: 0 2px 5px rgba(37, 99, 235, 0.3);
}

/* --- CONTAINER PRINCIPAL --- */
.app-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  margin-left: 260px;
  min-height: 100vh;
  width: calc(100% - 260px);
  transition: margin 0.3s ease-in-out, width 0.3s ease-in-out;
}

.app-header {
  height: 76px;
  background-color: var(--surface);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2.5rem;
  position: sticky;
  top: 0;
  z-index: 90;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
}

.header-left-group {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.mobile-menu-toggle {
  display: none;
  background: var(--surface-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  cursor: pointer;
  color: var(--text-main);
  transition: background 0.2s;
}

.mobile-menu-toggle:hover {
  background: #e2e8f0;
}

.page-title {
  font-size: 1.35rem;
  font-weight: 750;
  letter-spacing: -0.3px;
}

.app-content {
  flex: 1;
  padding: 2.5rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.app-footer {
  padding: 1.25rem 2.5rem;
  background-color: var(--surface);
  border-top: 1px solid var(--border-color);
  font-size: 0.825rem;
  color: var(--text-muted);
  text-align: center;
  margin-top: auto;
}

/* --- BANNER DE BOAS-VINDAS --- */
.welcome-banner {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  border-radius: var(--radius-xl);
  padding: 2.5rem 3rem;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 15px 30px -5px rgba(15, 23, 42, 0.2);
  position: relative;
  overflow: hidden;
  gap: 2rem;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.welcome-banner::before {
  content: '';
  position: absolute;
  top: -50px;
  right: -50px;
  width: 250px;
  height: 250px;
  background: rgba(59, 130, 246, 0.15);
  border-radius: 50%;
  filter: blur(50px);
  pointer-events: none;
}

.welcome-text {
  flex: 1;
  z-index: 2;
}

.badge-app {
  display: inline-block;
  background-color: rgba(37, 99, 235, 0.25);
  color: #60a5fa;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 0.4rem 0.85rem;
  border-radius: 30px;
  margin-bottom: 1.25rem;
  letter-spacing: 0.75px;
  border: 1px solid rgba(96, 165, 250, 0.35);
}

.welcome-text h1 {
  font-size: 2.1rem;
  font-weight: 800;
  margin-bottom: 0.85rem;
  line-height: 1.15;
  letter-spacing: -0.5px;
}

.welcome-text h1 span {
  color: #60a5fa;
}

.motivational-quote {
  font-size: 1rem;
  color: #94a3b8;
  max-width: 540px;
  line-height: 1.6;
}

.welcome-logo-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  flex-shrink: 0;
}

.banner-logo-img {
  width: 130px;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 12px 20px rgba(0, 0, 0, 0.35));
}

/* --- GRIDS DE ESTATÍSTICAS --- */
.dashboard-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
}

.stat-card {
  background-color: var(--surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stat-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: #cbd5e1;
}

.stat-icon {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  color: white;
  flex-shrink: 0;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
}

.stat-icon.bg-blue { background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%); }
.stat-icon.bg-green { background: linear-gradient(135deg, #22c55e 0%, #15803d 100%); }
.stat-icon.bg-purple { background: linear-gradient(135deg, #a855f7 0%, #7e22ce 100%); }

.stat-info h3 {
  font-size: 0.775rem;
  color: var(--text-muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.35rem;
}

.stat-value {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.5px;
}

/* --- GRIDS & CARDS MODERNIZADOS (DISCIPLINAS E ANOTAÇÕES) --- */
.grid-system {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
  align-items: stretch;
  margin-top: 1rem;
}

#disciplinas-lista {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
  margin-top: 1.5rem;
}

.discipline-card-modern {
  background: var(--surface, #ffffff);
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 12px;
  padding: 1.25rem;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: all 0.2s ease-in-out;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}

.discipline-card-modern:hover {
  transform: translateY(-3px);
  border-color: var(--accent, #3b82f6);
  box-shadow: 0 10px 25px -5px rgba(59, 130, 246, 0.1), 0 8px 10px -6px rgba(59, 130, 246, 0.1);
}

.discipline-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1rem;
}

.discipline-icon-badge {
  width: 42px;
  height: 42px;
  background: var(--surface-subtle, #f1f5f9);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
}

.discipline-actions {
  display: flex;
  gap: 0.35rem;
  opacity: 0.8;
  transition: opacity 0.2s;
}

.discipline-card-modern:hover .discipline-actions {
  opacity: 1;
}

.btn-action-subtle {
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.85rem;
  transition: background 0.15s, border-color 0.15s;
}

.btn-action-subtle:hover {
  background: var(--surface-subtle, #f1f5f9);
  border-color: var(--border-color, #cbd5e1);
}

.btn-action-subtle.danger:hover {
  background: #fee2e2;
  border-color: #fca5a5;
}

.discipline-card-body {
  margin-bottom: 1.25rem;
}

.discipline-card-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main, #0f172a);
  margin: 0 0 0.35rem 0;
  letter-spacing: -0.01em;
}

.discipline-card-teacher {
  font-size: 0.85rem;
  color: var(--text-muted, #64748b);
  margin: 0;
}

.discipline-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--border-color, #f1f5f9);
  padding-top: 0.75rem;
  font-size: 0.8rem;
}

.discipline-notes-count {
  color: var(--text-muted, #64748b);
  font-weight: 500;
}

.discipline-arrow {
  color: var(--accent, #3b82f6);
  font-weight: 650;
  transition: transform 0.15s;
}

.discipline-card-modern:hover .discipline-arrow {
  transform: translateX(3px);
}

.card-add-trigger-modern {
  border: 2px dashed var(--border-color, #cbd5e1);
  border-radius: 12px;
  min-height: 175px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  cursor: pointer;
  background: transparent;
  transition: all 0.2s ease-in-out;
}

.card-add-trigger-modern:hover {
  border-color: var(--accent, #3b82f6);
  background: rgba(59, 130, 246, 0.02);
}

.add-icon-circle {
  width: 36px;
  height: 36px;
  background: var(--surface-subtle, #f1f5f9);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  color: var(--accent, #3b82f6);
  font-weight: 600;
  transition: background 0.2s, color 0.2s;
}

.card-add-trigger-modern:hover .add-icon-circle {
  background: var(--accent, #3b82f6);
  color: #ffffff;
}

.add-text {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted, #64748b);
}

.anotacao-card {
  background: var(--surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 1.5rem 1.75rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: var(--shadow-sm);
  min-height: 180px;
}

.anotacao-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
  border-color: #cbd5e1;
}

.anotacao-content-preview {
  font-size: 0.925rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 1.25rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* --- BOTÕES & FORMULÁRIOS --- */
.btn {
  padding: 0.7rem 1.4rem;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.btn-accent {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-hover) 100%);
  color: #fff;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.btn-accent:hover {
  background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.4);
  transform: translateY(-1px);
}

.btn-outline {
  background-color: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-main);
  box-shadow: none;
}

.btn-outline:hover {
  background-color: var(--surface-subtle);
  border-color: #cbd5e1;
}

.field-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.field-group label {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.2px;
}

.field-group input, 
.field-group textarea, 
.field-group select {
  padding: 0.75rem 1rem;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: 0.925rem;
  outline: none;
  background: var(--surface);
  color: var(--text-main);
  width: 100%;
  transition: all 0.2s ease;
}

.field-group input:focus, 
.field-group textarea:focus, 
.field-group select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

/* --- MODAIS --- */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1.25rem;
  animation: fadeIn 0.2s ease forwards;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-box {
  background: var(--surface);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 520px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  overflow: hidden;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid var(--border-color);
  animation: scaleUp 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes scaleUp {
  from { transform: scale(0.95); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.modal-box.modal-fullscreen {
  max-width: 100vw !important;
  width: 100vw !important;
  height: 100vh !important;
  max-height: 100vh !important;
  border-radius: 0 !important;
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  inset: 0 !important;
}

.modal-box.modal-fullscreen .modal-body-content {
  max-height: calc(100vh - 150px) !important;
  flex: 1;
}

.icon-selector-btn {
  background: var(--surface-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: 1.35rem;
  padding: 0.5rem;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.icon-selector-btn:hover {
  transform: scale(1.1);
  background: #e2e8f0;
  border-color: #cbd5e1;
}

/* --- CALENDÁRIO --- */
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  width: 100%;
  max-width: 100%;
}

.calendar-day-cell {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  border-radius: var(--radius-sm);
  transition: background 0.2s;
}

.calendar-day-cell:hover {
  background-color: var(--surface-subtle);
}

/* --- RESPONSIVIDADE (MOBILE & TABLET) --- */
@media (max-width: 1024px) {
  /* Ajuste geral para telas intermediárias (tablets) */
  .page-content {
    grid-template-columns: 1fr;
    padding: 1.5rem;
  }
}

@media (max-width: 768px) {
  .app-sidebar {
    transform: translateX(-100%);
  }

  .app-sidebar.mobile-open {
    transform: translateX(0);
  }

  .app-container {
    margin-left: 0;
    width: 100%;
  }

  .mobile-menu-toggle {
    display: flex;
  }

  .app-header {
    padding: 0 1.25rem;
    height: 70px;
  }

  .app-content {
    padding: 1.25rem;
    gap: 1.25rem;
  }

  .calendar-grid-wrapper {
    grid-template-columns: 1fr !important;
  }

  .welcome-banner {
    flex-direction: column-reverse;
    text-align: center;
    padding: 2rem 1.25rem;
  }
  
  .welcome-text h1 {
    font-size: 1.6rem;
  }

  .motivational-quote {
    margin-left: auto;
    margin-right: auto;
  }

  .calendar-container, 
  .calendar-grid, 
  #calendarioGrid {
    width: 100% !important;
    box-sizing: border-box;
    padding: 2px !important;
  }

  .calendar-grid, 
  #calendarioGrid {
    display: grid !important;
    grid-template-columns: repeat(7, minmax(0, 1fr)) !important;
    gap: 3px !important;
  }

  .calendar-day-cell, 
  #calendarioGrid > div {
    min-height: 70px !important;
    padding: 3px !important;
    font-size: 0.75rem !important;
    overflow: visible !important;
  }

  .calendar-event-item {
    font-size: 0.65rem !important;
    padding: 2px 4px !important;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    border-radius: 4px;
  }
}
/* Layout Geral da Tela de Comunidade */
#comunidade-view {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  padding: 2rem;
  width: 100%;
  box-sizing: border-box;
}

/* Grid principal: Esquerda (Apresentação + Posts), Direita (Ranking + Dica) */
.comunidade-layout-grid {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 2rem;
  align-items: start;
  width: 100%;
}

@media (max-width: 1024px) {
  .comunidade-layout-grid {
    grid-template-columns: 1fr;
  }
}