/* 
  Liga Metropolitana de Béisbol (LMB) Buenos Aires
  Modern Material Design 3 Pro Design System & Compact Mobile CSS
*/

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700;800;900&family=Roboto:ital,wght@0,400;0,500;0,700;1,400&display=swap');
@import url('https://fonts.googleapis.com/icon?family=Material+Icons+Round');

:root {
  --lmb-navy-dark: #070D1B;
  --lmb-navy-surface: #0F172A;
  --lmb-navy-card: #1E293B;
  --lmb-navy-card-hover: #334155;
  
  --lmb-blue-primary: #3B82F6;
  --lmb-blue-glow: #60A5FA;
  --lmb-red-accent: #EF4444;
  --lmb-gold-accent: #F59E0B;
  --lmb-green-status: #10B981;
  
  --md-sys-color-background: #070D1B;
  --md-sys-color-surface: #0F172A;
  --md-sys-color-surface-variant: #1E293B;
  --md-sys-color-on-surface: #F8FAFC;
  --md-sys-color-on-surface-variant: #94A3B8;
  --md-sys-color-outline: rgba(255, 255, 255, 0.1);
  
  --radius-xs: 6px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-full: 9999px;
  
  --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.45);
  
  --max-app-width: 768px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: radial-gradient(circle at 50% 0%, #1E293B 0%, #070D1B 70%);
  color: var(--md-sys-color-on-surface);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  overflow-x: hidden;
  line-height: 1.4;
}

/* Strict Text Truncation Rule */
.text-truncate {
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  display: block;
  max-width: 100%;
}

.inline-truncate {
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  display: inline-block;
  vertical-align: middle;
  max-width: 120px;
}

/* Master Outer Container (Max 768px Fluid) */
#app-container {
  width: 100%;
  max-width: var(--max-app-width);
  min-height: 100vh;
  background-color: var(--lmb-navy-surface);
  display: flex;
  flex-direction: column;
  position: relative;
  box-shadow: 0 0 60px rgba(0, 0, 0, 0.9), 0 0 0 1px rgba(255, 255, 255, 0.08);
  padding-bottom: 76px;
}

/* Top App Header */
.md-top-app-bar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--md-sys-color-outline);
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.brand-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  min-width: 0;
  flex: 1;
}

.brand-logo {
  width: 36px;
  height: 36px;
  min-width: 36px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--lmb-gold-accent);
}

.brand-title {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.brand-title h1 {
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: -0.3px;
  color: #FFFFFF;
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.brand-title span {
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--lmb-gold-accent);
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* Scorebug Ticker Carousel (MLB Style) */
.scorebug-container {
  background: rgba(7, 13, 27, 0.95);
  border-bottom: 1px solid var(--md-sys-color-outline);
  padding: 8px 12px;
  overflow-x: auto;
  scrollbar-width: none;
  display: flex;
  gap: 10px;
}

.scorebug-container::-webkit-scrollbar {
  display: none;
}

.scorebug-card {
  min-width: 155px;
  max-width: 185px;
  background: var(--lmb-navy-card);
  border: 1px solid var(--md-sys-color-outline);
  border-radius: var(--radius-sm);
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  cursor: pointer;
}

.scorebug-card.live {
  border-color: var(--lmb-red-accent);
}

.scorebug-status {
  font-size: 0.62rem;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--md-sys-color-on-surface-variant);
  display: flex;
  justify-content: space-between;
  gap: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.scorebug-team-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  font-size: 0.8rem;
  font-weight: 700;
}

.scorebug-team-name {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.scorebug-logo {
  width: 20px;
  height: 20px;
  min-width: 20px;
  border-radius: 50%;
  object-fit: cover;
}

.scorebug-score {
  font-family: 'Roboto', sans-serif;
  font-size: 1rem;
  font-weight: 800;
  color: #FFFFFF;
}

/* Category Filter Chips */
.md-chip-group {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 8px 12px 2px 12px;
  scrollbar-width: none;
}

.md-chip-group::-webkit-scrollbar {
  display: none;
}

.md-chip {
  padding: 5px 12px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
  background: var(--lmb-navy-card);
  color: var(--md-sys-color-on-surface-variant);
  border: 1px solid var(--md-sys-color-outline);
  cursor: pointer;
  white-space: nowrap;
}

.md-chip.active {
  background: var(--lmb-blue-primary);
  color: #FFFFFF;
  border-color: var(--lmb-blue-primary);
}

/* Main Dynamic View Content */
.view-content {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.view-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.section-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: #FFFFFF;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Material Cards */
.md-card {
  background: var(--lmb-navy-card);
  border-radius: var(--radius-md);
  border: 1px solid var(--md-sys-color-outline);
  padding: 12px 14px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
  overflow: hidden;
}

.md-card-interactive {
  cursor: pointer;
}

/* Material Buttons */
.md-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--radius-full);
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  min-height: 40px;
  white-space: nowrap;
}

.md-btn-primary {
  background: linear-gradient(135deg, var(--lmb-blue-primary) 0%, #1D4ED8 100%);
  color: #FFFFFF;
}

.md-btn-danger {
  background: linear-gradient(135deg, var(--lmb-red-accent) 0%, #B91C1C 100%);
  color: #FFFFFF;
}

.md-btn-outlined {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--md-sys-color-outline);
  color: var(--md-sys-color-on-surface);
}

.md-btn-gold {
  background: linear-gradient(135deg, #F59E0B 0%, #D97706 100%);
  color: #000000;
}

/* Tables (Standings & Box Scores) */
.md-table-wrapper {
  width: 100%;
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--md-sys-color-outline);
  background: var(--lmb-navy-card);
  -webkit-overflow-scrolling: touch;
}

.md-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
  text-align: left;
}

.md-table th {
  background: rgba(7, 13, 27, 0.9);
  color: var(--lmb-gold-accent);
  font-weight: 800;
  padding: 8px 10px;
  text-transform: uppercase;
  font-size: 0.68rem;
  letter-spacing: 0.4px;
  border-bottom: 1px solid var(--md-sys-color-outline);
  white-space: nowrap;
}

.md-table td {
  padding: 8px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  color: var(--md-sys-color-on-surface);
  white-space: nowrap;
}

.md-table tr:last-child td {
  border-bottom: none;
}

.md-table tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.015);
}

.highlight-val {
  font-weight: 800;
  color: var(--lmb-gold-accent);
}

/* Modal Controls */
.md-modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 300;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.md-modal-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.md-bottom-sheet {
  width: 100%;
  max-width: var(--max-app-width);
  background: var(--lmb-navy-surface);
  border-top-left-radius: var(--radius-lg);
  border-top-right-radius: var(--radius-lg);
  padding: 16px;
  max-height: 90vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  border-top: 1px solid var(--md-sys-color-outline);
}

.md-modal-backdrop.open .md-bottom-sheet {
  transform: translateY(0);
}

.sheet-handle {
  width: 40px;
  height: 4px;
  background: var(--md-sys-color-outline);
  border-radius: 99px;
  margin: 0 auto 8px auto;
}

/* Forms */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.form-group label {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--md-sys-color-on-surface-variant);
  text-transform: uppercase;
}

.form-control {
  width: 100%;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: rgba(7, 13, 27, 0.8);
  border: 1px solid var(--md-sys-color-outline);
  color: #FFFFFF;
  font-family: inherit;
  font-size: 0.88rem;
}

.form-control:focus {
  outline: none;
  border-color: var(--lmb-blue-primary);
}

/* Bottom Navigation Bar */
.md-bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: var(--max-app-width);
  height: 65px;
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--md-sys-color-outline);
  display: flex;
  justify-content: space-around;
  align-items: center;
  z-index: 200;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  background: transparent;
  border: none;
  color: var(--md-sys-color-on-surface-variant);
  font-family: inherit;
  font-size: 0.7rem;
  font-weight: 700;
  cursor: pointer;
  padding: 6px 10px;
  border-radius: var(--radius-md);
}

.nav-item .material-icons-round {
  font-size: 22px;
}

.nav-item.active {
  color: var(--lmb-gold-accent);
}

.nav-item.active .material-icons-round {
  color: var(--lmb-gold-accent);
}

/* Photos Grid */
.photo-gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.photo-gallery-item {
  width: 100%;
  aspect-ratio: 1;
  border-radius: var(--radius-sm);
  object-fit: cover;
  border: 1px solid var(--md-sys-color-outline);
}
