/* ================================================================
   calisthenics.css — 맨몸운동 70 Calisthenics Exercise Guide
   ================================================================ */

/* ── Screen ── */
#screen-calisthenics { background: #0a0e1a; min-height: 100vh; }
#screen-calisthenics .nav-bar {
  background: linear-gradient(135deg, #1a1e2e 0%, #0d1117 100%);
  border-bottom: 1px solid rgba(255,140,50,0.15);
}

/* ── Category bar ── */
.cal-cats {
  display: flex; flex-wrap: wrap; gap: 6px; padding: 12px 16px 8px;
  overflow: visible;
}
.cal-cats::-webkit-scrollbar { display: none; }
.cal-cat-btn {
  flex-shrink: 0; padding: 6px 14px; border-radius: 20px;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.05);
  color: #aaa; font-size: 12.5px; font-weight: 500;
  cursor: pointer; transition: all .25s;
  white-space: nowrap;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none; user-select: none;
}
.cal-cat-btn.active {
  background: linear-gradient(135deg, #ff6b2b, #ff8f00);
  color: #fff; border-color: transparent;
  box-shadow: 0 2px 12px rgba(255,107,43,0.35);
}
.cal-cat-btn:not(.active):hover { border-color: rgba(255,140,50,0.3); color: #ddd; }

/* ── Search bar ── */
.cal-search-wrap {
  padding: 4px 16px 10px; position: relative;
}
.cal-search {
  width: 100%; padding: 9px 14px 9px 36px; border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.05);
  color: #eee; font-size: 13px; outline: none;
  transition: border-color .2s;
}
.cal-search::placeholder { color: #666; }
.cal-search:focus { border-color: rgba(255,140,50,0.4); }
.cal-search-icon {
  position: absolute; left: 28px; top: 50%; transform: translateY(-50%);
  font-size: 14px; color: #666; pointer-events: none;
}

/* ── Grid ── */
.cal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(155px, 1fr));
  gap: 12px; padding: 8px 16px 100px;
}
.cal-card {
  background: linear-gradient(145deg, rgba(255,255,255,0.06), rgba(255,255,255,0.02));
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px; padding: 14px 12px;
  cursor: pointer; transition: all .25s;
  position: relative; overflow: hidden;
}
.cal-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255,140,50,0.3);
  box-shadow: 0 4px 20px rgba(255,107,43,0.15);
}
.cal-card:active { transform: scale(0.97); }

/* Card icon area */
.cal-card-icon {
  width: 100%; aspect-ratio: 1; border-radius: 10px;
  background: linear-gradient(135deg, rgba(255,107,43,0.08), rgba(255,160,80,0.04));
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 10px; position: relative; overflow: hidden;
}
.cal-card-icon svg { width: 70%; height: 70%; }
.cal-card-icon img {
  width: 100%; height: 100%; object-fit: cover;
  border-radius: 10px;
}

/* Difficulty badge */
.cal-diff {
  position: absolute; top: 6px; right: 6px;
  background: rgba(0,0,0,0.5); border-radius: 6px;
  padding: 2px 6px; font-size: 10px; color: #ffb74d;
  backdrop-filter: blur(4px);
}

/* Card text */
.cal-card-name {
  font-size: 12.5px; font-weight: 600; color: #eee;
  line-height: 1.3; margin-bottom: 4px;
}
.cal-card-muscles {
  font-size: 10.5px; color: #888; line-height: 1.3;
  display: -webkit-box; -webkit-line-clamp: 2;
  -webkit-box-orient: vertical; overflow: hidden;
}
.cal-card-cat-badge {
  display: inline-block; margin-top: 6px;
  font-size: 9.5px; padding: 2px 8px; border-radius: 10px;
  background: rgba(255,255,255,0.06);
  color: #999;
}

/* ── Detail modal ── */
.cal-modal-overlay {
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(0,0,0,0.85);
  backdrop-filter: blur(8px);
  display: flex; align-items: flex-end; justify-content: center;
  animation: calFadeIn .25s ease;
}
@keyframes calFadeIn { from { opacity: 0; } }

.cal-modal {
  width: 100%; max-width: 480px; max-height: 92vh;
  background: linear-gradient(180deg, #1a1e2e 0%, #0d1117 100%);
  border-radius: 20px 20px 0 0;
  overflow-y: auto; -webkit-overflow-scrolling: touch;
  animation: calSlideUp .3s ease;
}
@keyframes calSlideUp { from { transform: translateY(40px); opacity: 0; } }

/* Modal header */
.cal-modal-header {
  position: sticky; top: 0; z-index: 2;
  padding: 16px 20px 12px;
  background: linear-gradient(180deg, #1a1e2e, rgba(26,30,46,0.95));
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.cal-modal-back {
  display: inline-flex; align-items: center; gap: 2px;
  padding: 6px 12px 6px 8px; border-radius: 18px;
  background: rgba(255,140,50,0.15); border: 1px solid rgba(255,140,50,0.3);
  color: #ffb74d; font-size: 13px; font-weight: 600;
  cursor: pointer; transition: all .2s; margin-bottom: 8px;
}
.cal-modal-back:hover { background: rgba(255,140,50,0.25); }
.cal-modal-close {
  position: absolute; top: 14px; right: 16px;
  width: 32px; height: 32px; border-radius: 50%;
  background: rgba(255,255,255,0.08); border: none;
  color: #aaa; font-size: 18px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .2s;
}
.cal-modal-close:hover { background: rgba(255,255,255,0.15); }
.cal-modal-title {
  font-size: 18px; font-weight: 700; color: #fff;
  margin-bottom: 4px; padding-right: 40px;
}
.cal-modal-subtitle {
  font-size: 12px; color: #888;
}
.cal-modal-meta {
  display: flex; gap: 12px; margin-top: 10px; flex-wrap: wrap;
}
.cal-meta-tag {
  display: flex; align-items: center; gap: 4px;
  font-size: 11px; color: #aaa;
  padding: 4px 10px; border-radius: 8px;
  background: rgba(255,255,255,0.05);
}
.cal-meta-tag .tag-icon { font-size: 13px; }

/* Modal illustration */
.cal-modal-illustration {
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
  background: linear-gradient(135deg, rgba(255,107,43,0.06), rgba(255,160,80,0.02));
}
.cal-modal-illustration svg { width: 180px; height: 180px; }
.cal-modal-illustration img {
  width: 100%; max-width: 320px; height: auto;
  border-radius: 14px; object-fit: cover; aspect-ratio: 4/3;
}

/* Modal body */
.cal-modal-body { padding: 0 20px 30px; }

/* Section tabs */
.cal-tabs {
  display: flex; gap: 4px; margin-bottom: 16px;
  background: rgba(255,255,255,0.04); border-radius: 10px;
  padding: 3px;
}
.cal-tab {
  flex: 1; padding: 8px 0; border-radius: 8px;
  background: transparent; border: none;
  color: #888; font-size: 12px; font-weight: 500;
  cursor: pointer; transition: all .2s; text-align: center;
}
.cal-tab.active {
  background: rgba(255,140,50,0.15);
  color: #ffb74d;
}

/* Tab content panels */
.cal-tab-content { display: none; }
.cal-tab-content.active { display: block; animation: calFadeIn .2s; }

/* Steps section */
.cal-section-title {
  font-size: 13px; font-weight: 600; color: #ffb74d;
  margin-bottom: 10px; display: flex; align-items: center; gap: 6px;
}
.cal-step {
  display: flex; gap: 10px; margin-bottom: 12px;
  padding: 10px 12px; border-radius: 10px;
  background: rgba(255,255,255,0.03);
  border-left: 3px solid rgba(255,140,50,0.3);
}
.cal-step-num {
  flex-shrink: 0; width: 24px; height: 24px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ff6b2b, #ff8f00);
  color: #fff; font-size: 12px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.cal-step-text {
  font-size: 13px; color: #ddd; line-height: 1.5;
}

/* Benefits section */
.cal-benefit {
  display: flex; align-items: flex-start; gap: 8px;
  margin-bottom: 8px; padding: 8px 12px;
  border-radius: 8px; background: rgba(76,175,80,0.06);
}
.cal-benefit-icon {
  flex-shrink: 0; color: #66bb6a; font-size: 14px; margin-top: 1px;
}
.cal-benefit-text {
  font-size: 13px; color: #ccc; line-height: 1.4;
}

/* Info cards (breathing, sets, caution) */
.cal-info-row {
  display: flex; gap: 8px; margin-bottom: 8px;
}
.cal-info-card {
  flex: 1; padding: 10px; border-radius: 10px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
}
.cal-info-label {
  font-size: 10px; color: #888; margin-bottom: 4px;
  text-transform: uppercase; letter-spacing: 0.5px;
}
.cal-info-value {
  font-size: 12px; color: #ddd; line-height: 1.4;
}

/* Caution box */
.cal-caution {
  margin-top: 12px; padding: 10px 12px; border-radius: 10px;
  background: rgba(244,67,54,0.08);
  border: 1px solid rgba(244,67,54,0.15);
  display: flex; gap: 8px; align-items: flex-start;
}
.cal-caution-icon { color: #ef5350; font-size: 16px; flex-shrink: 0; }
.cal-caution-text { font-size: 12px; color: #ef9a9a; line-height: 1.4; }

/* ── Stats bar ── */
.cal-stats {
  display: flex; justify-content: space-around;
  padding: 10px 16px; margin-bottom: 4px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
.cal-stat {
  text-align: center;
}
.cal-stat-num {
  font-size: 20px; font-weight: 700;
  background: linear-gradient(135deg, #ff6b2b, #ffb74d);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.cal-stat-label {
  font-size: 10px; color: #666; margin-top: 2px;
}

/* ── Empty state ── */
.cal-empty {
  text-align: center; padding: 60px 20px;
  color: #555; font-size: 14px;
}
.cal-empty-icon { font-size: 40px; margin-bottom: 10px; opacity: 0.5; }

/* ── Responsive ── */
@media (min-width: 600px) {
  .cal-grid { grid-template-columns: repeat(3, 1fr); }
  .cal-modal { border-radius: 20px; max-height: 85vh; margin-bottom: 20px; }
}
@media (min-width: 900px) {
  .cal-grid { grid-template-columns: repeat(4, 1fr); }
}

/* ================================================================
   Exercise Hub — unified entry for Calisthenics + Yoga + Body Region
   ================================================================ */
#screen-exercise-hub { background: #0a0e1a; min-height: 100vh; }
#screen-exercise-hub .nav-bar {
  background: linear-gradient(135deg, #1a1e2e 0%, #0d1117 100%);
  border-bottom: 1px solid rgba(100,180,255,0.15);
}
#exhub-body { padding: 12px 16px 40px; }

.exhub-stats {
  display: flex; justify-content: center; gap: 24px;
  padding: 16px 0 20px; text-align: center;
}
.exhub-stat-num {
  font-size: 28px; font-weight: 800;
  background: linear-gradient(135deg, #FF6B35, #9B59B6, #2980B9);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.exhub-stat-label { font-size: 11px; color: #8899aa; margin-top: 2px; text-transform: uppercase; letter-spacing: 0.5px; }

.exhub-card {
  display: flex; align-items: center; gap: 14px;
  background: linear-gradient(135deg, rgba(30,35,50,0.95), rgba(20,25,40,0.98));
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px; padding: 18px 16px; margin-bottom: 14px;
  cursor: pointer; transition: transform 0.2s, box-shadow 0.2s;
  position: relative; overflow: hidden;
}
.exhub-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: var(--card-gradient);
  border-radius: 16px 16px 0 0;
}
.exhub-card:active { transform: scale(0.97); }

.exhub-card-icon {
  font-size: 42px; width: 64px; height: 64px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,0.05); border-radius: 14px; flex-shrink: 0;
}
.exhub-card-body { flex: 1; min-width: 0; }
.exhub-card-row1 { display: flex; align-items: baseline; gap: 8px; margin-bottom: 4px; }
.exhub-card-name { font-size: 17px; font-weight: 700; color: #f0f0f0; }
.exhub-card-count {
  font-size: 12px; font-weight: 700; padding: 2px 8px;
  border-radius: 10px; background: rgba(255,255,255,0.1); color: #aabbcc;
}
.exhub-card-desc { font-size: 12px; color: #8899aa; margin-bottom: 6px; }
.exhub-card-chips { display: flex; gap: 4px; flex-wrap: wrap; }
.exhub-chip {
  font-size: 14px; width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,0.06); border-radius: 8px;
}
.exhub-card-arrow { color: #556677; flex-shrink: 0; }
