/* ===== MAGESTIS SPORT AI PLATFORM ===== */

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

:root {
  --navy: #1a1a2e;
  --navy-light: #16213e;
  --teal: #4361ee;
  --teal-light: #5a7df7;
  --teal-glow: rgba(67, 97, 238, 0.12);
  --white: #FFFFFF;
  --off-white: #F5F6FA;
  --gray-light: #E4E7F0;
  --gray: #6B7B8D;
  --gray-dark: #4A5568;
  --gold: #C9A96E;
  --green: #10B981;
  --green-light: #D1FAE5;
  --orange: #F59E0B;
  --orange-light: #FEF3C7;
  --red: #EF4444;
  --red-light: #FEE2E2;
  --purple: #8B5CF6;
  --purple-light: #EDE9FE;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --max-width: 1200px;
  --transition: 0.3s ease;
  --radius: 12px;
  --shadow: 0 4px 20px rgba(26, 26, 46, 0.08);
  --shadow-lg: 0 12px 40px rgba(26, 26, 46, 0.12);
}

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

body {
  font-family: var(--font);
  color: var(--navy-light);
  line-height: 1.6;
  background: var(--off-white);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--teal); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--teal-light); }

h1, h2, h3, h4 { font-weight: 700; color: var(--navy); line-height: 1.3; }
h1 { font-size: 2.5rem; }
h2 { font-size: 1.75rem; }
h3 { font-size: 1.25rem; }
p { margin-bottom: 0.75rem; }

.container { max-width: var(--max-width); margin: 0 auto; padding: 0 2rem; }

/* --- Platform Header --- */
.platform-header {
  background: var(--navy);
  border-bottom: 1px solid rgba(255,255,255,0.08);
  position: sticky;
  top: 0;
  z-index: 100;
}

.platform-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 2rem;
}

.platform-logo {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--white);
}

.platform-logo span { color: var(--teal-light); }
.platform-logo small { font-size: 0.7rem; font-weight: 400; color: rgba(255,255,255,0.5); margin-left: 0.5rem; text-transform: uppercase; letter-spacing: 0.1em; }

.platform-nav-links {
  display: flex;
  gap: 0.25rem;
  list-style: none;
}

.platform-nav-links a {
  color: rgba(255,255,255,0.65);
  font-size: 0.82rem;
  font-weight: 500;
  padding: 0.4rem 0.75rem;
  border-radius: 6px;
  transition: all var(--transition);
}

.platform-nav-links a:hover,
.platform-nav-links a.active {
  color: var(--white);
  background: rgba(255,255,255,0.08);
}

.nav-toggle-platform {
  display: none;
  flex-direction: column;
  gap: 4px;
  cursor: pointer;
}

.nav-toggle-platform span {
  width: 20px;
  height: 2px;
  background: var(--white);
}

/* --- Page Hero --- */
.page-hero {
  background: linear-gradient(135deg, var(--navy) 0%, #1a3a5c 100%);
  padding: 3rem 0;
  color: var(--white);
}

.page-hero h1 { color: var(--white); margin-bottom: 0.5rem; }
.page-hero p { color: rgba(255,255,255,0.7); font-size: 1.05rem; max-width: 600px; }

/* --- Tool Cards Grid --- */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.5rem;
  padding: 2rem 0;
}

.tool-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 2rem;
  border: 1px solid var(--gray-light);
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}

.tool-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-color: var(--teal);
}

.tool-card-icon {
  width: 48px;
  height: 48px;
  background: var(--teal-glow);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.25rem;
  color: var(--teal);
}

.tool-card h3 { margin-bottom: 0.5rem; }
.tool-card p { color: var(--gray); font-size: 0.9rem; margin-bottom: 1.25rem; }

.tool-card-tag {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.25rem 0.6rem;
  border-radius: 4px;
  background: var(--teal-glow);
  color: var(--teal);
}

.tool-card-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 1rem;
  font-weight: 600;
  font-size: 0.9rem;
}

/* --- Content Panel --- */
.content-panel {
  background: var(--white);
  border-radius: var(--radius);
  border: 1px solid var(--gray-light);
  padding: 2rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow);
}

.content-panel h2 { margin-bottom: 1rem; }
.content-panel h3 { margin-bottom: 0.75rem; }

/* --- Forms --- */
.form-section {
  margin-bottom: 2rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--gray-light);
}

.form-section:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.form-section h3 { margin-bottom: 1rem; color: var(--navy); }

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}

.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--navy);
  margin-bottom: 0.4rem;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 0.7rem 0.9rem;
  border: 1px solid var(--gray-light);
  border-radius: 8px;
  font-family: var(--font);
  font-size: 0.9rem;
  transition: border-color var(--transition);
  background: var(--white);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 3px var(--teal-glow);
}

.form-group textarea { min-height: 80px; resize: vertical; }

.form-group .hint {
  font-size: 0.75rem;
  color: var(--gray);
  margin-top: 0.3rem;
}

/* --- Range slider --- */
.range-group {
  margin-bottom: 1.25rem;
}

.range-group label {
  display: flex;
  justify-content: space-between;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--navy);
  margin-bottom: 0.5rem;
}

.range-group label span {
  color: var(--teal);
  font-weight: 700;
}

.range-group input[type="range"] {
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: var(--gray-light);
  outline: none;
  -webkit-appearance: none;
}

.range-group input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--teal);
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(15, 124, 123, 0.3);
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 8px;
  font-family: var(--font);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
}

.btn-primary {
  background: var(--teal);
  color: var(--white);
}

.btn-primary:hover {
  background: var(--teal-light);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(15, 124, 123, 0.3);
}

.btn-secondary {
  background: var(--off-white);
  color: var(--navy);
  border: 1px solid var(--gray-light);
}

.btn-secondary:hover {
  background: var(--gray-light);
}

.btn-lg {
  padding: 1rem 2rem;
  font-size: 1rem;
}

/* --- Results Panel --- */
.results-panel {
  display: none;
  margin-top: 2rem;
  animation: fadeIn 0.5s ease;
}

.results-panel.visible { display: block; }

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

/* --- Score Display --- */
.score-display {
  text-align: center;
  padding: 2rem;
  background: linear-gradient(135deg, var(--navy) 0%, #1a3a5c 100%);
  border-radius: var(--radius);
  color: var(--white);
  margin-bottom: 1.5rem;
}

.score-circle {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  border: 6px solid rgba(255,255,255,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
  position: relative;
}

.score-circle::after {
  content: '';
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 6px solid var(--teal-light);
  border-right-color: transparent;
  border-bottom-color: transparent;
}

.score-circle .score-value {
  font-size: 2.5rem;
  font-weight: 800;
}

.score-circle .score-max {
  font-size: 0.9rem;
  color: rgba(255,255,255,0.6);
}

.score-label {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.score-sublabel {
  color: rgba(255,255,255,0.6);
  font-size: 0.85rem;
}

/* --- Metrics Grid --- */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.metric-card {
  background: var(--off-white);
  border-radius: 10px;
  padding: 1.25rem;
  text-align: center;
}

.metric-card .metric-value {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--navy);
}

.metric-card .metric-label {
  font-size: 0.75rem;
  color: var(--gray);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 0.25rem;
}

.metric-card.metric--green { border-left: 4px solid var(--green); }
.metric-card.metric--orange { border-left: 4px solid var(--orange); }
.metric-card.metric--teal { border-left: 4px solid var(--teal); }
.metric-card.metric--purple { border-left: 4px solid var(--purple); }

/* --- Progress Bars --- */
.progress-list { list-style: none; }

.progress-item {
  margin-bottom: 1rem;
}

.progress-item-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  margin-bottom: 0.4rem;
}

.progress-item-header .label { font-weight: 600; color: var(--navy); }
.progress-item-header .value { color: var(--teal); font-weight: 700; }

.progress-bar {
  height: 8px;
  background: var(--gray-light);
  border-radius: 4px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--teal), var(--teal-light));
  transition: width 0.8s ease;
}

/* --- Recommendation Cards --- */
.recommendation {
  display: flex;
  gap: 1rem;
  padding: 1rem;
  background: var(--off-white);
  border-radius: 10px;
  margin-bottom: 0.75rem;
  border-left: 4px solid var(--teal);
}

.recommendation.rec--warning { border-left-color: var(--orange); }
.recommendation.rec--success { border-left-color: var(--green); }
.recommendation.rec--info { border-left-color: var(--purple); }

.recommendation-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: var(--teal-glow);
  color: var(--teal);
}

.recommendation-content h4 { font-size: 0.9rem; margin-bottom: 0.25rem; }
.recommendation-content p { font-size: 0.82rem; color: var(--gray); margin: 0; }

/* --- Data Table --- */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.data-table thead { background: var(--off-white); }

.data-table th {
  padding: 0.75rem 1rem;
  text-align: left;
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--gray);
}

.data-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--gray-light);
}

.data-table tr:hover td { background: var(--off-white); }

.badge {
  display: inline-block;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
}

.badge--green { background: var(--green-light); color: #065F46; }
.badge--orange { background: var(--orange-light); color: #92400E; }
.badge--red { background: var(--red-light); color: #991B1B; }
.badge--purple { background: var(--purple-light); color: #5B21B6; }

/* --- Tabs --- */
.tabs {
  display: flex;
  gap: 0.25rem;
  border-bottom: 2px solid var(--gray-light);
  margin-bottom: 1.5rem;
}

.tab-btn {
  padding: 0.6rem 1.25rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--gray);
  background: none;
  border: none;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all var(--transition);
}

.tab-btn:hover { color: var(--navy); }
.tab-btn.active { color: var(--teal); border-bottom-color: var(--teal); }

.tab-content { display: none; }
.tab-content.active { display: block; animation: fadeIn 0.3s ease; }

/* --- Output Box --- */
.output-box {
  background: var(--navy);
  border-radius: 10px;
  padding: 1.5rem;
  color: rgba(255,255,255,0.85);
  font-size: 0.88rem;
  line-height: 1.7;
  margin-top: 1rem;
  font-family: 'SF Mono', 'Fira Code', monospace;
  white-space: pre-wrap;
  max-height: 400px;
  overflow-y: auto;
}

/* --- Loading Indicator --- */
.loading {
  display: none;
  text-align: center;
  padding: 2rem;
}

.loading.visible { display: block; }

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--gray-light);
  border-top-color: var(--teal);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 1rem;
}

@keyframes spin { to { transform: rotate(360deg); } }

.loading p { color: var(--gray); font-size: 0.9rem; }

/* --- Page Layout --- */
.page-content {
  padding: 2rem 0 4rem;
}

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

/* --- Icon utility --- */
.icon {
  width: 24px;
  height: 24px;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
  flex-shrink: 0;
}

.icon--sm { width: 18px; height: 18px; }
.icon--lg { width: 32px; height: 32px; }

/* --- Footer --- */
.platform-footer {
  background: var(--navy);
  color: rgba(255,255,255,0.5);
  padding: 2rem;
  text-align: center;
  font-size: 0.82rem;
}

.platform-footer a { color: var(--teal-light); }

/* --- Responsive --- */
@media (max-width: 768px) {
  .platform-nav-links { display: none; position: absolute; top: 64px; left: 0; right: 0; background: var(--navy); flex-direction: column; padding: 1rem; gap: 0.5rem; border-top: 1px solid rgba(255,255,255,0.1); }
  .platform-nav-links.active { display: flex; }
  .nav-toggle-platform { display: flex; }
  .form-row { grid-template-columns: 1fr; }
  .two-col { grid-template-columns: 1fr; }
  .tools-grid { grid-template-columns: 1fr; }
  h1 { font-size: 1.8rem; }
  .metrics-grid { grid-template-columns: 1fr 1fr; }
}
