/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-tap-highlight-color: transparent; }
body { font-family: 'Segoe UI', Roboto, Arial, sans-serif; background: #0d1b2a; color: #e8eaf6; min-height: 100vh; }

/* ===== LANDING PAGE ===== */
.landing-header {
  background: linear-gradient(135deg, #0d47a1 0%, #1565c0 50%, #1976d2 100%);
  padding: 32px 20px 24px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.landing-header::before {
  content: '';
  position: absolute; inset: 0;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='60' height='60'%3E%3Ccircle cx='30' cy='30' r='20' fill='none' stroke='rgba(255,255,255,0.05)' stroke-width='1'/%3E%3C/svg%3E") repeat;
  pointer-events: none;
}
.app-logo { font-size: 48px; margin-bottom: 8px; }
.app-title { font-size: 28px; font-weight: 800; color: white; letter-spacing: -0.5px; }
.app-subtitle { font-size: 14px; color: rgba(255,255,255,0.8); margin-top: 4px; }

.hero-stats {
  display: flex; justify-content: center; gap: 32px;
  padding: 20px; background: rgba(255,255,255,0.06);
  border-bottom: 1px solid rgba(255,255,255,0.1);
}
.stat-item { text-align: center; }
.stat-number { font-size: 28px; font-weight: 700; color: #64b5f6; }
.stat-label { font-size: 11px; color: rgba(255,255,255,0.6); text-transform: uppercase; letter-spacing: 1px; }

.scan-btn {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  background: linear-gradient(135deg, #00e5ff, #1976d2);
  color: white; text-decoration: none; font-size: 18px; font-weight: 700;
  padding: 18px 40px; margin: 24px auto; border-radius: 50px;
  max-width: 320px; box-shadow: 0 8px 32px rgba(0,229,255,0.3);
  transition: all 0.3s ease; border: none; cursor: pointer;
}
.scan-btn:hover { transform: translateY(-2px); box-shadow: 0 12px 40px rgba(0,229,255,0.4); }
.scan-btn .btn-icon { font-size: 24px; }

.section-title {
  font-size: 14px; font-weight: 700; text-transform: uppercase; letter-spacing: 2px;
  color: #64b5f6; padding: 20px 20px 12px;
}

.gaya-filter {
  display: flex; gap: 8px; padding: 0 20px 16px; overflow-x: auto;
  scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.gaya-filter::-webkit-scrollbar { display: none; }
.filter-btn {
  flex-shrink: 0; padding: 8px 16px; border-radius: 20px; border: 1.5px solid rgba(255,255,255,0.2);
  background: rgba(255,255,255,0.05); color: rgba(255,255,255,0.7); font-size: 13px; cursor: pointer;
  transition: all 0.2s ease;
}
.filter-btn.active { background: #1565c0; border-color: #1565c0; color: white; }
.filter-btn:hover:not(.active) { background: rgba(255,255,255,0.1); }

.exercise-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px; padding: 0 16px 24px;
}

.exercise-card {
  background: rgba(255,255,255,0.07); border-radius: 16px; overflow: hidden;
  border: 1px solid rgba(255,255,255,0.1); cursor: pointer;
  transition: all 0.3s ease; text-decoration: none; color: inherit;
}
.exercise-card:hover { transform: translateY(-4px); background: rgba(255,255,255,0.12); border-color: rgba(255,255,255,0.25); }

.card-header {
  height: 80px; display: flex; align-items: center; justify-content: center;
  position: relative; overflow: hidden;
}
.card-model { font-size: 11px; font-weight: 700; color: rgba(255,255,255,0.8); letter-spacing: 1px; position: absolute; top: 10px; left: 12px; }
.card-number { font-size: 44px; font-weight: 900; color: rgba(255,255,255,0.2); }
.card-icon { font-size: 32px; position: absolute; bottom: 8px; right: 12px; }
.card-body { padding: 12px; }
.card-name { font-size: 13px; font-weight: 600; line-height: 1.35; color: white; }
.card-gaya { font-size: 11px; color: rgba(255,255,255,0.5); margin-top: 4px; text-transform: capitalize; }
.card-arrow { font-size: 16px; color: rgba(255,255,255,0.4); margin-top: 8px; text-align: right; }

/* ===== AR UI OVERLAY ===== */
.ar-page { position: fixed; inset: 0; background: black; overflow: hidden; }
.ar-page a-scene { width: 100vw; height: 100vh; }

#ar-loading {
  position: fixed; inset: 0; background: #0d1b2a; z-index: 9999;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 20px;
}
#ar-loading .loading-logo { font-size: 64px; animation: pulse 1.5s ease-in-out infinite; }
#ar-loading .loading-title { font-size: 22px; font-weight: 700; color: white; }
#ar-loading .loading-sub { font-size: 14px; color: rgba(255,255,255,0.6); text-align: center; padding: 0 32px; }
.progress-bar-wrap { width: 280px; height: 8px; background: rgba(255,255,255,0.15); border-radius: 4px; overflow: hidden; }
.progress-bar { height: 100%; background: linear-gradient(90deg, #00e5ff, #1976d2); border-radius: 4px; transition: width 0.3s ease; width: 0%; }
#loading-percent { font-size: 13px; color: #64b5f6; font-weight: 600; }

@keyframes pulse { 0%,100%{transform:scale(1)} 50%{transform:scale(1.1)} }

#ar-ui {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 100;
  display: flex; justify-content: center; padding: 16px 20px 28px;
  gap: 16px; pointer-events: none;
}

.ar-btn {
  width: 56px; height: 56px; border-radius: 50%; border: 2px solid rgba(255,255,255,0.4);
  background: rgba(0,0,0,0.55); backdrop-filter: blur(8px);
  color: white; font-size: 22px; cursor: pointer; pointer-events: all;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s ease; box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}
.ar-btn:hover, .ar-btn:active { background: rgba(21,101,192,0.8); border-color: #64b5f6; transform: scale(1.1); }
.ar-btn.active { background: rgba(21,101,192,0.9); border-color: #00e5ff; }

#ar-back {
  position: fixed; top: 16px; left: 16px; z-index: 100;
  background: rgba(0,0,0,0.55); backdrop-filter: blur(8px);
  border: 2px solid rgba(255,255,255,0.3); border-radius: 50%;
  width: 48px; height: 48px; color: white; font-size: 20px;
  display: flex; align-items: center; justify-content: center;
  text-decoration: none; cursor: pointer; transition: all 0.2s ease;
}
#ar-back:hover { background: rgba(255,255,255,0.2); }

#target-indicator {
  position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%);
  pointer-events: none; z-index: 50; text-align: center;
}
.scan-frame {
  width: 200px; height: 200px; margin: 0 auto;
  border: 3px solid rgba(255,255,255,0.6);
  border-radius: 16px; position: relative;
  animation: scan-pulse 2s ease-in-out infinite;
}
.scan-frame::before, .scan-frame::after {
  content: ''; position: absolute;
  width: 30px; height: 30px; border-color: #00e5ff; border-style: solid;
}
.scan-frame::before { top: -3px; left: -3px; border-width: 4px 0 0 4px; border-radius: 8px 0 0 0; }
.scan-frame::after { bottom: -3px; right: -3px; border-width: 0 4px 4px 0; border-radius: 0 0 8px 0; }
.scan-hint { color: rgba(255,255,255,0.8); font-size: 14px; margin-top: 16px; text-shadow: 0 2px 8px rgba(0,0,0,0.8); }
@keyframes scan-pulse { 0%,100%{opacity:0.8;transform:scale(1)} 50%{opacity:1;transform:scale(1.03)} }

#model-label {
  position: fixed; top: 16px; left: 50%; transform: translateX(-50%);
  background: rgba(0,0,0,0.6); backdrop-filter: blur(8px);
  color: white; padding: 8px 20px; border-radius: 20px;
  font-size: 14px; font-weight: 600; z-index: 100;
  border: 1px solid rgba(255,255,255,0.2);
  display: none; white-space: nowrap;
}

/* ===== INFO PANEL ===== */
#info-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(0,0,0,0.75); backdrop-filter: blur(4px);
  display: flex; align-items: flex-end; justify-content: center;
  opacity: 0; pointer-events: none; transition: opacity 0.3s ease;
}
#info-overlay.show { opacity: 1; pointer-events: all; }

#info-panel {
  background: #1a237e; border-radius: 24px 24px 0 0;
  width: 100%; max-width: 600px; max-height: 75vh;
  padding: 20px; overflow-y: auto; transform: translateY(100%);
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  border-top: 3px solid #3949ab;
}
#info-overlay.show #info-panel { transform: translateY(0); }

.panel-handle { width: 40px; height: 4px; background: rgba(255,255,255,0.3); border-radius: 2px; margin: 0 auto 16px; }
.panel-close {
  position: absolute; top: 16px; right: 16px;
  background: rgba(255,255,255,0.15); border: none; color: white;
  width: 36px; height: 36px; border-radius: 50%; font-size: 18px;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.panel-close:hover { background: rgba(255,255,255,0.25); }

.info-model-tag { font-size: 12px; color: #90caf9; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; }
.info-title { font-size: 22px; font-weight: 800; color: white; margin: 6px 0 16px; line-height: 1.2; }

.info-section { margin-bottom: 16px; }
.info-section-title {
  font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px;
  color: #64b5f6; margin-bottom: 8px;
}
.info-list { list-style: none; }
.info-list li {
  display: flex; gap: 10px; align-items: flex-start;
  font-size: 14px; color: rgba(255,255,255,0.85); line-height: 1.5; margin-bottom: 8px;
}
.info-list li::before { content: ''; flex-shrink: 0; width: 6px; height: 6px; border-radius: 50%; background: #64b5f6; margin-top: 7px; }
.info-list.numbered li::before { content: counter(li-counter); counter-increment: li-counter; width: 20px; height: 20px; background: #1565c0; border-radius: 50%; font-size: 11px; font-weight: 700; color: white; display: flex; align-items: center; justify-content: center; margin-top: 0; flex-shrink: 0; }
.info-list.numbered { counter-reset: li-counter; }

.equipment-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.chip { background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.2); border-radius: 20px; padding: 4px 12px; font-size: 12px; color: rgba(255,255,255,0.8); }

/* ===== EXERCISE DETAIL PAGE ===== */
.detail-page { min-height: 100vh; }
.detail-hero { padding: 80px 20px 32px; text-align: center; }
.detail-model { font-size: 13px; font-weight: 700; letter-spacing: 2px; margin-bottom: 8px; opacity: 0.8; }
.detail-title { font-size: 26px; font-weight: 800; color: white; line-height: 1.2; }
.detail-gaya-badge { display: inline-block; margin-top: 12px; padding: 4px 16px; border-radius: 20px; font-size: 13px; font-weight: 600; background: rgba(255,255,255,0.15); }

.detail-section { background: rgba(255,255,255,0.05); border-radius: 16px; margin: 0 16px 16px; padding: 20px; border: 1px solid rgba(255,255,255,0.1); }
.detail-section-header { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.detail-section-icon { font-size: 20px; }
.detail-section-label { font-size: 16px; font-weight: 700; color: white; }

.ar-try-btn {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  background: linear-gradient(135deg, #00e5ff, #1976d2);
  color: white; text-decoration: none; font-size: 16px; font-weight: 700;
  padding: 16px 32px; margin: 8px 16px 32px; border-radius: 50px;
  box-shadow: 0 6px 24px rgba(0,229,255,0.25); border: none; cursor: pointer;
  transition: all 0.3s ease;
}
.ar-try-btn:hover { transform: translateY(-2px); box-shadow: 0 10px 32px rgba(0,229,255,0.35); }

/* ===== PRINT MARKERS PAGE ===== */
.print-page { background: white; color: #333; }
.print-page .print-header { background: #1565c0; color: white; padding: 24px; text-align: center; }
.print-page h1 { font-size: 24px; font-weight: 800; }
.print-page p { font-size: 14px; opacity: 0.85; margin-top: 4px; }
.markers-print-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; padding: 24px; }
.marker-print-card { border: 2px solid #e0e0e0; border-radius: 12px; overflow: hidden; text-align: center; }
.marker-print-card img { width: 100%; aspect-ratio: 1; display: block; }
.marker-print-label { padding: 8px; font-size: 11px; font-weight: 600; color: #555; background: #f5f5f5; }
@media print {
  .print-hide { display: none !important; }
  .markers-print-grid { grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 16px; }
  body { background: white; }
  .print-page .print-header { background: #1565c0 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* ===== COMPILE PAGE ===== */
.compile-page {
  min-height: 100vh; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 24px; padding: 40px 20px;
  background: linear-gradient(135deg, #0d1b2a, #1a237e);
}
.compile-card {
  background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.15);
  border-radius: 24px; padding: 32px; width: 100%; max-width: 480px; text-align: center;
}
.compile-title { font-size: 22px; font-weight: 800; color: white; margin-bottom: 8px; }
.compile-sub { font-size: 14px; color: rgba(255,255,255,0.6); margin-bottom: 24px; }
.compile-progress { width: 100%; height: 10px; background: rgba(255,255,255,0.1); border-radius: 5px; overflow: hidden; margin-bottom: 8px; }
.compile-bar { height: 100%; background: linear-gradient(90deg, #00e5ff, #1976d2); border-radius: 5px; width: 0%; transition: width 0.5s ease; }
.compile-percent { font-size: 28px; font-weight: 700; color: #64b5f6; }
.compile-status { font-size: 13px; color: rgba(255,255,255,0.5); margin-top: 8px; }
.compile-done { display: none; }
.compile-done-btn {
  background: linear-gradient(135deg, #00e5ff, #1976d2); color: white;
  border: none; border-radius: 50px; padding: 16px 40px; font-size: 16px;
  font-weight: 700; cursor: pointer; margin-top: 16px; text-decoration: none;
  display: inline-block;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 400px) {
  .exercise-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .app-title { font-size: 22px; }
}
@media (min-width: 768px) {
  .exercise-grid { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
  .scan-btn { max-width: 360px; }
}
