/* ==========================
  Dialética EAD - UI System
  ==========================
  Arquivo: style.css
  Função: Estilos globais da interface do sistema Dialética EAD.
*/

/* ==========================
   THEME / VARIABLES
========================== */
:root{
  --bg: #070a10;
  --bg2:#0b0f16;
  --panel:#0f172a;
  --card: rgba(255,255,255,.04);
  --border: rgba(255,255,255,.10);
  --text:#e5e7eb;
  --muted:#9aa4b2;

  --red:#b10a0a;
  --red2:#d11a1a;
  --gold:#f4c018;
  --gold2:#ffd34a;

  --shadow: 0 18px 45px rgba(0,0,0,.35);
  --ring: 0 0 0 3px rgba(244,192,24,.22);
  --radius: 18px;
}

*{box-sizing:border-box}
html,body{height:100%}

body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial;
  color:var(--text);
  background:
    radial-gradient(900px 450px at 15% -10%, rgba(244,192,24,.14), transparent 60%),
    radial-gradient(900px 520px at 90% 10%, rgba(209,26,26,.18), transparent 60%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg2) 60%, var(--bg) 100%);
}

a{color:inherit}

/* ==========================
   LAYOUT
========================== */
.container{
  max-width:1180px;
  margin:0 auto;
  padding:22px 18px 80px;
}

.page{
  display:grid;
  grid-template-columns: 280px 1fr;
  gap:18px;
}

@media (max-width: 980px){
  .page{grid-template-columns:1fr}
}

/* ==========================
   TOPBAR
========================== */
.topbar{
  position:sticky;
  top:0;
  z-index:50;
  background: rgba(8,10,16,.75);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255,255,255,.06);
}

.topbar-inner{
  max-width:1180px;
  margin:0 auto;
  padding:14px 18px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
}

.brand{
  display:flex;
  align-items:center;
  gap:12px;
}

.brand-badge{
  width:40px;height:40px;border-radius:12px;
  background: linear-gradient(135deg, var(--red), #6b0a0a);
  display:grid;place-items:center;
  box-shadow: 0 10px 20px rgba(177,10,10,.25);
  position:relative;
}

.brand-title{line-height:1.1}
.brand-title strong{display:block;font-size:16px;letter-spacing:.3px}
.brand-title span{display:block;font-size:12px;color:var(--muted)}

.userbar{display:flex;align-items:center;gap:12px}

.usermeta{
  display:flex;
  flex-direction:column;
  gap:2px;
  align-items:flex-end;
}
.usermeta .hello{font-size:13px;color:var(--muted)}
.usermeta .name{font-size:14px;font-weight:700}

.avatar{
  width:40px;height:40px;border-radius:14px;
  background: linear-gradient(135deg, rgba(244,192,24,.95), rgba(209,26,26,.75));
  display:grid;place-items:center;
  color:#111827;font-weight:900;
}

/* ==========================
   BUTTONS
========================== */
.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:10px;
  padding:11px 14px;
  border-radius:14px;
  border:1px solid var(--border);
  background: rgba(255,255,255,.05);
  color:var(--text);
  text-decoration:none;
  transition:.2s;
  cursor:pointer;
}

.btn:hover{
  transform:translateY(-1px);
  box-shadow:var(--ring);
  border-color: rgba(244,192,24,.35);
}

.btn.primary{
  background: linear-gradient(135deg, var(--red2), #7a0f0f);
  border-color: rgba(255,255,255,.14);
}
.btn.primary:hover{
  box-shadow: 0 0 0 3px rgba(209,26,26,.20), 0 16px 40px rgba(177,10,10,.25)
}

.btn.gold{
  background: linear-gradient(135deg, var(--gold2), var(--gold));
  color:#111827;
  border-color: rgba(244,192,24,.35);
}
.btn.gold:hover{
  box-shadow: 0 0 0 3px rgba(244,192,24,.22), 0 16px 40px rgba(244,192,24,.16)
}

.btn.ghost{background: rgba(255,255,255,.04)}

.btn.danger{
  background: rgba(209,26,26,.14);
  border-color: rgba(209,26,26,.25);
}
.btn.danger:hover{
  box-shadow: 0 0 0 3px rgba(209,26,26,.15), 0 16px 40px rgba(209,26,26,.15);
}

/* ==========================
   CARDS / GRID
========================== */
.card{
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding:16px;
}

.card h2,.card h3{margin:0 0 6px}
.card p{margin:0;color:var(--muted);line-height:1.35;font-size:13px}

.grid{
  display:grid;
  grid-template-columns: repeat(12, 1fr);
  gap:14px;
}
.col-6{grid-column: span 6;}
.col-12{grid-column: span 12;}

@media (max-width: 980px){
  .grid{grid-template-columns:1fr}
  .col-6,.col-12{grid-column: span 12;}
}

/* ==========================
   SIDEBAR NAV
========================== */
.sidebar{
  height: fit-content;
  padding:16px;
}

.nav-title{
  font-size:12px;
  letter-spacing:.14em;
  color:var(--muted);
  text-transform:uppercase;
  margin:6px 4px 10px;
}

.nav{
  display:flex;
  flex-direction:column;
  gap:10px;
}

.nav a{
  display:flex;
  align-items:center;
  gap:10px;
  padding:12px 12px;
  border-radius:14px;
  text-decoration:none;
  border: 1px solid rgba(255,255,255,.08);
  background: rgba(255,255,255,.03);
  transition:.2s;
}

.nav a:hover{
  transform:translateY(-1px);
  border-color: rgba(244,192,24,.30);
  box-shadow:var(--ring);
}

.pill{
  margin-left:auto;
  font-size:12px;
  padding:6px 10px;
  border-radius:999px;
  background: rgba(244,192,24,.12);
  color: var(--gold2);
  border: 1px solid rgba(244,192,24,.22);
}

/* ==========================
   HERO
========================== */
.hero{
  position:relative;
  overflow:hidden;
  padding:18px;
  background:
    linear-gradient(135deg, rgba(177,10,10,.26), rgba(244,192,24,.14)),
    rgba(255,255,255,.03);
}

.hero::after{
  content:"";
  position:absolute;
  inset:-60px -60px auto auto;
  width:220px;height:220px;border-radius:60px;
  background: radial-gradient(circle at 30% 30%, rgba(244,192,24,.35), transparent 60%);
  transform: rotate(18deg);
}

.hero h1{margin:0 0 6px;font-size:22px}
.hero p{margin:0;color:rgba(255,255,255,.82);max-width:760px}
.hero .row{margin-top:14px;display:flex;gap:10px;flex-wrap:wrap}

/* ==========================
   TABLE
========================== */
.table{
  width:100%;
  border-collapse: collapse;
  overflow:hidden;
  border-radius: var(--radius);
}
.table th,.table td{
  padding:14px;
  text-align:left;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.table th{
  background: rgba(255,255,255,.06);
  color: var(--text);
  font-size:13px;
}
.table tr:hover td{background: rgba(255,255,255,.03);}

/* ==========================
   FORMS
========================== */
.input, input, select, textarea{
  width:100%;
  padding:12px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(0,0,0,.25);
  color: var(--text);
  font-size:14px;
  outline:none;
}

input:focus, select:focus, textarea:focus{
  border-color: rgba(244,192,24,.35);
  box-shadow: var(--ring);
}

label{font-size:13px;color:var(--muted)}

.alert{
  padding:12px 14px;
  border-radius: 14px;
  border:1px solid transparent;
  margin-bottom:14px;
  font-weight:700;
}

.alert.error{
  background: rgba(239,68,68,.15);
  border-color: rgba(239,68,68,.25);
  color: #fecaca;
}
.alert.success{
  background: rgba(34,197,94,.14);
  border-color: rgba(34,197,94,.25);
  color: #bbf7d0;
}

.small{font-size:12px;color:var(--muted)}

/* ==========================
   LOGIN
========================== */
.center{
  min-height: calc(100vh - 72px);
  display:flex;
  align-items:center;
  justify-content:center;
  padding: 40px 18px;
}
.login-box{width: min(420px, 100%);}
.login-box .card{padding:24px}
.login-title{margin:0 0 10px;font-size:20px}

/* ==========================
   PLAYER / ASSISTIR
========================== */
.player-wrap{
  position:relative;
  border-radius: 18px;
  overflow:hidden;
  border:1px solid rgba(255,255,255,.10);
  box-shadow: var(--shadow);
  background: rgba(0,0,0,.35);
}

.player{
  width:100%;
  aspect-ratio: 16/9;
  background:#000;
}

.player iframe{
  width:100%;
  height:100%;
  border:0;
  display:block;
}

.wm{
  position:absolute;
  left:18px;
  top:18px;
  z-index:5;
  pointer-events:none;
  user-select:none;
  padding:8px 10px;
  border-radius:999px;
  font-size:12px;
  font-weight:800;
  letter-spacing:.2px;
  color: rgba(255,255,255,.85);
  background: rgba(0,0,0,.35);
  border: 1px solid rgba(255,255,255,.12);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity:.92;
  text-shadow: 0 2px 10px rgba(0,0,0,.55);
}

.player-actions{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  justify-content:space-between;
  align-items:center;
  margin-top:14px;
}

.player-actions .left,
.player-actions .right{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
}

.note{
  color: var(--muted);
  font-size: 13px;
  line-height:1.35;
}

/* ==========================
   PERFIL
========================== */
.profile-card h1{
  margin: 0;
  font-size: 22px;
  letter-spacing: .2px;
}

.profile-head{
  display:flex;
  align-items:center;
  gap:16px;
}

.avatar.big{
  width: 72px;
  height: 72px;
  font-size: 22px;
}

.profile-meta .small{
  margin-top: 4px;
  opacity: .85;
}

.divider{
  height: 1px;
  background: rgba(255,255,255,.08);
  margin: 18px 0;
}

.section-title{
  font-size: 16px;
  margin: 0 0 12px 0;
  opacity: .95;
}

.form{
  display:flex;
  flex-direction:column;
  gap: 14px;
}

.field label{
  font-size: 13px;
  opacity: .9;
  display:block;
  margin-bottom: 6px;
}

.input-wrap{
  position: relative;
  display:flex;
  align-items:center;
}

.input-wrap input{
  width: 100%;
  padding-right: 78px;
}

.eye{
  position:absolute;
  right: 10px;
  background: transparent;
  border: 1px solid rgba(255,255,255,.14);
  color: var(--text);
  border-radius: 10px;
  padding: 8px 10px;
  cursor:pointer;
  font-size: 12px;
}

.eye:hover{border-color: rgba(255,255,255,.28);}

/* ==========================
   TOAST
========================== */
.toast{
  position: fixed;
  right: 18px;
  top: 18px;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(10,12,18,.92);
  border: 1px solid rgba(255,255,255,.12);
  color: var(--text);
  box-shadow: 0 14px 36px rgba(0,0,0,.35);
  opacity: 0;
  transform: translateY(-10px);
  transition: .25s;
  z-index: 2000;
  max-width: 320px;
}

.toast.show{
  opacity: 1;
  transform: translateY(0);
}

.toast.success{border-color: rgba(34,197,94,.35)}
.toast.error{border-color: rgba(239,68,68,.35)}

/* ==========================
   MOBILE NAV (BOTTOM)
========================== */
.mobile-nav{
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background: rgba(8,10,16,.95);
  border-top: 1px solid rgba(255,255,255,.08);
  justify-content: space-around;
  padding: 10px 0;
  z-index: 999;
}

.mobile-nav a{
  color: var(--text);
  text-decoration: none;
  font-size: 12px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.mobile-nav a span{font-size: 18px;}
.mobile-nav a.active{color: var(--gold2);}

/* FAB */
.fab{
  position:fixed;
  bottom:25px;
  right:25px;
  border-radius: 999px;
  padding:14px 18px;
  box-shadow: 0 10px 25px rgba(0,0,0,.35);
  text-decoration:none;
}

/* ==========================
   CURSO (Matérias e Aulas)
========================== */
.section-head{
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap:12px;
  margin-bottom:14px;
}

.section-head h1{
  margin:0;
  font-size:22px;
  letter-spacing:.2px;
}

.section-head p{
  margin:6px 0 0;
  color:var(--muted);
  font-size:13px;
  line-height:1.35;
}

.kpis{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  justify-content:flex-end;
}

.kpi{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:10px 12px;
  border-radius:14px;
  border:1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.04);
  color: var(--text);
  font-weight:800;
  font-size:12px;
}
.kpi span{
  color:var(--muted);
  font-weight:700;
}

/* Grid das matérias */
.materias-grid{
  display:grid;
  grid-template-columns: repeat(12, 1fr);
  gap:14px;
}

.materia-card{
  grid-column: span 4;
  background: rgba(255,255,255,.04);
  border:1px solid rgba(255,255,255,.10);
  border-radius: 18px;
  padding:16px;
  box-shadow: var(--shadow);
  position:relative;
  overflow:hidden;
  transition:.2s;
}

.materia-card::after{
  content:"";
  position:absolute;
  inset:auto -80px -80px auto;
  width:240px;height:240px;
  border-radius:80px;
  background: radial-gradient(circle at 30% 30%, rgba(244,192,24,.18), transparent 60%);
  transform: rotate(18deg);
  pointer-events:none;
}

.materia-card:hover{
  transform: translateY(-3px);
  border-color: rgba(244,192,24,.30);
  box-shadow: 0 0 0 3px rgba(244,192,24,.10), var(--shadow);
}

.materia-top{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:10px;
  margin-bottom:8px;
}

.materia-title{
  margin:0;
  font-size:18px;
  letter-spacing:.2px;
}

.badge-aulas{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:6px 10px;
  border-radius:999px;
  background: rgba(244,192,24,.12);
  color: var(--gold2);
  border: 1px solid rgba(244,192,24,.22);
  font-size:12px;
  font-weight:800;
  white-space:nowrap;
}

.materia-desc{
  margin:0;
  color:var(--muted);
  font-size:13px;
  line-height:1.35;
  min-height: 34px;
}

.materia-actions{
  margin-top:14px;
  display:flex;
  gap:10px;
  flex-wrap:wrap;
}

.btn-entrar{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:11px 14px;
  border-radius:14px;
  text-decoration:none;
  font-weight:900;
  border:1px solid rgba(244,192,24,.35);
  background: linear-gradient(135deg, var(--gold2), var(--gold));
  color:#111827;
  transition:.2s;
  width: 100%;
}

.btn-entrar:hover{
  transform: translateY(-1px);
  box-shadow: 0 0 0 3px rgba(244,192,24,.20);
}

/* Grid das aulas */
.aulas-grid{
  display:grid;
  grid-template-columns: repeat(12, 1fr);
  gap:14px;
}

.aula-card{
  grid-column: span 6;
  background: rgba(255,255,255,.04);
  border:1px solid rgba(255,255,255,.10);
  border-radius: 18px;
  padding:16px;
  box-shadow: var(--shadow);
  transition:.2s;
  position:relative;
  overflow:hidden;
}

.aula-card:hover{
  transform: translateY(-3px);
  border-color: rgba(244,192,24,.25);
  box-shadow: 0 0 0 3px rgba(244,192,24,.08), var(--shadow);
}

.aula-card h4{
  margin:0 0 6px;
  font-size:16px;
}

.aula-card p{
  margin:0;
  color:var(--muted);
  font-size:13px;
  line-height:1.35;
  min-height: 34px;
}

.aula-actions{
  margin-top:12px;
  display:flex;
  gap:10px;
  flex-wrap:wrap;
}

.btn-assistir{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:10px 14px;
  border-radius:14px;
  border:1px solid rgba(244,192,24,.35);
  background: linear-gradient(135deg, var(--gold2), var(--gold));
  color:#111827;
  font-weight:900;
  text-decoration:none;
  transition:.2s;
}

.btn-assistir:hover{
  transform: translateY(-1px);
  box-shadow: 0 0 0 3px rgba(244,192,24,.18);
}

/* ==========================
   RESPONSIVO (GERAL)
========================== */
@media (max-width: 980px){
  .materia-card{grid-column: span 6;}
  .aula-card{grid-column: span 12;}
}

@media (max-width: 640px){
  .materia-card{grid-column: span 12;}
  .section-head{flex-direction:column; align-items:flex-start;}
  .kpis{justify-content:flex-start;}
}

/* ==========================
   MOBILE (768px)
   - mantém interface fluida
========================== */
@media (max-width: 768px){

  body{font-size: 15px;}
  body{padding-bottom: 80px;}

  /* sidebar some e bottom nav aparece */
  .sidebar{display:none;}
  .mobile-nav{display:flex;}

  /* cards e grids */
  .grid{grid-template-columns:1fr !important;}
  .card{padding:14px; border-radius:16px;}

  /* BOTÕES DO CONTEÚDO (cards, hero, etc) continuam largos */
  main .btn{
    width:100%;
    justify-content:center;
    padding:14px;
    font-size:15px;
  }

  /* player */
  .player-wrap{border-radius:14px;}
  .player-actions{flex-direction:column; gap:10px;}

  /* FAB */
  .fab{
    bottom:15px;
    right:15px;
    padding:14px 16px;
  }

  /* Perfil ajustes */
  .profile-head{align-items:flex-start;}
  .avatar.big{
    width: 58px;
    height: 58px;
    font-size: 18px;
  }
}

/* ==========================
   FIX TOPBAR MOBILE (IMPORTANTE)
   - topbar fica em LINHA no mobile
   - botões do header NÃO ficam 100%
========================== */
@media (max-width: 768px){

  .topbar{
    padding: 0; /* não duplicar padding */
  }

  .topbar-inner{
    display:flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 12px !important;
  }

  .brand{
    display:flex !important;
    align-items:center !important;
    gap: 10px !important;
    min-width: 0;
  }

  .brand-title{
    min-width:0;
  }

  .brand-title strong{
    font-size: 14px !important;
  }

  .brand-title span{
    font-size: 11px !important;
  }

  .userbar{
    display:flex !important;
    align-items:center !important;
    gap: 10px !important;
    flex-shrink:0;
  }

  /* Se quiser esconder nome no mobile (mais limpo) */
  .usermeta{
    display:none !important;
  }

  .avatar{
    width: 32px !important;
    height: 32px !important;
    font-size: 13px !important;
  }

  /* BOTÕES DO HEADER ficam compactos */
  .topbar .btn{
    width:auto !important;
    padding: 8px 12px !important;
    font-size: 13px !important;
  }
}