/* Modern Baseball Theme Styling */

:root {
  --baseball-navy: #0d2240;
  --baseball-red: #ba122b;
  --baseball-cream: #faf9f6;
  --border-subtle: #e2e8f0;
  --text-main: #2d3748;
}

body {
  color: var(--text-main);
  background-color: #f5f7fb;
  /* Organic Aurora glow orbs: fluid, multi-point color blurs */
  background-image: 
    radial-gradient(at 10% 20%, rgba(186, 18, 43, 0.12) 0px, transparent 50%),
    radial-gradient(at 85% 15%, rgba(13, 34, 64, 0.14) 0px, transparent 50%),
    radial-gradient(at 50% 60%, rgba(30, 90, 160, 0.10) 0px, transparent 55%),
    radial-gradient(at 80% 85%, rgba(186, 18, 43, 0.08) 0px, transparent 50%),
    radial-gradient(at 20% 90%, rgba(13, 34, 64, 0.10) 0px, transparent 50%);
  background-attachment: fixed;
  background-size: 100% 100%;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.65;
}

/* Polished Baseball Navy Navigation Bar */
.navbar {
  background: linear-gradient(135deg, #0d2240 0%, #163664 100%) !important;
  border-bottom: 3px solid var(--baseball-red);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
}

.navbar-brand {
  font-weight: 700;
  letter-spacing: 0.5px;
  color: #ffffff !important;
}

.navbar .nav-link {
  color: #e2e8f0 !important;
  font-weight: 500;
  transition: all 0.2s ease;
  padding: 0.5rem 0.9rem !important;
  border-radius: 6px;
}

.navbar .nav-link:hover {
  color: #ffffff !important;
  background-color: rgba(255, 255, 255, 0.1);
}

.navbar .nav-link.active {
  color: #ffffff !important;
  background-color: rgba(186, 18, 43, 0.35);
  font-weight: 600;
}

/* Frosted Glass Floating Content */
#quarto-document-content {
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  padding: 2.5rem 3rem;
  border-radius: 20px;
  box-shadow: 0 10px 30px rgba(13, 34, 64, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.7);
  margin-top: 1.5rem;
  margin-bottom: 2.5rem;
}

/* Typography & Headings */
h1, h2, h3, h4 {
  color: var(--baseball-navy);
  font-weight: 700;
}

h1.title {
  border-bottom: 2px solid #eef2f6;
  padding-bottom: 0.6rem;
  margin-bottom: 1.5rem;
}

h2 {
  margin-top: 2rem;
  margin-bottom: 1rem;
  position: relative;
  padding-left: 0.75rem;
  border-left: 4px solid var(--baseball-red);
}

/* Responsive Graph Containers */
.graph-container {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow: visible;
  margin: 1.5rem 0;
}

.graph-container .cell-output-display {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow: visible;
}

.selectize-dropdown {
  z-index: 1050 !important;
}

/* Clean Plot & Widget Containers - seamless and transparent */
.plotly.html-widget,
.html-widget {
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
  border: none !important;
  padding: 0 !important;
  background-color: transparent !important;
  box-shadow: none !important;
  overflow: hidden !important;
}

.plotly.html-widget:hover,
.html-widget:hover {
  transform: none !important;
  box-shadow: none !important;
}

/* Broken Grid: Hero Banner with asymmetric geometry */
.hero-banner {
  background: linear-gradient(135deg, #0d2240 0%, #1a365d 60%, #ba122b 120%);
  color: #ffffff;
  padding: 2.6rem 3rem;
  border-radius: 30px 10px 30px 10px;
  margin: 1.5rem 0 2.5rem 0;
  box-shadow: 0 12px 30px rgba(13, 34, 64, 0.18);
  transform: rotate(-0.3deg);
}

.hero-banner h1 {
  color: #ffffff !important;
  margin-top: 0;
  font-size: 2.2rem;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.hero-banner p {
  color: #e2e8f0;
  font-size: 1.15rem;
  margin-bottom: 0;
}

/* Broken Grid & Overlapping Cards */
.elevated-card {
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-radius: 22px 8px 22px 8px;
  border: 1px solid rgba(255, 255, 255, 0.8);
  box-shadow: 0 8px 24px rgba(13, 34, 64, 0.07);
  padding: 1.6rem 1.8rem;
  margin: 1.5rem 0;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

/* Stagger cards across columns to break alignment */
.columns .column:first-child .elevated-card {
  transform: translateY(-8px) rotate(-0.5deg);
}

.columns .column:last-child .elevated-card {
  transform: translateY(8px) rotate(0.5deg);
}

.elevated-card:hover {
  transform: translateY(-10px) scale(1.02) !important;
  box-shadow: 0 14px 30px rgba(13, 34, 64, 0.14);
}

/* Metric Highlight Cards - broken staggered alignment */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.4rem;
  margin: 1.8rem 0 2.2rem 0;
}

.stat-box {
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 20px 8px 20px 8px;
  padding: 1.3rem 1.4rem;
  box-shadow: 0 6px 18px rgba(13, 34, 64, 0.05);
  text-align: center;
  border-top: 4px solid var(--baseball-red);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.stat-box:nth-child(even) {
  transform: translateY(8px);
}

.stat-box:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow: 0 10px 24px rgba(13, 34, 64, 0.12);
}

.stat-number {
  font-size: 2rem;
  font-weight: 800;
  color: var(--baseball-navy);
  line-height: 1.2;
}

.stat-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 0.35rem;
}

.stat-detail {
  font-size: 0.82rem;
  color: #475569;
  margin-top: 0.25rem;
}

/* Dark Mode Overrides */
body.quarto-dark {
  background-color: #0f141c;
  background-image: none;
}

body.quarto-dark #quarto-document-content {
  background: #181f2a;
  border-color: #263242;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
}

body.quarto-dark h1,
body.quarto-dark h2,
body.quarto-dark h3,
body.quarto-dark h4 {
  color: #f1f5f9;
}

body.quarto-dark .plotly.html-widget,
body.quarto-dark .html-widget {
  background-color: transparent !important;
  border: none !important;
}

body.quarto-dark .stat-box {
  background: #1e2633;
  border-color: #2b384c;
}

body.quarto-dark .stat-number {
  color: #f1f5f9;
}

body.quarto-dark .stat-label {
  color: #94a3b8;
}

body.quarto-dark .stat-detail {
  color: #cbd5e1;
}

/* Prevent double borders, double padding, and scrollbars on inner Plotly containers */
.plotly.html-widget .plot-container.plotly {
  border: none !important;
  padding: 0 !important;
  box-shadow: none !important;
  box-sizing: border-box !important;
  max-width: 100% !important;
  overflow: hidden !important;
}

.plotly.html-widget .svg-container {
  max-width: 100% !important;
  box-sizing: border-box !important;
  overflow: hidden !important;
}

.plotly.html-widget svg.main-svg {
  max-width: 100% !important;
}

@media (max-width: 768px) {
  #quarto-document-content {
    padding: 1.25rem 1rem;
  }
}

/* Subtle table & code styling */
table {
  border-radius: 8px;
  overflow: hidden;
}
