/* ============================================
   SOUTHFIT GYM — COMPONENT STYLES
   ============================================ */

/* ── Sidebar ── */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-w);
  height: 100vh;
  background: var(--bg-surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 100;
  transition: transform var(--t-base);
}

.sidebar-logo {
  padding: var(--sp-5) var(--sp-5) var(--sp-4);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: var(--sp-3);
}

.logo-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--accent), #00a882);
  border-radius: var(--r-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
  box-shadow: 0 0 12px var(--accent-glow);
}

.logo-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.logo-name {
  font-size: var(--fs-base);
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.3px;
}

.logo-sub {
  font-size: var(--fs-xs);
  color: var(--accent);
  font-weight: 500;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.sidebar-nav {
  flex: 1;
  padding: var(--sp-4) var(--sp-3);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
}

.nav-section-label {
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.8px;
  text-transform: uppercase;
  padding: var(--sp-3) var(--sp-3) var(--sp-2);
  margin-top: var(--sp-2);
}

.nav-item {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: 9px var(--sp-3);
  border-radius: var(--r-md);
  color: var(--text-secondary);
  font-size: var(--fs-sm);
  font-weight: 500;
  cursor: pointer;
  transition: all var(--t-fast);
  position: relative;
  user-select: none;
}

.nav-item:hover {
  color: var(--text-primary);
  background: var(--bg-card);
}

.nav-item.active {
  color: var(--accent);
  background: var(--accent-dim);
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 60%;
  background: var(--accent);
  border-radius: 0 var(--r-full) var(--r-full) 0;
}

.nav-icon {
  font-size: 18px;
  width: 20px;
  text-align: center;
  flex-shrink: 0;
}

.nav-badge {
  margin-left: auto;
  background: var(--red);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: var(--r-full);
  min-width: 18px;
  text-align: center;
}

.sidebar-footer {
  padding: var(--sp-4) var(--sp-3);
  border-top: 1px solid var(--border);
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3);
  border-radius: var(--r-md);
  cursor: pointer;
  transition: background var(--t-fast);
}

.sidebar-user:hover { background: var(--bg-card); }

.user-avatar {
  width: 34px;
  height: 34px;
  border-radius: var(--r-full);
  background: linear-gradient(135deg, var(--accent-alt), var(--accent));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--fs-sm);
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.user-info {
  flex: 1;
  min-width: 0;
}

.user-name {
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-role {
  font-size: var(--fs-xs);
  color: var(--text-muted);
  text-transform: capitalize;
}

/* ── Header ── */
.header {
  position: fixed;
  top: 0;
  left: var(--sidebar-w);
  right: 0;
  height: var(--header-h);
  background: rgba(10, 10, 15, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--sp-8);
  z-index: 90;
  transition: left var(--t-base);
}

.header-left {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
}

.header-breadcrumb {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: var(--fs-sm);
  color: var(--text-secondary);
}

.breadcrumb-current {
  color: var(--text-primary);
  font-weight: 600;
}

.header-search {
  position: relative;
  display: flex;
  align-items: center;
}

.header-search-input {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-full);
  color: var(--text-primary);
  padding: 7px 14px 7px 36px;
  font-size: var(--fs-sm);
  width: 220px;
  transition: all var(--t-fast);
}

.header-search-input:focus {
  outline: none;
  border-color: var(--accent);
  width: 280px;
  box-shadow: 0 0 0 3px var(--accent-dim);
}

.header-search-icon {
  position: absolute;
  left: 12px;
  color: var(--text-muted);
  font-size: 14px;
  pointer-events: none;
}

.header-right {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
}

.header-notif {
  position: relative;
  width: 36px;
  height: 36px;
  border-radius: var(--r-full);
  background: var(--bg-card);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 16px;
  transition: all var(--t-fast);
  color: var(--text-secondary);
}

.header-notif:hover {
  border-color: var(--border-light);
  color: var(--text-primary);
}

.notif-dot {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 7px;
  height: 7px;
  background: var(--red);
  border-radius: var(--r-full);
  border: 2px solid var(--bg-base);
  animation: pulse 2s infinite;
}

/* ── KPI Cards ── */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--sp-4);
  margin-bottom: var(--sp-8);
}

.kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--sp-5) var(--sp-6);
  position: relative;
  overflow: hidden;
  transition: all var(--t-fast);
}

.kpi-card:hover {
  border-color: var(--border-light);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.kpi-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  border-radius: var(--r-lg) var(--r-lg) 0 0;
}

.kpi-card.kpi-green::before  { background: var(--green); }
.kpi-card.kpi-yellow::before { background: var(--yellow); }
.kpi-card.kpi-red::before    { background: var(--red); }
.kpi-card.kpi-blue::before   { background: var(--blue); }
.kpi-card.kpi-purple::before { background: var(--accent-alt); }

.kpi-icon {
  font-size: 24px;
  margin-bottom: var(--sp-3);
}

.kpi-value {
  font-size: var(--fs-3xl);
  font-weight: 800;
  line-height: 1;
  margin-bottom: var(--sp-1);
  letter-spacing: -1px;
}

.kpi-label {
  font-size: var(--fs-xs);
  color: var(--text-secondary);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.kpi-trend {
  display: flex;
  align-items: center;
  gap: var(--sp-1);
  margin-top: var(--sp-3);
  font-size: var(--fs-xs);
  font-weight: 500;
}

.kpi-trend.up   { color: var(--green); }
.kpi-trend.down { color: var(--red); }

/* ── Table ── */
.table-container {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
}

.table-container table {
  display: block;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.table-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-4) var(--sp-5);
  border-bottom: 1px solid var(--border);
  gap: var(--sp-3);
  flex-wrap: wrap;
}

.table-search {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1;
  max-width: 340px;
}

.table-search-icon {
  position: absolute;
  left: 12px;
  color: var(--text-muted);
  font-size: 14px;
  pointer-events: none;
}

.table-search-input {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  color: var(--text-primary);
  padding: 8px 12px 8px 34px;
  font-size: var(--fs-sm);
  width: 100%;
  transition: all var(--t-fast);
}

.table-search-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

.table-search-input::placeholder { color: var(--text-muted); }

table {
  width: 100%;
  border-collapse: collapse;
}

thead tr {
  background: var(--bg-surface);
}

th {
  text-align: left;
  padding: 10px var(--sp-5);
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.5px;
  text-transform: uppercase;
  white-space: nowrap;
  border-bottom: 1px solid var(--border);
}

td {
  padding: 12px var(--sp-5);
  font-size: var(--fs-sm);
  color: var(--text-primary);
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

tr:last-child td {
  border-bottom: none;
}

tbody tr {
  transition: background var(--t-fast);
}

tbody tr:hover {
  background: var(--bg-card-hover);
}

.table-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-3) var(--sp-5);
  border-top: 1px solid var(--border);
  font-size: var(--fs-xs);
  color: var(--text-muted);
}

/* ── Badges ── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: var(--r-full);
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: 0.3px;
  white-space: nowrap;
}

.badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.badge-green  { background: var(--green-dim);  color: var(--green);  }
.badge-green::before  { background: var(--green); }

.badge-red    { background: var(--red-dim);    color: var(--red);    }
.badge-red::before    { background: var(--red); }

.badge-yellow { background: var(--yellow-dim); color: var(--yellow); }
.badge-yellow::before { background: var(--yellow); }

.badge-blue   { background: var(--blue-dim);   color: var(--blue);   }
.badge-blue::before   { background: var(--blue); }

.badge-purple { background: var(--accent-alt-dim); color: var(--accent-alt); }
.badge-purple::before { background: var(--accent-alt); }

.badge-gray   { background: rgba(136,136,170,0.12); color: var(--text-secondary); }
.badge-gray::before   { background: var(--text-secondary); }

/* ── Modal ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--sp-4);
  animation: fadeIn 0.2s ease;
}

.modal {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--r-xl);
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  animation: fadeInScale 0.25s ease;
  box-shadow: var(--shadow-lg);
}

.modal-lg {
  max-width: 700px;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-6);
  border-bottom: 1px solid var(--border);
}

.modal-title {
  font-size: var(--fs-lg);
  font-weight: 700;
}

.modal-close {
  width: 32px;
  height: 32px;
  border-radius: var(--r-md);
  background: var(--bg-input);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  transition: all var(--t-fast);
  cursor: pointer;
  border: none;
}

.modal-close:hover {
  background: var(--red-dim);
  color: var(--red);
}

.modal-body {
  padding: var(--sp-6);
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--sp-3);
  padding: var(--sp-4) var(--sp-6);
  border-top: 1px solid var(--border);
}

/* ── Toast ── */
#toast-root {
  position: fixed;
  bottom: var(--sp-6);
  right: var(--sp-6);
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  pointer-events: none;
}

.toast {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--r-lg);
  padding: var(--sp-4) var(--sp-5);
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  min-width: 300px;
  max-width: 420px;
  box-shadow: var(--shadow-lg);
  animation: slideInRight 0.3s ease;
  pointer-events: all;
}

.toast-icon {
  font-size: 20px;
  flex-shrink: 0;
}

.toast-content {
  flex: 1;
}

.toast-title {
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--text-primary);
}

.toast-msg {
  font-size: var(--fs-xs);
  color: var(--text-secondary);
  margin-top: 2px;
}

.toast-success { border-left: 3px solid var(--green); }
.toast-error   { border-left: 3px solid var(--red); }
.toast-warning { border-left: 3px solid var(--yellow); }
.toast-info    { border-left: 3px solid var(--blue); }

.toast-leaving {
  animation: slideInRight 0.3s ease reverse;
}

/* ── Stat Row ── */
.stat-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-3) 0;
  border-bottom: 1px solid var(--border);
}

.stat-row:last-child { border-bottom: none; }

/* ── Avatar ── */
.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-full);
  font-weight: 700;
  flex-shrink: 0;
  background: linear-gradient(135deg, var(--accent-alt), var(--accent));
  color: #fff;
}

.avatar-sm { width: 28px; height: 28px; font-size: var(--fs-xs); }
.avatar-md { width: 36px; height: 36px; font-size: var(--fs-sm); }
.avatar-lg { width: 48px; height: 48px; font-size: var(--fs-md); }

/* ── Member Row ── */
.member-cell {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
}

.member-cell-info { display: flex; flex-direction: column; }
.member-cell-name { font-weight: 600; font-size: var(--fs-sm); }
.member-cell-sub  { font-size: var(--fs-xs); color: var(--text-muted); }

/* ── Action Menu ── */
.action-menu {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}

/* ── Progress Bar ── */
.progress-bar {
  height: 4px;
  background: var(--border);
  border-radius: var(--r-full);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: var(--r-full);
  background: linear-gradient(90deg, var(--accent), #00a882);
  transition: width var(--t-slow);
}

/* ── Activity Feed ── */
.activity-item {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-3);
  padding: var(--sp-3) 0;
  border-bottom: 1px solid var(--border);
  animation: fadeIn 0.3s ease;
}

.activity-item:last-child { border-bottom: none; }

.activity-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-top: 5px;
  flex-shrink: 0;
}

.activity-content .activity-text { font-size: var(--fs-sm); }
.activity-content .activity-time { font-size: var(--fs-xs); color: var(--text-muted); margin-top: 2px; }

/* ── Photo Upload ── */
.photo-upload-area {
  border: 2px dashed var(--border);
  border-radius: var(--r-lg);
  padding: var(--sp-8);
  text-align: center;
  cursor: pointer;
  transition: all var(--t-fast);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-3);
}

.photo-upload-area:hover,
.photo-upload-area.drag-over {
  border-color: var(--accent);
  background: var(--accent-dim);
}

.photo-upload-icon { font-size: 36px; }
.photo-upload-text { font-size: var(--fs-sm); color: var(--text-secondary); }

.photo-preview {
  width: 80px;
  height: 80px;
  border-radius: var(--r-lg);
  object-fit: cover;
  border: 2px solid var(--border);
}

/* ── Filter Tabs ── */
.filter-tabs {
  display: flex;
  gap: var(--sp-1);
  background: var(--bg-surface);
  padding: 4px;
  border-radius: var(--r-lg);
  border: 1px solid var(--border);
}

.filter-tab {
  padding: 6px 16px;
  border-radius: var(--r-md);
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--t-fast);
  border: none;
  background: none;
}

.filter-tab.active {
  background: var(--bg-card);
  color: var(--text-primary);
  box-shadow: var(--shadow-sm);
}

.filter-tab:hover:not(.active) {
  color: var(--text-primary);
}

/* ── Skeleton Loader ── */
.skeleton {
  background: linear-gradient(90deg, var(--bg-card) 25%, var(--bg-card-hover) 50%, var(--bg-card) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--r-sm);
}

@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ── Hamburger button (hidden on desktop) ── */
.hamburger-btn {
  display: none;
  background: none;
  border: 1px solid var(--border);
  color: var(--text-primary);
  font-size: 20px;
  padding: 4px 10px;
  border-radius: var(--r-md);
  cursor: pointer;
  line-height: 1;
}

/* ── Sidebar overlay ── */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 99;
}
.sidebar-overlay.active {
  display: block;
}

/* ── Hide text on mobile ── */
.hide-mobile { display: inline; }

/* ── Responsive Sidebar ── */
@media (max-width: 768px) {
  .hamburger-btn {
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .hide-mobile { display: none; }
  .sidebar {
    width: 240px;
    transform: translateX(-100%);
    overflow: hidden;
  }
  .sidebar.open {
    transform: translateX(0);
    box-shadow: var(--shadow-lg);
    overflow: visible;
  }
  .header {
    left: 0;
    padding: 0 var(--sp-4);
  }
  .header-right {
    gap: 8px;
  }
  .header-breadcrumb {
    font-size: var(--fs-xs);
  }
  .modal {
    margin: var(--sp-3);
    max-height: 90vh;
    width: calc(100vw - var(--sp-6)) !important;
    min-width: auto !important;
  }
  .page-header {
    flex-direction: column;
    gap: var(--sp-3);
    align-items: flex-start;
  }
  .page-header h1 {
    font-size: var(--fs-lg);
  }
  .table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .table-container table {
    min-width: 600px;
  }
  .table-toolbar {
    flex-direction: column;
    align-items: stretch;
  }
  .table-search {
    max-width: 100%;
  }
  .form-grid {
    grid-template-columns: 1fr !important;
  }
  .kpi-grid {
    grid-template-columns: 1fr 1fr;
    gap: var(--sp-3);
  }
  .kpi-card {
    padding: var(--sp-4);
  }
  .kpi-value {
    font-size: var(--fs-xl);
  }
  .sidebar-footer {
    padding: var(--sp-3) var(--sp-2);
  }
  /* Text & boxes */
  * { word-break: break-word; }
  [style*="display:flex"][style*="gap"] { flex-wrap: wrap; }
  .revenue-grid, .stats-grid { grid-template-columns: 1fr !important; }
  .rutinas-grid { grid-template-columns: repeat(2, 1fr) !important; }
  .ejercicios-grid { grid-template-columns: 1fr !important; }
  .ejercicio-card { padding: var(--sp-4) !important; }
  .exercise-detail-stats { flex-direction: column; }
  .video-embed iframe { height: 220px; }
}

/* ============================================
   RUTINAS PAGE
   ============================================ */

.rutinas-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--sp-4);
  margin-top: var(--sp-4);
}

.rutina-group-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--sp-6);
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.rutina-group-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--group-color);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.rutina-group-card:hover {
  transform: translateY(-4px);
  border-color: var(--group-color);
  box-shadow: 0 8px 32px rgba(0,0,0,0.3), 0 0 0 1px var(--group-color);
}

.rutina-group-icon {
  font-size: 3rem;
  margin-bottom: var(--sp-3);
  filter: drop-shadow(0 4px 8px rgba(0,0,0,0.3));
}

.rutina-group-name {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: var(--sp-1);
}

.rutina-group-count {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: var(--sp-2);
}

.rutina-group-arrow {
  font-size: 1.2rem;
  color: var(--group-color);
  opacity: 0;
  transform: translateX(-8px);
  transition: all 0.3s ease;
}

.rutina-group-card:hover .rutina-group-arrow {
  opacity: 1;
  transform: translateX(0);
}

/* Exercises grid */
.ejercicios-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--sp-4);
  margin-top: var(--sp-4);
}

.ejercicio-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--sp-5);
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  position: relative;
  overflow: hidden;
}

.ejercicio-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--group-color);
  border-radius: var(--radius-lg) 0 0 var(--radius-lg);
}

.ejercicio-card:hover {
  transform: translateY(-2px);
  border-color: var(--group-color);
  box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}

.ejercicio-header {
  display: flex;
  justify-content: flex-end;
}

.ejercicio-nivel {
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.nivel-principiante {
  background: rgba(34, 197, 94, 0.15);
  color: #22c55e;
  border: 1px solid rgba(34, 197, 94, 0.3);
}

.nivel-intermedio {
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.nivel-avanzado {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.ejercicio-nombre {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.3;
}

.ejercicio-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.5;
  flex: 1;
}

.ejercicio-stats {
  display: flex;
  gap: var(--sp-3);
  padding-top: var(--sp-3);
  border-top: 1px solid var(--border);
}

.ejercicio-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
}

.stat-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-value {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--accent);
}

.ejercicio-video-btn {
  background: rgba(0, 212, 170, 0.1) !important;
  color: var(--accent) !important;
  border: 1px solid rgba(0, 212, 170, 0.3) !important;
  padding: 6px 14px !important;
  font-size: 0.8rem !important;
  border-radius: 20px !important;
  cursor: pointer;
  transition: all 0.2s;
  align-self: flex-start;
}

.ejercicio-video-btn:hover {
  background: rgba(0, 212, 170, 0.2) !important;
  border-color: var(--accent) !important;
}

.rutinas-back {
  padding: 6px 16px !important;
  font-size: 0.85rem !important;
}

/* Exercise detail modal */
.exercise-detail {
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
}

.exercise-detail-header {
  display: flex;
  gap: var(--sp-2);
  align-items: center;
}

.exercise-detail-desc {
  color: var(--text-secondary);
  line-height: 1.6;
  font-size: 0.95rem;
}

.exercise-detail-stats {
  display: flex;
  gap: var(--sp-3);
  flex-wrap: wrap;
}

.detail-stat {
  flex: 1;
  min-width: 100px;
  background: var(--bg-secondary);
  border-radius: var(--radius);
  padding: var(--sp-3);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  text-align: center;
}

.detail-stat-icon {
  font-size: 1.4rem;
}

.detail-stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
}

.detail-stat-value {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--accent);
}

/* Video embed */
.exercise-video-container {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}

.exercise-play-btn {
  align-self: flex-start;
}

.video-embed {
  width: 100%;
  border-radius: var(--radius);
  overflow: hidden;
  background: #000;
}

.video-embed iframe {
  width: 100%;
  height: 340px;
  border: none;
  border-radius: var(--radius);
}

.video-modal-content .video-embed {
  display: block;
}

/* Errors & recommendations */
.exercise-section {
  border-radius: var(--radius);
  padding: var(--sp-4);
}

.exercise-section h4 {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: var(--sp-3);
  color: var(--text-primary);
}

.exercise-section ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}

.exercise-section li {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.5;
  display: flex;
  gap: var(--sp-2);
  align-items: flex-start;
}

.exercise-errors {
  background: rgba(239, 68, 68, 0.05);
  border: 1px solid rgba(239, 68, 68, 0.15);
}

.exercise-errors .error-icon {
  color: #ef4444;
  font-weight: 700;
  flex-shrink: 0;
}

.exercise-tips {
  background: rgba(34, 197, 94, 0.05);
  border: 1px solid rgba(34, 197, 94, 0.15);
}

.exercise-tips .tip-icon {
  color: #22c55e;
  font-weight: 700;
  flex-shrink: 0;
}
