/* ================================================
   WEDEVTREINO – Design System
   Colors: Black (#0a0a0a), Yellow (#FFD600), White
   ================================================ */

:root {
  --bg: #0a0a0a;
  --bg-card: #141414;
  --bg-card-hover: #1a1a1a;
  --bg-elevated: #1e1e1e;
  --accent: #FFD600;
  --accent-dim: #FFD60033;
  --accent-glow: #FFD60022;
  --white: #FFFFFF;
  --white-80: rgba(255,255,255,0.80);
  --white-60: rgba(255,255,255,0.60);
  --white-40: rgba(255,255,255,0.40);
  --white-20: rgba(255,255,255,0.20);
  --white-10: rgba(255,255,255,0.10);
  --white-05: rgba(255,255,255,0.05);
  --green: #34D399;
  --red: #F87171;
  --blue: #60A5FA;
  --orange: #FB923C;
  --purple: #A78BFA;
  --radius: 14px;
  --radius-sm: 10px;
  --radius-xs: 6px;
  --shadow: 0 4px 24px rgba(0,0,0,0.5);
  --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--white);
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

.hidden { display: none !important; }

/* ========== SPLASH ========== */
.splash {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}
.splash.fade-out {
  opacity: 0;
  visibility: hidden;
}
.splash-content {
  text-align: center;
}
.splash-icon {
  font-size: 3rem;
  display: block;
  margin-bottom: 0.5rem;
  animation: pulse-icon 1.5s ease-in-out infinite;
}
.splash-content h1 {
  font-size: 2rem;
  font-weight: 900;
  letter-spacing: 2px;
  color: var(--white);
}
.splash-loader {
  width: 200px;
  height: 3px;
  background: var(--white-10);
  border-radius: 3px;
  margin: 1.5rem auto 0;
  overflow: hidden;
}
.loader-bar {
  width: 0%;
  height: 100%;
  background: var(--accent);
  border-radius: 3px;
  animation: load 1.4s ease forwards;
}
@keyframes load {
  0% { width: 0%; }
  100% { width: 100%; }
}
@keyframes pulse-icon {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.15); }
}

/* ========== APP SHELL ========== */
.app {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
}

/* ========== HEADER ========== */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid var(--white-05);
  backdrop-filter: blur(12px);
}
.header-left {
  display: flex;
  align-items: center;
  gap: 8px;
}
.logo-icon {
  font-size: 1.4rem;
}
.logo {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: 1.5px;
}
.accent {
  color: var(--accent);
}
.header-btn {
  background: var(--white-05);
  border: none;
  border-radius: 50%;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white-60);
  cursor: pointer;
  transition: var(--transition);
}
.header-btn:active {
  background: var(--white-10);
  color: var(--accent);
}

/* ========== DAY INDICATOR ========== */
.day-indicator {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: linear-gradient(135deg, var(--accent-dim), var(--accent-glow));
  border-bottom: 1px solid var(--accent-dim);
}
.day-label {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 2px;
  color: var(--white-60);
  text-transform: uppercase;
}
.day-workout {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 1px;
}

/* ========== TABS ========== */
.tabs {
  display: flex;
  gap: 6px;
  padding: 12px 16px;
  background: var(--bg);
  position: sticky;
  top: 51px;
  z-index: 90;
}
.tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 10px 6px;
  border: 1px solid var(--white-10);
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  color: var(--white-60);
}
.tab.active {
  border-color: var(--accent);
  background: var(--accent-dim);
  color: var(--white);
}
.tab:active {
  transform: scale(0.97);
}
.tab-letter {
  font-size: 1.1rem;
  font-weight: 800;
}
.tab.active .tab-letter {
  color: var(--accent);
}
.tab-desc {
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

/* ========== WORKOUT SECTIONS ========== */
.content {
  flex: 1;
  padding: 0 12px 100px;
}

.workout-section {
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.workout-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 4px;
}
.workout-badge {
  width: 44px;
  height: 44px;
  background: var(--accent);
  color: var(--bg);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  font-weight: 900;
  flex-shrink: 0;
}
.workout-header h2 {
  font-size: 1.1rem;
  font-weight: 700;
}
.workout-schedule {
  font-size: 0.75rem;
  color: var(--white-40);
  margin-top: 2px;
}
.workout-timer {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.75rem;
  color: var(--accent);
  font-weight: 600;
  background: var(--accent-dim);
  padding: 5px 10px;
  border-radius: 20px;
  white-space: nowrap;
}

/* ========== EXERCISE CARDS ========== */
.exercises-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.exercise-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 12px;
  background: var(--bg-card);
  border: 1px solid var(--white-05);
  border-radius: var(--radius);
  text-decoration: none;
  color: inherit;
  transition: var(--transition);
  cursor: pointer;
}
.exercise-card:active {
  background: var(--bg-card-hover);
  border-color: var(--accent-dim);
  transform: scale(0.985);
}
.exercise-number {
  width: 32px;
  height: 32px;
  background: var(--white-05);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--accent);
  flex-shrink: 0;
}
.exercise-info {
  flex: 1;
  min-width: 0;
}
.exercise-info h3 {
  font-size: 0.88rem;
  font-weight: 600;
  margin-bottom: 4px;
  line-height: 1.3;
}
.exercise-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 4px;
}
.tag {
  font-size: 0.65rem;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 4px;
  letter-spacing: 0.3px;
}
.tag-sets {
  background: var(--accent-dim);
  color: var(--accent);
}
.tag-rest {
  background: var(--white-05);
  color: var(--white-60);
}
.tag-prehab {
  background: rgba(52, 211, 153, 0.15);
  color: var(--green);
}
.exercise-note {
  font-size: 0.7rem;
  color: var(--white-40);
  line-height: 1.4;
}
.exercise-play {
  width: 34px;
  height: 34px;
  background: var(--accent);
  color: var(--bg);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: var(--transition);
}
.exercise-card:active .exercise-play {
  transform: scale(1.1);
}

/* ========== MEGASET / SUPERSET GROUP ========== */
.megaset-group {
  background: var(--bg-card);
  border: 1px solid var(--white-10);
  border-radius: var(--radius);
  overflow: hidden;
}
.technique-label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: var(--white-05);
  flex-wrap: wrap;
}
.technique-badge {
  font-size: 0.6rem;
  font-weight: 800;
  letter-spacing: 1px;
  padding: 3px 8px;
  border-radius: 4px;
}
.technique-badge.megaset {
  background: rgba(251, 146, 60, 0.2);
  color: var(--orange);
}
.technique-badge.superset {
  background: rgba(96, 165, 250, 0.2);
  color: var(--blue);
}
.technique-badge.dropset {
  background: rgba(248, 113, 113, 0.2);
  color: var(--red);
}
.technique-badge.topset {
  background: rgba(167, 139, 250, 0.2);
  color: var(--purple);
}
.technique-detail {
  font-size: 0.65rem;
  color: var(--white-40);
}
.grouped-first, .grouped-last {
  border: none;
  border-radius: 0;
  background: transparent;
}
.grouped-first:active, .grouped-last:active {
  background: var(--white-05);
}
.connector {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 16px;
}
.connector-line {
  flex: 1;
  height: 1px;
  background: var(--white-10);
}
.connector-icon {
  font-size: 0.9rem;
}

/* ========== WEEK TOGGLE (Treino C) ========== */
.week-toggle {
  display: flex;
  gap: 6px;
  padding: 0 0 12px;
}
.week-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px;
  background: var(--bg-card);
  border: 1px solid var(--white-10);
  border-radius: var(--radius-sm);
  color: var(--white-60);
  font-size: 0.7rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
}
.week-btn.active {
  border-color: var(--accent);
  background: var(--accent-dim);
  color: var(--white);
}
.week-btn:active {
  transform: scale(0.97);
}
.week-icon {
  font-size: 1rem;
}

/* ========== WORKOUT SUMMARY ========== */
.workout-summary {
  margin-top: 12px;
  padding: 12px 16px;
  background: var(--accent-dim);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--accent);
}
.workout-summary p {
  font-size: 0.75rem;
  color: var(--white-60);
  line-height: 1.5;
}

/* ========== BOTTOM NAV ========== */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  background: #0d0d0d;
  border-top: 1px solid var(--white-05);
  padding: 6px 0 calc(6px + var(--safe-bottom));
  z-index: 100;
  backdrop-filter: blur(12px);
}
.nav-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 8px 0;
  background: none;
  border: none;
  color: var(--white-40);
  font-size: 0.62rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
  letter-spacing: 0.3px;
}
.nav-btn.active {
  color: var(--accent);
}
.nav-btn:active {
  transform: scale(0.92);
}

/* ========== VIEW SECTIONS (Progress & Techniques) ========== */
.view-section {
  flex: 1;
  padding: 0 12px 100px;
  animation: fadeIn 0.3s ease;
}
.view-header {
  padding: 16px 4px;
}
.view-header h2 {
  font-size: 1.15rem;
  font-weight: 700;
}

/* ========== PROGRESS TIMELINE ========== */
.progress-timeline {
  padding-left: 4px;
}
.progress-phase {
  display: flex;
  gap: 14px;
  margin-bottom: 4px;
}
.phase-marker {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 20px;
  flex-shrink: 0;
}
.phase-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--bg);
  box-shadow: 0 0 0 2px var(--accent-dim);
  flex-shrink: 0;
}
.phase-dot.last {
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent-dim), 0 0 0 2px var(--accent-dim);
}
.phase-line {
  width: 2px;
  flex: 1;
  background: var(--white-10);
  min-height: 20px;
}
.phase-content {
  padding-bottom: 20px;
}
.phase-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.phase-weeks {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--accent);
}
.phase-tag {
  font-size: 0.6rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--white-05);
  color: var(--white-40);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.phase-content p {
  font-size: 0.8rem;
  color: var(--white-60);
  line-height: 1.5;
}

/* ========== INFO CARD ========== */
.info-card {
  margin-top: 16px;
  padding: 16px;
  background: var(--bg-card);
  border: 1px solid var(--white-10);
  border-radius: var(--radius);
}
.info-card h3 {
  font-size: 0.88rem;
  font-weight: 700;
  margin-bottom: 10px;
}
.info-card ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.info-card li {
  font-size: 0.78rem;
  color: var(--white-60);
  padding-left: 16px;
  position: relative;
  line-height: 1.4;
}
.info-card li::before {
  content: '›';
  position: absolute;
  left: 0;
  color: var(--accent);
  font-weight: 700;
}

/* ========== TECHNIQUE CARDS ========== */
.technique-card {
  background: var(--bg-card);
  border: 1px solid var(--white-10);
  border-radius: var(--radius);
  margin-bottom: 12px;
  overflow: hidden;
}
.technique-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: var(--white-05);
}
.technique-phase {
  font-size: 0.65rem;
  color: var(--white-40);
  font-weight: 600;
}
.technique-card-body {
  padding: 14px;
}
.technique-card-body p {
  font-size: 0.8rem;
  color: var(--white-60);
  line-height: 1.5;
  margin-bottom: 8px;
}
.technique-card-body ol {
  list-style: none;
  counter-reset: step;
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 10px;
}
.technique-card-body ol li {
  counter-increment: step;
  font-size: 0.78rem;
  color: var(--white-60);
  padding-left: 24px;
  position: relative;
  line-height: 1.5;
}
.technique-card-body ol li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  width: 18px;
  height: 18px;
  background: var(--white-05);
  border-radius: 4px;
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  top: 1px;
}
.technique-goal {
  padding: 8px 10px;
  background: var(--accent-dim);
  border-radius: var(--radius-xs);
  color: var(--white-80) !important;
  font-size: 0.75rem !important;
}
.technique-warning {
  padding: 8px 10px;
  background: rgba(248, 113, 113, 0.1);
  border-radius: var(--radius-xs);
  color: var(--red);
  font-size: 0.72rem;
  line-height: 1.4;
  margin-top: 8px;
}

/* ========== RESPONSIVE ========== */
@media (min-width: 500px) {
  .content, .view-section {
    max-width: 480px;
    margin: 0 auto;
  }
  .tabs {
    max-width: 480px;
    margin: 0 auto;
  }
}

/* ========== SCROLLBAR ========== */
::-webkit-scrollbar {
  width: 4px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--white-10);
  border-radius: 4px;
}

/* ========== SELECTION ========== */
::selection {
  background: var(--accent);
  color: var(--bg);
}
