/* ============================================================
   Kegel Training App — Custom Stylesheet
   ============================================================ */

/* ---- Variables ------------------------------------------- */
:root {
  --bg-primary:    #0a0e1a;
  --bg-secondary:  #111827;
  --bg-card:       #1a2035;
  --bg-card-hover: #1e2640;
  --border-color:  #2d3748;

  --text-primary:   #e2e8f0;
  --text-secondary: #94a3b8;
  --text-muted:     #64748b;

  --color-primary:   #4f46e5;
  --color-primary-h: #6366f1;
  --color-cyan:      #06b6d4;
  --color-success:   #10b981;
  --color-warning:   #f59e0b;
  --color-danger:    #ef4444;
  --color-orange:    #f97316;

  --gradient-primary:   linear-gradient(135deg, #4f46e5, #06b6d4);
  --gradient-energy:    linear-gradient(180deg, #ef4444 0%, #f97316 40%, #f59e0b 70%, #10b981 100%);
  --gradient-hero:      linear-gradient(135deg, #0f0c29 0%, #302b63 50%, #24243e 100%);

  --radius-card: 16px;
  --shadow-card: 0 4px 24px rgba(0,0,0,.4);
  --transition:  all .25s ease;
}

/* ---- Base ------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Poppins', system-ui, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.6;
}

a { color: var(--color-cyan); text-decoration: none; transition: var(--transition); }
a:hover { color: #67e8f9; }

h1,h2,h3,h4,h5,h6 { font-weight: 700; color: var(--text-primary); }

.text-cyan    { color: var(--color-cyan) !important; }
.text-primary-gradient {
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.smaller { font-size: .75rem; }

/* ---- Navbar ---------------------------------------------- */
.kegel-navbar {
  background: rgba(10, 14, 26, .95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  padding: .75rem 0;
}
.kegel-navbar .navbar-brand { font-size: 1.25rem; letter-spacing: -.5px; }
.kegel-navbar .nav-link { font-size: .9rem; font-weight: 500; color: var(--text-secondary) !important; padding: .4rem .8rem !important; border-radius: 8px; }
.kegel-navbar .nav-link:hover { color: var(--text-primary) !important; background: rgba(255,255,255,.06); }
.kegel-navbar .nav-link.active { color: var(--color-cyan) !important; }

/* ---- Cards ----------------------------------------------- */
.kegel-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-card);
  padding: 1.5rem;
  box-shadow: var(--shadow-card);
  transition: var(--transition);
}
.kegel-card:hover { background: var(--bg-card-hover); transform: translateY(-2px); }

/* ---- Buttons --------------------------------------------- */
.btn-primary {
  background: var(--gradient-primary);
  border: none;
  font-weight: 600;
  border-radius: 10px;
  padding: .55rem 1.4rem;
  transition: var(--transition);
}
.btn-primary:hover { opacity: .9; transform: translateY(-1px); box-shadow: 0 6px 20px rgba(79,70,229,.4); }

.btn-cyan {
  background: var(--color-cyan);
  border: none;
  color: #0a0e1a;
  font-weight: 700;
  border-radius: 10px;
  padding: .55rem 1.4rem;
  transition: var(--transition);
}
.btn-cyan:hover { background: #22d3ee; color: #0a0e1a; transform: translateY(-1px); }

.btn-outline-cyan {
  border: 2px solid var(--color-cyan);
  color: var(--color-cyan);
  background: transparent;
  border-radius: 10px;
  font-weight: 600;
  padding: .5rem 1.3rem;
  transition: var(--transition);
}
.btn-outline-cyan:hover { background: var(--color-cyan); color: #0a0e1a; }

/* ---- Forms ----------------------------------------------- */
.form-control, .form-select {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  border-radius: 10px;
  padding: .65rem 1rem;
  transition: var(--transition);
}
.form-control:focus, .form-select:focus {
  background: var(--bg-card);
  border-color: var(--color-primary);
  color: var(--text-primary);
  box-shadow: 0 0 0 3px rgba(79,70,229,.2);
}
.form-control::placeholder { color: var(--text-muted); }
.form-label { font-weight: 500; color: var(--text-secondary); font-size: .9rem; }

/* ---- Badges ---------------------------------------------- */
.badge-semana {
  font-size: .7rem;
  font-weight: 600;
  padding: .3rem .7rem;
  border-radius: 20px;
  background: rgba(79,70,229,.2);
  color: #a5b4fc;
  border: 1px solid rgba(99,102,241,.3);
}

/* ---- Progress bar ---------------------------------------- */
.progress {
  background: var(--bg-secondary);
  border-radius: 100px;
  height: 8px;
}
.progress-bar {
  background: var(--gradient-primary);
  border-radius: 100px;
}

/* ---- Hero ------------------------------------------------- */
.hero-section {
  background: var(--gradient-hero);
  min-height: 100vh;
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
}
.hero-section::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 60% 50%, rgba(79,70,229,.15) 0%, transparent 70%);
}
.hero-badge {
  display: inline-block;
  background: rgba(6,182,212,.15);
  border: 1px solid rgba(6,182,212,.3);
  color: var(--color-cyan);
  border-radius: 20px;
  padding: .35rem 1rem;
  font-size: .85rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
}
.hero-title { font-size: clamp(2.2rem, 5vw, 3.8rem); line-height: 1.1; }
.hero-subtitle { font-size: 1.15rem; color: var(--text-secondary); max-width: 520px; }

/* Benefit cards */
.benefit-card {
  background: rgba(255,255,255,.04);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-card);
  padding: 2rem 1.5rem;
  transition: var(--transition);
  text-align: center;
}
.benefit-card:hover { background: rgba(255,255,255,.07); transform: translateY(-4px); }
.benefit-icon {
  width: 60px; height: 60px;
  border-radius: 16px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem;
  margin: 0 auto 1rem;
  background: var(--gradient-primary);
}

/* Week cards */
.week-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-card);
  overflow: hidden;
  transition: var(--transition);
}
.week-card:hover { transform: translateY(-3px); box-shadow: 0 8px 30px rgba(0,0,0,.5); }
.week-card-header {
  padding: 1.5rem;
  position: relative;
}
.week-card-body { padding: 1.25rem 1.5rem 1.5rem; }
.week-number {
  font-size: 3.5rem;
  font-weight: 800;
  opacity: .15;
  position: absolute;
  top: 0.5rem;
  right: 1rem;
  line-height: 1;
}

/* ---- Timer (sessao.php) ---------------------------------- */
.sessao-page { background: var(--bg-primary); min-height: 100vh; }

.timer-wrapper {
  position: relative;
  width: 260px;
  height: 260px;
  margin: 0 auto;
}
.timer-svg {
  width: 260px;
  height: 260px;
  transform: rotate(-90deg);
}
.timer-track    { fill: none; stroke: #1e2640; stroke-width: 14; }
.timer-progress { fill: none; stroke-width: 14; stroke-linecap: round; transition: stroke .3s; }
.timer-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}
.timer-seconds { font-size: 4rem; font-weight: 800; line-height: 1; }
.timer-phase-label { font-size: .85rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; }

/* Power bar */
.power-bar-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .5rem;
}
.power-bar-track {
  width: 52px;
  height: 220px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 30px;
  overflow: hidden;
  position: relative;
}
.power-bar-fill {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  border-radius: 30px;
  transition: height .15s linear, background-color .3s;
  background: #10b981;
}
.power-bar-label { font-size: .75rem; font-weight: 600; color: var(--text-secondary); }
.power-pct { font-size: 1.1rem; font-weight: 700; }

/* Pulse animation during contraction */
@keyframes pulse-contract {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: .85; transform: scale(1.04); }
}
.contracting .timer-wrapper { animation: pulse-contract 1s ease-in-out infinite; }

/* Phase colors */
.phase-preparar  .timer-progress { stroke: #f59e0b; }
.phase-contracao .timer-progress { stroke: #ef4444; }
.phase-relaxamento .timer-progress { stroke: #06b6d4; }
.phase-completo  .timer-progress { stroke: #10b981; }

.phase-preparar  .timer-seconds { color: #f59e0b; }
.phase-contracao .timer-seconds { color: #ef4444; }
.phase-relaxamento .timer-seconds { color: #06b6d4; }
.phase-completo  .timer-seconds { color: #10b981; }

/* Intensity levels for power bar */
.intensity-baixo   { background: linear-gradient(180deg, #10b981, #34d399); }
.intensity-medio   { background: linear-gradient(180deg, #f59e0b, #fcd34d); }
.intensity-alto    { background: linear-gradient(180deg, #f97316, #fb923c); }
.intensity-maximo  { background: linear-gradient(180deg, #ef4444, #f87171); }

/* Elevator levels */
.elevator-bar {
  display: flex;
  gap: 6px;
  align-items: flex-end;
  height: 80px;
}
.elevator-level {
  width: 18px;
  border-radius: 4px 4px 0 0;
  transition: opacity .3s, filter .3s;
  opacity: .3;
}
.elevator-level.active { opacity: 1; filter: brightness(1.3); }

/* Pyramid steps */
.pyramid-steps {
  display: flex;
  gap: 4px;
  align-items: flex-end;
  justify-content: center;
  margin: .5rem 0;
}
.pyramid-step {
  border-radius: 4px 4px 0 0;
  background: var(--border-color);
  width: 20px;
  transition: background .3s, transform .3s;
}
.pyramid-step.active { background: var(--gradient-primary); transform: scaleY(1.1); }
.pyramid-step.done   { background: var(--color-success); }

/* ---- Checklist ------------------------------------------- */
.check-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-card);
  margin-bottom: 1rem;
  transition: var(--transition);
}
.check-card.done { border-color: rgba(16,185,129,.4); background: rgba(16,185,129,.05); }
.check-item {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .9rem 1.25rem;
  border-bottom: 1px solid var(--border-color);
  transition: var(--transition);
}
.check-item:last-child { border-bottom: none; }
.check-item:hover { background: rgba(255,255,255,.03); }
.check-item.done .check-label { text-decoration: line-through; color: var(--text-muted); }

.custom-checkbox {
  width: 22px; height: 22px;
  border-radius: 6px;
  border: 2px solid var(--border-color);
  background: var(--bg-secondary);
  cursor: pointer;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  transition: var(--transition);
}
.custom-checkbox.checked {
  background: var(--color-success);
  border-color: var(--color-success);
}
.custom-checkbox.checked::after {
  content: '✓';
  color: #fff;
  font-size: .75rem;
  font-weight: 700;
}

/* Stat cards */
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-card);
  padding: 1.5rem;
  text-align: center;
}
.stat-number { font-size: 2.5rem; font-weight: 800; line-height: 1; }
.stat-label  { color: var(--text-secondary); font-size: .85rem; font-weight: 500; }

/* ---- Loading spinner ------------------------------------- */
.kegel-spinner {
  width: 40px; height: 40px;
  border: 4px solid var(--border-color);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: spin .7s linear infinite;
  margin: 0 auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- Alerts ---------------------------------------------- */
.alert-kegel {
  border-radius: 12px;
  border: 1px solid;
  padding: .9rem 1.25rem;
  font-size: .9rem;
}
.alert-kegel-success { background: rgba(16,185,129,.1); border-color: rgba(16,185,129,.3); color: #6ee7b7; }
.alert-kegel-danger  { background: rgba(239,68,68,.1); border-color: rgba(239,68,68,.3);  color: #fca5a5; }
.alert-kegel-info    { background: rgba(6,182,212,.1); border-color: rgba(6,182,212,.3);  color: #67e8f9; }
.alert-kegel-warning { background: rgba(245,158,11,.1);border-color: rgba(245,158,11,.3); color: #fcd34d; }

/* ---- Footer ---------------------------------------------- */
.kegel-footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
}

/* ---- Auth pages ------------------------------------------ */
.auth-page {
  min-height: 100vh;
  background: var(--gradient-hero);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
}
.auth-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 2.5rem;
  width: 100%;
  max-width: 440px;
  box-shadow: 0 24px 60px rgba(0,0,0,.5);
}
.auth-logo { font-size: 1.5rem; font-weight: 800; text-align: center; margin-bottom: 1.75rem; }

/* ---- Admin tables ---------------------------------------- */
.table-dark-custom {
  color: var(--text-primary);
  border-color: var(--border-color);
}
.table-dark-custom thead th {
  background: var(--bg-secondary);
  color: var(--text-secondary);
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .05em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--border-color);
  padding: .85rem 1rem;
}
.table-dark-custom tbody td {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-color);
  padding: .85rem 1rem;
  vertical-align: middle;
}
.table-dark-custom tbody tr:hover td { background: var(--bg-card-hover); }

/* ---- Utility --------------------------------------------- */
.section-title { font-size: 1.75rem; font-weight: 700; margin-bottom: .5rem; }
.section-lead  { color: var(--text-secondary); margin-bottom: 2rem; }

.divider { border: none; border-top: 1px solid var(--border-color); margin: 2rem 0; }

.glow-primary { box-shadow: 0 0 30px rgba(79,70,229,.3); }
.glow-cyan    { box-shadow: 0 0 30px rgba(6,182,212,.3); }

/* Page header strip */
.page-header {
  background: linear-gradient(135deg, #111827, #1a2035);
  border-bottom: 1px solid var(--border-color);
  padding: 2.5rem 0 2rem;
}
.page-header h1 { font-size: 1.75rem; margin-bottom: .25rem; }

/* Responsive tweaks */
@media (max-width: 768px) {
  .auth-card { padding: 1.75rem 1.25rem; }
  .hero-title { font-size: 2rem; }
  .timer-wrapper { width: 220px; height: 220px; }
  .timer-svg { width: 220px; height: 220px; }
  .timer-seconds { font-size: 3rem; }
}
