@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@600;700;800;900&family=Poppins:wght@400;500;600&family=JetBrains+Mono:wght@400;600;700&display=swap');

/* ============================================
   Batting Average Calculator - by Yaseen
   ============================================ */

.bac-wrapper {
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 20px;
  font-family: 'Poppins', sans-serif;
  background: #ffffff;
  box-sizing: border-box;
}

/* Header */
.bac-header { text-align: center; margin-bottom: 28px; }

.bac-badge {
  display: inline-block;
  background: #ffffff;
  border: 1.5px solid #0EA5E9;
  color: #0EA5E9;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  padding: 5px 16px;
  border-radius: 100px;
  margin-bottom: 14px;
  font-family: 'Poppins', sans-serif;
}

.bac-title {
  font-family: 'Montserrat', sans-serif !important;
  font-size: 2.2rem !important;
  font-weight: 900 !important;
  color: #0f172a !important;
  margin: 0 0 10px 0 !important;
  padding: 0 !important;
  line-height: 1.1 !important;
  letter-spacing: -0.5px;
}

.bac-subtitle {
  color: #64748b;
  font-size: 0.88rem;
  margin: 0 auto !important;
  font-family: 'Poppins', sans-serif;
  max-width: 560px;
  line-height: 1.6;
}

/* Card */
.bac-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 20px;
  padding: 28px;
  margin-bottom: 20px;
  box-shadow: 0 2px 20px rgba(14,165,233,0.07);
  box-sizing: border-box;
}

/* Quick Examples */
.bac-quick-section {
  border: 1.5px dashed #cbd5e1;
  border-radius: 14px;
  padding: 18px 20px;
  margin-bottom: 24px;
  background: #fafcff;
}

.bac-quick-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: #0EA5E9;
  margin: 0 0 14px 0 !important;
  font-family: 'Poppins', sans-serif;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.bac-quick-btns { display: flex; flex-wrap: wrap; gap: 10px; }

.bac-quick-btn {
  padding: 9px 18px;
  border-radius: 8px;
  border: 1.5px solid #0EA5E9;
  background: #0EA5E9;
  color: #ffffff;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  font-family: 'Poppins', sans-serif;
}

.bac-quick-btn:hover {
  background: #0284c7;
  border-color: #0284c7;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(14,165,233,0.25);
}

/* Inputs */
.bac-inputs-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}

.bac-field { display: flex; flex-direction: column; }

.bac-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: #1e293b;
  margin-bottom: 8px !important;
  font-family: 'Poppins', sans-serif;
}

.bac-input-wrap {
  display: flex;
  align-items: center;
  background: #f8fafc;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  overflow: hidden;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.bac-input-wrap:focus-within {
  border-color: #0EA5E9;
  box-shadow: 0 0 0 4px rgba(14,165,233,0.1);
  background: #fff;
}

.bac-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  padding: 14px 16px;
  font-size: 1.4rem;
  font-weight: 700;
  font-family: 'Montserrat', sans-serif;
  color: #0f172a;
  min-width: 0;
  box-sizing: border-box;
}

.bac-input::placeholder { color: #cbd5e1; font-size: 1rem; font-weight: 400; }

.bac-input-unit {
  padding: 14px 16px;
  font-size: 0.9rem;
  font-weight: 700;
  color: #0EA5E9;
  font-family: 'Montserrat', sans-serif;
  border-left: 2px solid #e2e8f0;
  background: #f0f9ff;
}

.bac-field-hint {
  font-size: 0.72rem;
  color: #94a3b8;
  font-family: 'Poppins', sans-serif;
  margin-top: 6px;
}

/* Calculate Button */
.bac-calc-btn {
  width: 100%;
  padding: 17px;
  border-radius: 14px;
  border: none;
  background: #0EA5E9;
  color: #ffffff;
  font-family: 'Montserrat', sans-serif;
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.25s;
  box-shadow: 0 6px 22px rgba(14,165,233,0.35);
  box-sizing: border-box;
}

.bac-calc-btn:hover { background: #0284c7; transform: translateY(-2px); box-shadow: 0 10px 30px rgba(14,165,233,0.4); }
.bac-calc-btn:active { transform: translateY(0); }

/* Results */
.bac-results { box-sizing: border-box; }

.bac-result-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 20px;
  padding: 28px;
  margin-bottom: 20px;
  box-shadow: 0 2px 20px rgba(14,165,233,0.07);
  animation: bacFade 0.5s ease forwards;
}

.bac-result-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
}

.bac-results-line {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, #e2e8f0);
}
.bac-results-line:last-child { background: linear-gradient(90deg, #e2e8f0, transparent); }

.bac-results-title {
  font-family: 'Montserrat', sans-serif !important;
  font-size: 0.82rem !important;
  font-weight: 800 !important;
  color: #0EA5E9 !important;
  margin: 0 !important;
  padding: 0 !important;
  white-space: nowrap;
  letter-spacing: 1px;
  text-transform: uppercase;
}

/* Main Result */
.bac-result-main {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-bottom: 24px;
}

.bac-avg-circle {
  width: 110px;
  height: 110px;
  border-radius: 50%;
  background: #0EA5E9;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 8px 24px rgba(14,165,233,0.35);
  transition: background 0.3s;
}

.bac-avg-num {
  font-family: 'Montserrat', sans-serif;
  font-size: 1.6rem;
  font-weight: 900;
  color: #ffffff;
  line-height: 1;
}

.bac-avg-sub {
  font-size: 0.55rem;
  font-weight: 700;
  color: rgba(255,255,255,0.8);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  font-family: 'Poppins', sans-serif;
  margin-top: 4px;
}

.bac-result-right { flex: 1; }

.bac-rating-label {
  font-family: 'Montserrat', sans-serif;
  font-size: 1.6rem;
  font-weight: 900;
  color: #0EA5E9;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 8px;
  transition: color 0.3s;
}

.bac-rating-desc {
  font-size: 0.9rem;
  color: #64748b;
  font-family: 'Poppins', sans-serif;
  line-height: 1.5;
}

/* Stats Row */
.bac-stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 22px;
}

.bac-stat-box {
  background: #334155;
  border-radius: 14px;
  padding: 16px 12px;
  text-align: center;
  animation: bacPop 0.4s cubic-bezier(0.34,1.56,0.64,1) forwards;
  opacity: 0;
  transform: scale(0.85);
}

.bac-stat-num {
  font-family: 'Montserrat', sans-serif;
  font-size: 1.6rem;
  font-weight: 900;
  color: #ffffff;
  line-height: 1;
  margin-bottom: 5px;
}

.bac-stat-label {
  font-size: 0.65rem;
  color: #94a3b8;
  font-family: 'Poppins', sans-serif;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* Performance Bar */
.bac-perf-bar-section { margin-top: 4px; }

.bac-perf-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.68rem;
  font-weight: 600;
  color: #94a3b8;
  font-family: 'JetBrains Mono', monospace;
  margin-bottom: 6px;
}

.bac-perf-track {
  position: relative;
  height: 10px;
  background: #f1f5f9;
  border-radius: 5px;
  overflow: visible;
  margin-bottom: 6px;
}

.bac-perf-fill {
  height: 100%;
  border-radius: 5px;
  background: linear-gradient(90deg, #64748b, #0EA5E9, #22c55e);
  transition: width 0.6s cubic-bezier(0.4,0,0.2,1);
}

.bac-perf-marker {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 18px;
  height: 18px;
  background: #0f172a;
  border: 3px solid #ffffff;
  border-radius: 50%;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
  transition: left 0.6s cubic-bezier(0.4,0,0.2,1);
  z-index: 2;
}

.bac-perf-range-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.65rem;
  color: #94a3b8;
  font-family: 'Poppins', sans-serif;
  font-weight: 500;
}

/* Section Title */
.bac-section-title {
  font-family: 'Montserrat', sans-serif;
  font-size: 0.78rem;
  font-weight: 800;
  color: #0EA5E9;
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 16px;
}

/* Steps */
.bac-steps {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 20px;
}

.bac-step {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-left: 4px solid #0EA5E9;
  border-radius: 0 14px 14px 0;
  overflow: hidden;
  animation: bacSlide 0.4s ease forwards;
  opacity: 0;
  transform: translateX(-10px);
}

.bac-step-header {
  background: #f8fafc;
  padding: 12px 18px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid #e2e8f0;
}

.bac-step-num {
  width: 24px;
  height: 24px;
  background: #0EA5E9;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Montserrat', sans-serif;
  font-size: 0.7rem;
  font-weight: 800;
  color: #ffffff;
  flex-shrink: 0;
}

.bac-step-title {
  font-family: 'Montserrat', sans-serif;
  font-size: 0.8rem;
  font-weight: 800;
  color: #334155;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.bac-step-body {
  padding: 16px 18px;
}

.bac-formula-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 14px 18px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.9rem;
  color: #334155;
  font-weight: 600;
  line-height: 1.8;
}

/* Historical Context */
.bac-context-card {
  background: #fffbeb;
  border: 1.5px solid #fde68a;
  border-radius: 16px;
  padding: 20px 22px;
  margin-bottom: 24px;
  animation: bacFade 0.5s ease forwards;
}

.bac-context-title {
  font-family: 'Montserrat', sans-serif;
  font-size: 0.78rem;
  font-weight: 800;
  color: #92400e;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  margin-bottom: 10px;
}

.bac-context-text {
  font-size: 0.85rem;
  color: #78716c;
  font-family: 'Poppins', sans-serif;
  line-height: 1.7;
}

/* Reset */
.bac-reset-btn {
  display: block;
  margin: 0 auto;
  padding: 12px 32px;
  border-radius: 10px;
  border: 2px solid #0EA5E9;
  background: transparent;
  color: #0EA5E9;
  font-family: 'Montserrat', sans-serif;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.2s;
}

.bac-reset-btn:hover { background: #0EA5E9; color: #ffffff; }

/* Animations */
@keyframes bacFade  { from { opacity:0; transform:translateY(14px); } to { opacity:1; transform:translateY(0); } }
@keyframes bacPop   { to   { opacity:1; transform:scale(1); } }
@keyframes bacSlide { to   { opacity:1; transform:translateX(0); } }

/* Responsive */
@media (max-width: 600px) {
  .bac-inputs-row  { grid-template-columns: 1fr; }
  .bac-stats-row   { grid-template-columns: 1fr 1fr; }
  .bac-title       { font-size: 1.7rem !important; }
  .bac-result-main { flex-direction: column; text-align: center; }
  .bac-avg-circle  { margin: 0 auto; }
  .bac-card        { padding: 18px; }
  .bac-result-card { padding: 18px; }
}
