/* Crease Craft Stats - Premium Glassmorphic Design System */
@import url('https://fonts.googleapis.com/css2?family=Barlow+Condensed:wght@500;600;700&family=Barlow:wght@300;400;500;600;700;800&display=swap');

:root {
  /* Color Palette - Cyber Ice Theme */
  --bg-primary: #0B1B30;
  --bg-secondary: #0E2A47;
  --accent-cyan: #57A8D8;
  --accent-blue: #3D8BC2;
  --accent-teal: #059669;
  --accent-emerald: #10b981;
  --accent-crimson: #D22630;
  --accent-amber: #f59e0b;
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  
  /* Glassmorphism settings */
  --glass-bg: rgba(16, 23, 42, 0.65);
  --glass-border: rgba(255, 255, 255, 0.05);
  --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
  --glass-glow: 0 0 15px rgba(87, 168, 216, 0.18);

  /* Fonts */
  --font-family: 'Barlow', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  
  /* Transitions */
  --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
  font-family: var(--font-family);
  background-color: var(--bg-primary);
  background-image: 
    radial-gradient(at 0% 0%, rgba(87, 168, 216, 0.08) 0px, transparent 50%),
    radial-gradient(at 100% 100%, rgba(87, 168, 216, 0.06) 0px, transparent 50%),
    radial-gradient(at 50% 50%, rgba(16, 23, 38, 0.95) 0px, var(--bg-primary) 100%);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

/* Scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
  background: #334155;
  border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--accent-blue);
}

/* Layout Shell */
#app-shell {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding-bottom: 75px; /* space for mobile bottom navigation */
}

.main-content {
  flex: 1;
  padding: 16px;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
}

/* Header styling */
header.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  background: rgba(9, 13, 22, 0.8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--glass-border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.app-logo {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, var(--accent-cyan) 0%, var(--accent-blue) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: flex;
  align-items: center;
  gap: 8px;
}

.app-logo i {
  font-size: 20px;
  background: linear-gradient(135deg, var(--accent-cyan) 0%, var(--accent-blue) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Bottom Navigation */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 65px;
  background: rgba(16, 23, 38, 0.9);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-top: 1px solid var(--glass-border);
  display: flex;
  justify-content: space-around;
  align-items: center;
  z-index: 999;
  box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.5);
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 11px;
  font-weight: 500;
  width: 25%;
  height: 100%;
  transition: var(--transition-fast);
  cursor: pointer;
  border: none;
  background: none;
}

.nav-item i {
  font-size: 18px;
  margin-bottom: 4px;
  transition: var(--transition-fast);
}

.nav-item.active {
  color: var(--accent-cyan);
  text-shadow: 0 0 10px rgba(0, 242, 254, 0.3);
}

.nav-item.active i {
  transform: translateY(-2px);
}

/* Glassmorphism Cards */
.glass-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  box-shadow: var(--glass-shadow);
  padding: 20px;
  margin-bottom: 20px;
  transition: var(--transition-normal);
  position: relative;
  overflow: hidden;
}

.glass-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.03) 0%, transparent 100%);
  pointer-events: none;
}

.glass-card:hover {
  border-color: rgba(0, 242, 254, 0.15);
  box-shadow: var(--glass-shadow), 0 0 20px rgba(79, 172, 254, 0.05);
}

/* Typography elements */
h1 {
  font-size: 28px;
  font-weight: 800;
  margin-bottom: 8px;
  letter-spacing: -0.5px;
}

h2 {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 12px;
}

h3 {
  font-size: 16px;
  font-weight: 600;
}

p {
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.5;
}

.text-gradient {
  background: linear-gradient(135deg, var(--accent-cyan) 0%, var(--accent-blue) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Buttons System */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 12px;
  font-family: var(--font-family);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: var(--transition-fast);
  border: 1px solid transparent;
  outline: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-cyan) 0%, var(--accent-blue) 100%);
  color: #0b0f19;
  box-shadow: 0 4px 15px rgba(0, 242, 254, 0.25);
}

.btn-primary:hover {
  box-shadow: 0 4px 20px rgba(0, 242, 254, 0.4), var(--glass-glow);
  transform: translateY(-1px);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
  border-color: var(--glass-border);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.15);
}

.btn-danger {
  background: rgba(239, 68, 68, 0.15);
  color: var(--accent-crimson);
  border-color: rgba(239, 68, 68, 0.2);
}

.btn-danger:hover {
  background: rgba(239, 68, 68, 0.25);
  border-color: var(--accent-crimson);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
  border-radius: 8px;
}

.btn-block {
  width: 100%;
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 3px 8px;
  font-size: 10px;
  font-weight: 700;
  border-radius: 50px;
  text-transform: uppercase;
}

.badge-premium {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: #0b0f19;
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.3);
}

.badge-live {
  background: rgba(239, 68, 68, 0.2);
  color: var(--accent-crimson);
  border: 1px solid rgba(239, 68, 68, 0.3);
  animation: pulse 1.5s infinite;
}

/* Forms Input */
.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
  color: var(--text-secondary);
}

.form-input {
  width: 100%;
  padding: 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--glass-border);
  color: var(--text-primary);
  font-family: var(--font-family);
  font-size: 14px;
  outline: none;
  transition: var(--transition-fast);
}

.form-input:focus {
  border-color: var(--accent-cyan);
  background: rgba(255, 255, 255, 0.05);
  box-shadow: 0 0 10px rgba(0, 242, 254, 0.1);
}

.form-select {
  appearance: none;
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="%2394a3b8" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="6 9 12 15 18 9"></polyline></svg>');
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px;
  padding-right: 40px;
}

/* Flex/Grid Helper utilities */
.flex-between {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.grid-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 16px;
}

/* Animations */
@keyframes pulse {
  0% { opacity: 0.6; }
  50% { opacity: 1; }
  100% { opacity: 0.6; }
}

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

.fade-in {
  animation: slideIn var(--transition-normal) forwards;
}

/* Roster / Team Avatar */
.team-avatar {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 20px;
  color: #0b0f19;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* List Item styling */
.list-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px;
  border-bottom: 1px solid var(--glass-border);
}

.list-item:last-child {
  border-bottom: none;
}

/* Live Game Arena Styling */
.live-grid {
  display: grid;
  grid-template-columns: 3fr 2fr;
  gap: 20px;
}

@media (max-width: 900px) {
  .live-grid {
    grid-template-columns: 1fr;
  }
  
  .grid-2, .grid-3 {
    grid-template-columns: 1fr;
  }
}

/* Live Entry Stat Panel buttons */
.stat-panel-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.btn-stat-entry {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 16px 8px;
  border-radius: 14px;
  font-weight: 700;
  font-size: 11px;
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--glass-border);
  cursor: pointer;
  transition: var(--transition-fast);
}

.btn-stat-entry i {
  font-size: 22px;
  margin-bottom: 8px;
  color: var(--accent-cyan);
}

.btn-stat-entry:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--accent-cyan);
}

.btn-stat-entry.active {
  background: linear-gradient(135deg, rgba(0, 242, 254, 0.2) 0%, rgba(79, 172, 254, 0.2) 100%);
  border-color: var(--accent-cyan);
  box-shadow: 0 0 15px rgba(0, 242, 254, 0.15);
}

/* Goalie Pull Switch Banner */
.pulled-banner {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.2) 0%, rgba(0, 0, 0, 0) 100%);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Tab selector */
.tab-container {
  display: flex;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--glass-border);
  padding: 4px;
  border-radius: 12px;
  margin-bottom: 16px;
}

.tab-btn {
  flex: 1;
  padding: 8px 12px;
  border-radius: 8px;
  border: none;
  background: none;
  color: var(--text-secondary);
  font-family: var(--font-family);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-fast);
}

.tab-btn.active {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

/* Modal Popup Window */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(9, 13, 22, 0.85);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-content {
  background: var(--bg-secondary);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  padding: 24px;
  width: 90%;
  max-width: 450px;
  box-shadow: 0 20px 40px rgba(0,0,0,0.5);
  transform: translateY(20px);
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.modal-overlay.active .modal-content {
  transform: translateY(0);
}

/* Tables in main app */
.app-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 8px;
}

.app-table th, .app-table td {
  padding: 12px;
  text-align: left;
  border-bottom: 1px solid var(--glass-border);
  font-size: 13px;
}

.app-table th {
  color: var(--text-secondary);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.5px;
}

.app-table tr:hover td {
  background: rgba(255, 255, 255, 0.01);
}

/* Lineup indicator lights */
.lineup-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 6px;
  background: var(--text-muted);
}
.lineup-dot.active {
  background: var(--accent-emerald);
  box-shadow: 0 0 8px var(--accent-emerald);
}

/* Responsive rink element wrapper */
.rink-wrapper {
  position: relative;
  width: 100%;
  max-width: 100%;
  aspect-ratio: 2.05 / 1;
  border-radius: 16px;
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
  overflow: hidden;
  margin: 0 auto;
  background: #0f172a;
}

.canvas-rink {
  display: block;
  width: 100%;
  height: 100%;
  aspect-ratio: inherit;
  cursor: crosshair;
}

/* Responsive Table & Period Grid Wrappers */
.table-responsive-wrapper,
.period-table-wrapper {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.period-table {
  width: 100%;
  min-width: 260px;
  border-collapse: collapse;
  text-align: center;
}

/* Goalie Net Heatmap Container */
.goalie-net-frame {
  position: relative;
  width: 100%;
  max-width: 440px;
  aspect-ratio: 3 / 2;
  border: clamp(4px, 1.5vw, 8px) solid #ef4444;
  border-bottom: 3px solid #64748b;
  border-radius: 12px 12px 0 0;
  background: radial-gradient(circle, rgba(17, 30, 46, 0.95) 0%, rgba(15, 23, 42, 1) 100%);
  box-shadow: 0 0 25px rgba(239, 68, 68, 0.2), inset 0 0 40px rgba(0, 0, 0, 0.6);
  overflow: hidden;
  margin: 0 auto;
}

/* Tablet & Mobile Media Queries */
@media (max-width: 768px) {
  .main-content {
    padding: 12px;
  }

  .glass-card {
    padding: 14px;
    border-radius: 14px;
    margin-bottom: 14px;
  }

  .app-table th, .app-table td {
    padding: 8px 6px;
    font-size: 11px;
  }

  .period-table th, .period-table td {
    padding: 6px 4px;
    font-size: 11px;
  }

  .tab-btn {
    padding: 8px 8px;
    font-size: 12px;
  }
}

@media (max-width: 480px) {
  .main-content {
    padding: 8px;
  }

  .glass-card {
    padding: 12px;
    border-radius: 12px;
    margin-bottom: 12px;
  }

  .app-table th, .app-table td {
    padding: 6px 4px;
    font-size: 10px;
  }

  .btn-sm {
    padding: 6px 10px;
    font-size: 11px;
  }
}

/* Crease Craft brand: display type for the wordmark and headings */
.app-logo, h1, h2 { font-family: 'Barlow Condensed', 'Barlow', sans-serif; letter-spacing: 0.4px; }
.app-logo { text-transform: uppercase; }
