:root {
  --bg-color: #0f1115;
  --card-bg: #181b21;
  --primary-accent: #ff5722;
  --secondary-accent: #ffc107;
  --text-primary: #ffffff;
  --text-secondary: #a0aabf;
  --border-color: rgba(255, 87, 34, 0.15);
  --glow-primary: rgba(255, 87, 34, 0.4);
  --glow-secondary: rgba(255, 193, 7, 0.3);
  
  --font-heading: 'Poppins', sans-serif;
  --font-body: 'Inter', sans-serif;
  
  --transition: all 0.3s ease;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  background: linear-gradient(-45deg, #0f1115, #1c1010, #1a1510, #0f1115);
  background-size: 400% 400%;
  animation: gradientBG 15s ease infinite;
  color: var(--text-primary);
  font-family: var(--font-body);
  line-height: 1.6;
  overflow-x: hidden;
  position: relative;
}

@keyframes gradientBG {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 10px;
}
::-webkit-scrollbar-track {
  background: var(--bg-color);
}
::-webkit-scrollbar-thumb {
  background: var(--card-bg);
  border-radius: 5px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--primary-accent);
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 1rem;
}

h1 { font-size: clamp(2.5rem, 5vw, 4.5rem); }
h2 { font-size: clamp(2rem, 4vw, 3rem); }
h3 { font-size: 1.75rem; }

p {
  color: var(--text-secondary);
  margin-bottom: 1rem;
}

a {
  text-decoration: none;
  color: inherit;
  transition: var(--transition);
}

ul {
  list-style: none;
}

.text-gradient {
  background: linear-gradient(135deg, var(--primary-accent), var(--secondary-accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.text-gold {
  color: var(--secondary-accent);
}

/* Layout */
.container {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 2rem;
}

section {
  padding: 6rem 0;
  position: relative;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.875rem 2rem;
  border-radius: 50px;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
  border: none;
  z-index: 1;
}

.btn-primary {
  background: var(--primary-accent);
  color: #fff;
  box-shadow: 0 0 20px var(--glow-primary);
}

.btn-primary::before {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 100%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transition: all 0.5s ease;
  z-index: -1;
}

.btn-primary:hover::before {
  left: 100%;
}

.btn-primary:hover {
  box-shadow: 0 0 30px rgba(255, 87, 34, 0.7);
}

.btn-outline {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  backdrop-filter: blur(10px);
}

.btn-outline:hover, .filter-btn.active {
  border-color: var(--primary-accent);
  background: var(--primary-accent);
  color: #fff;
}

/* Navbar */
header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  transition: var(--transition);
  padding: 1.5rem 0;
  background: transparent;
}

header.scrolled {
  padding: 1rem 0;
  background: transparent;
  border-bottom: none;
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: var(--transition);
  border-radius: 50px;
  padding: 0.5rem 0;
}

header.scrolled .nav-container {
  background: rgba(15, 17, 21, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.05);
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
  padding: 0.75rem 2rem;
}

.logo {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.logo span {
  color: var(--primary-accent);
}

.nav-links {
  display: flex;
  gap: 2rem;
}

.nav-links a {
  font-weight: 500;
  font-size: 0.95rem;
  position: relative;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--primary-accent);
  transition: var(--transition);
}

.nav-links a:hover::after, .nav-links a.active::after {
  width: 100%;
}

.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 1.5rem;
  cursor: pointer;
}

/* UI Cards & Glassmorphism */
.glass-card {
  background: linear-gradient(145deg, rgba(24, 27, 33, 0.8), rgba(15, 17, 21, 0.4));
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 24px;
  padding: 2rem;
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.glass-card:hover {
  border-color: rgba(255, 87, 34, 0.4);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6), 0 0 20px rgba(255, 87, 34, 0.15);
  transform: translateY(-8px);
}

/* Grids */
.grid-3 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2rem;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: 2rem;
}

/* Hero Section */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-top: 6rem;
  position: relative;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}

.hero-bg-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  opacity: 0.6;
  animation: heroBgScale 20s infinite alternate ease-in-out;
}

.hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(to bottom, rgba(15, 17, 21, 0.8) 0%, rgba(15, 17, 21, 1) 100%);
  z-index: 1;
}

@keyframes heroBgScale {
  0% { transform: scale(1); }
  100% { transform: scale(1.1); }
}

.hero-content {
  text-align: center;
  margin: 0 auto;
  z-index: 2;
  position: relative;
  max-width: 800px;
}

.hero-buttons {
  display: flex;
  gap: 1rem;
  justify-content: center;
  margin-top: 2rem;
}

/* Stats/Badges */
.meta-badges {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border-color);
  border-radius: 30px;
  font-size: 0.85rem;
  color: var(--text-primary);
}

.badge i {
  color: var(--secondary-accent);
}

/* Card Images */
.card-img-wrapper {
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 1.5rem;
  position: relative;
  aspect-ratio: 16/9;
}

.card-img-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.glass-card:hover .card-img-wrapper img {
  transform: scale(1.05);
}

/* Modals */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center; justify-content: center;
  z-index: 2000;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
  padding: 1rem;
}
.modal-overlay.active {
  opacity: 1; visibility: visible;
}
.modal-content {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  padding: 2.5rem;
  border-radius: 20px;
  max-width: 600px;
  width: 100%;
  position: relative;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 50px rgba(0,0,0,0.8);
}
.modal-close {
  position: absolute;
  top: 1rem; right: 1rem;
  background: rgba(255, 87, 34, 0.1);
  border: 1px solid var(--primary-accent);
  color: var(--primary-accent);
  border-radius: 50%;
  width: 35px; height: 35px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem; cursor: pointer;
  transition: var(--transition);
}
.modal-close:hover {
  background: var(--primary-accent);
  color: #fff;
}

/* Detail Pages (Exercise/Plan) */
.detail-hero {
  padding-top: 8rem;
  padding-bottom: 3rem;
  border-bottom: 1px solid var(--border-color);
}

.detail-layout {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 4rem;
  margin-top: 3rem;
}

.detail-content h3 {
  margin-top: 2.5rem;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.detail-content h3 i {
  color: var(--primary-accent);
}

.step-list {
  counter-reset: steps;
  padding-left: 0;
}

.step-list li {
  position: relative;
  padding-left: 3rem;
  margin-bottom: 1.5rem;
  color: var(--text-secondary);
}

.step-list li::before {
  counter-increment: steps;
  content: counter(steps);
  position: absolute;
  left: 0;
  top: -2px;
  width: 32px;
  height: 32px;
  background: rgba(255, 87, 34, 0.1);
  border: 1px solid var(--primary-accent);
  color: var(--primary-accent);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-family: var(--font-heading);
}

.muscle-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.muscle-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem;
  background: rgba(255,255,255,0.03);
  border-radius: 10px;
  border: 1px solid var(--border-color);
}

.progress-bar {
  width: 100%;
  height: 6px;
  background: var(--bg-color);
  border-radius: 3px;
  margin-top: 0.5rem;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary-accent), var(--secondary-accent));
}

/* Forms */
.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
}

.form-control {
  width: 100%;
  padding: 1rem;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  color: var(--text-primary);
  font-family: var(--font-body);
  transition: var(--transition);
}

.form-control:focus {
  outline: none;
  border-color: var(--primary-accent);
  background: rgba(255,255,255,0.05);
}

textarea.form-control {
  min-height: 150px;
  resize: vertical;
}

/* Footer */
footer {
  background: var(--card-bg);
  border-top: 1px solid var(--border-color);
  padding: 4rem 0 2rem;
  margin-top: 4rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 3rem;
  margin-bottom: 3rem;
}

.footer-col h4 {
  font-size: 1.2rem;
  margin-bottom: 1.5rem;
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.footer-links a:hover {
  color: var(--primary-accent);
  padding-left: 5px;
}

.footer-bottom {
  text-align: center;
  padding-top: 2rem;
  border-top: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-size: 0.9rem;
}

/* Workout Player Overlay */
.workout-player-overlay {
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(15, 17, 21, 0.98);
  backdrop-filter: blur(15px);
  display: flex;
  align-items: center; justify-content: center;
  z-index: 3000;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
  padding: 1rem;
}
.workout-player-overlay.active {
  opacity: 1; visibility: visible;
}
.workout-player-content {
  text-align: center;
  width: 100%;
  max-width: 600px;
  padding: 3rem 2rem;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  position: relative;
  box-shadow: 0 20px 50px rgba(0,0,0,0.8);
}
.timer-display {
  font-family: var(--font-heading);
  font-size: clamp(4rem, 15vw, 7rem);
  font-weight: 800;
  color: var(--primary-accent);
  margin: 1.5rem 0;
  text-shadow: 0 0 30px rgba(255, 87, 34, 0.5);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.player-controls {
  display: flex;
  justify-content: center;
  gap: 1rem;
}
.player-close {
  position: absolute;
  top: 1rem; right: 1rem;
  background: rgba(255, 87, 34, 0.1);
  border: 1px solid var(--primary-accent);
  color: var(--primary-accent);
  border-radius: 50%;
  width: 35px; height: 35px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem; cursor: pointer;
  transition: var(--transition);
}
.player-close:hover {
  background: var(--primary-accent);
  color: #fff;
}

/* Responsive */
@media (max-width: 992px) {
  .detail-layout {
    grid-template-columns: 1fr;
  }
  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 768px) {
  .nav-links {
    position: fixed;
    top: 80px;
    left: -100%;
    width: 100%;
    height: calc(100vh - 80px);
    background: var(--bg-color);
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
  }
  .nav-links.active {
    left: 0;
  }
  .mobile-menu-btn {
    display: block;
  }
  .hero-buttons {
    flex-direction: column;
    align-items: center;
    justify-content: center;
  }
  .footer-grid {
    grid-template-columns: 1fr;
  }
  .grid-3 {
    grid-template-columns: 1fr;
  }
}