/* BK Ljungsbro - Modern Dark Theme with Glassmorphism */

:root {
  --dark-bg: #1a1a1a;
  --card-bg: rgba(45, 45, 45, 0.6);
  --card-border: rgba(255, 255, 255, 0.1);
  --text-primary: #ffffff;
  --text-secondary: #b0b0b0;
  --accent-color: #4a9eff;
  --success-color: #4ade80;
  --warning-color: #fbbf24;
  --border-radius: 16px;
  
  /* Event Type Colors */
  --event-match-color: #3b82f6;              /* Blå - Tävlingsmatch */
  --event-training-color: #6eb375;           /* Grön - Träning (BK Ljungsbro official) */
  --event-training-match-color: #f59e0b;     /* Orange - Träningsmatch */
  --event-cup-match-color: #a78bfa;          /* Lila - Cup-match */
  --event-team-activity-color: #1f2937;      /* Svart - Lag-aktivitet */
  --event-other-color: #06b6d4;              /* Turkos - Övriga */
}

html {
  height: 100% !important;
  background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%) !important;
  background-attachment: fixed !important;
}

body {
  background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%) !important;
  background-attachment: fixed !important;
  color: var(--text-primary);
  min-height: 100% !important;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  position: relative;
}

body::before {
  content: '';
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 60%;
  max-width: 800px;
  height: 60%;
  background-image: url('../img/BKL.png');
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  opacity: 0.03;
  pointer-events: none;
  z-index: -1;
}

body > * {
  position: relative;
  z-index: auto;
}

/* Ensure Bootstrap modal sits above any custom layers */
.modal-backdrop {
  z-index: 2000;
}

.modal {
  z-index: 2005;
}

/* Glassmorphism Cards */
.glass-card {
  background: var(--card-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--card-border);
  border-radius: var(--border-radius);
  padding: 1.5rem;
  transition: all 0.3s ease;
}

.glass-card:hover {
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}

/* Navbar */
.navbar {
  background: rgba(20, 20, 20, 0.95) !important;
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--card-border);
  padding: 1rem 0;
}

.navbar-brand {
  font-weight: 600;
  font-size: 1.25rem;
}

.navbar-text {
  color: var(--text-secondary) !important;
}

/* Buttons */
.btn-primary {
  background: linear-gradient(135deg, var(--accent-color) 0%, #3b82f6 100%);
  border: none;
  border-radius: 12px;
  padding: 0.75rem 1.5rem;
  font-weight: 500;
  transition: all 0.3s ease;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(74, 158, 255, 0.4);
}

.btn-outline-light {
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 0.5rem 1rem;
  transition: all 0.3s ease;
}

.btn-outline-light:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.3);
}

/* Forms */
.form-control,
.form-select {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  color: var(--text-primary);
  padding: 0.75rem 1rem;
  transition: all 0.3s ease;
}

.form-control:focus,
.form-select:focus {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--accent-color);
  color: var(--text-primary);
  box-shadow: 0 0 0 0.2rem rgba(74, 158, 255, 0.25);
}

.form-control::placeholder {
  color: var(--text-secondary);
}

.form-label {
  color: var(--text-primary);
  font-weight: 500;
  margin-bottom: 0.5rem;
}

/* Player Cards Grid */
.player-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.player-card {
  background: var(--card-bg);
  backdrop-filter: blur(10px);
  border: 1px solid var(--card-border);
  border-radius: var(--border-radius);
  padding: 1.5rem;
  text-align: center;
  transition: all 0.3s ease;
}

.player-card:hover {
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-4px);
}

.player-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, #4a9eff 0%, #3b82f6 100%);
  margin: 0 auto 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  color: white;
  font-weight: 600;
}

.player-name {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

.player-info {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin: 0.25rem 0;
}

.player-info strong {
  color: var(--text-primary);
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.5px;
}

/* Event Cards */
.event-card {
  background: var(--card-bg);
  backdrop-filter: blur(10px);
  border: 1px solid var(--card-border);
  border-radius: var(--border-radius);
  padding: 1.5rem;
  margin-bottom: 1rem;
  transition: all 0.3s ease;
}

.event-card:hover {
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateX(4px);
}

.event-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

.event-meta {
  color: var(--text-secondary);
  font-size: 0.875rem;
}

/* Status Badges */
.badge {
  border-radius: 8px;
  padding: 0.5rem 1rem;
  font-weight: 500;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-live {
  background: var(--success-color);
  color: #000;
}

.badge-beta {
  background: var(--warning-color);
  color: #000;
}

/* Training Match Badge */
.badge-training-match {
  background: #a78bfa; /* violet */
  color: #000;
}

/* Tables */
.table {
  color: var(--text-primary);
}

.table thead th {
  border-bottom: 2px solid var(--card-border);
  color: var(--text-secondary);
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.5px;
  font-weight: 600;
  padding: 1rem;
}

.table tbody td {
  border-bottom: 1px solid var(--card-border);
  padding: 1rem;
}

.table tbody tr:hover {
  background: rgba(255, 255, 255, 0.05);
}

/* Hero Section */
.hero {
  text-align: center;
  padding: 4rem 0;
  margin-bottom: 3rem;
}

.hero h1 {
  font-size: 3rem;
  font-weight: 700;
  margin-bottom: 1rem;
  background: linear-gradient(135deg, #fff 0%, #b0b0b0 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero p {
  font-size: 1.25rem;
  color: var(--text-secondary);
  margin-bottom: 2rem;
}

.hero-logo {
  width: 120px;
  height: 120px;
  margin: 0 auto 2rem;
}

/* Login Page */
.login-container {
  min-height: 80vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-card {
  background: var(--card-bg);
  backdrop-filter: blur(10px);
  border: 1px solid var(--card-border);
  border-radius: var(--border-radius);
  padding: 3rem;
  max-width: 450px;
  width: 100%;
  text-align: center;
}

.login-logo {
  width: 80px;
  height: 80px;
  margin: 0 auto 2rem;
}

/* List Groups */
.list-group-item {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  color: var(--text-primary);
  margin-bottom: 0.5rem;
  border-radius: 12px !important;
  transition: all 0.3s ease;
}

.list-group-item:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateX(4px);
}

.list-group-item-action:hover {
  background: rgba(255, 255, 255, 0.08);
}

/* Responsive */
@media (max-width: 768px) {
  /* Hero */
  .hero h1 {
    font-size: 2rem;
  }
  
  /* Grids */
  .player-grid {
    grid-template-columns: 1fr;
  }
  
  /* Cards */
  .glass-card {
    padding: 1rem !important;
  }
  
  /* Headers med knappar - VIKTIGT: gör alla flex-containers vertikala */
  .glass-card > .d-flex.justify-content-between,
  .glass-card > .d-flex.align-items-center {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 1rem !important;
  }
  
  /* Alla knapp-containers i headers */
  .glass-card .d-flex.gap-2,
  .glass-card > .d-flex.justify-content-between > .d-flex,
  .glass-card > .d-flex.align-items-center > .d-flex {
    flex-direction: column !important;
    width: 100% !important;
    gap: 0.5rem !important;
  }
  
  /* Alla knappar i headers blir fullbredd */
  .glass-card .btn,
  .glass-card a.btn {
    font-size: 0.9rem !important;
    padding: 0.75rem 1rem !important;
    white-space: normal !important;
    line-height: 1.4 !important;
  }
  
  /* Flex-column på mobil gör att width fungerar */
  .flex-column .btn,
  .flex-column a.btn {
    width: 100% !important;
  }
  
  /* Träningskalender - vecka header */
  .glass-card h1,
  .glass-card .h1,
  .glass-card h1.h4 {
    font-size: 1.2rem !important;
    margin-bottom: 0.5rem !important;
  }
  
  .glass-card p.text-secondary {
    font-size: 0.85rem !important;
    margin-bottom: 0.75rem !important;
  }
  
  /* Intensitetsprickar - gör dem större på mobil */
  span[title][style*="width: 16px"],
  span[title][style*="width:16px"] {
    width: 24px !important;
    height: 24px !important;
  }
  
  span[title*="Träningsintensitet"][style*="width:18px"],
  span[title*="Träningsintensitet"][style*="width: 18px"] {
    width: 24px !important;
    height: 24px !important;
  }
  
  /* Weekly intensity overview - bättre scrollning */
  .glass-card [style*="overflow-x: auto"],
  .glass-card [style*="overflow-x:auto"] {
    padding-bottom: 0.5rem !important;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Veckonummer och dag-labels */
  [style*="font-weight: bold"] {
    font-size: 0.9rem !important;
  }
  
  /* Sammanfattning - kolumner staplas */
  .row.g-3 > .col,
  .row.g-3 > [class*="col-"] {
    flex: 0 0 100% !important;
    max-width: 100% !important;
    min-width: 100% !important;
    width: 100% !important;
  }
  
  /* Datum & Tid kort - kompaktare */
  .glass-card [style*="font-size: 1.2em"] {
    font-size: 1rem !important;
  }
  
  .glass-card [style*="font-size: 2em"] {
    font-size: 1.5em !important;
  }
  
  .glass-card [style*="font-size: 1.3em"] {
    font-size: 1.1em !important;
  }
  
  /* Tränar-kort med bilder - bättre layout */
  [style*="padding: 4px 8px"],
  .d-flex[style*="padding: 4px 8px"] {
    padding: 8px 12px !important;
    gap: 8px !important;
  }
  
  [style*="width: 28px; height: 28px"],
  img[style*="width: 28px"],
  div[style*="width: 28px"] {
    width: 36px !important;
    height: 36px !important;
  }
  
  /* Event cards i kalendern */
  .event-card {
    padding: 1rem !important;
    font-size: 0.9rem !important;
  }
  
  .event-title {
    font-size: 1.05rem !important;
  }
  
  .event-meta {
    font-size: 0.8rem !important;
  }
  
  /* Utespelare/Målvakter info - kompaktare */
  [style*="margin-bottom: 12px"] {
    margin-bottom: 8px !important;
  }
  
  /* Upplägg sektion */
  [style*="display: flex; align-items: center; gap: 8px"] {
    flex-wrap: wrap !important;
    gap: 6px !important;
  }
  
  /* Tabs - bättre scroll och storlek */
  .nav-tabs {
    overflow-x: auto;
    overflow-y: hidden;
    flex-wrap: nowrap !important;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 0.5rem;
    border: none !important;
  }
  
  .nav-tabs .nav-link {
    white-space: nowrap;
    font-size: 0.8rem !important;
    padding: 0.5rem 0.7rem !important;
  }
  
  /* Form controls */
  .form-control,
  .form-select,
  input.form-control,
  textarea.form-control,
  select.form-select {
    font-size: 0.9rem !important;
    padding: 0.6rem 0.8rem !important;
  }
  
  /* Närvarokort - kompaktare */
  #attendance-overview-card {
    font-size: 0.8rem !important;
  }
  
  #attendance-overview-card [style*="font-size: 0.85em"] {
    font-size: 0.75em !important;
  }
  
  #attendance-overview-card [style*="font-size: 0.9em"] {
    font-size: 0.8em !important;
  }
  
  /* Tränare översikt lista */
  #overview-coaches li {
    gap: 0.5rem !important;
    font-size: 0.9rem !important;
  }
  
  #overview-coaches img,
  #overview-coaches .player-avatar {
    width: 30px !important;
    height: 30px !important;
    font-size: 0.8em !important;
  }
  
  /* Tables - scrollbara på mobil */
  .table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  table {
    font-size: 0.85rem;
  }
  
  /* Navbar - kompaktare */
  .navbar {
    padding: 0.5rem 0 !important;
  }
  
  .navbar-brand {
    font-size: 1rem !important;
  }
  
  .navbar .btn-sm {
    font-size: 0.75rem !important;
    padding: 0.35rem 0.6rem !important;
  }
  
  /* Container */
  .container,
  .container-fluid {
    padding-left: 0.75rem !important;
    padding-right: 0.75rem !important;
  }
  
  /* Mindre marginal mellan element */
  .my-4 {
    margin-top: 1rem !important;
    margin-bottom: 1rem !important;
  }
  
  .mb-4 {
    margin-bottom: 1rem !important;
  }
  
  .mb-3 {
    margin-bottom: 0.75rem !important;
  }
  
  .mb-2 {
    margin-bottom: 0.5rem !important;
  }
  
  /* Grid gaps */
  .g-3,
  .g-4 {
    gap: 0.75rem !important;
  }
  
  .row.g-3,
  .row.g-4 {
    --bs-gutter-x: 0.75rem;
    --bs-gutter-y: 0.75rem;
  }
}

/* Extra small devices - väldigt små telefoner */
@media (max-width: 480px) {
  /* Headers */
  h1, .h1 {
    font-size: 1.5rem !important;
  }
  
  h2, .h2 {
    font-size: 1.3rem !important;
  }
  
  h3, .h3, h4, .h4 {
    font-size: 1.1rem !important;
  }
  
  h5, .h5, h6, .h6 {
    font-size: 1rem !important;
  }
  
  /* Extra kompakta cards */
  .glass-card {
    padding: 0.75rem !important;
  }
  
  /* Knapptext kan brytas */
  .btn {
    white-space: normal;
    line-height: 1.3;
  }
  
  /* Event cards */
  .event-card {
    padding: 0.75rem !important;
  }
  
  /* Mindre font i sammandatera-korten */
  .glass-card.text-center {
    font-size: 0.8rem;
  }
  
  .glass-card.text-center div[style*="font-size: 1.3em"] {
    font-size: 1.1em !important;
  }
  
  /* Navbar */
  .navbar-text {
    font-size: 0.85rem !important;
  }
}

/* Utility Classes */
.text-secondary {
  color: var(--text-secondary) !important;
}

.text-muted {
  color: var(--text-secondary) !important;
}

h1, h2, h3, h4, h5, h6 {
  color: var(--text-primary);
  font-weight: 600;
}

a {
  color: var(--accent-color);
  text-decoration: none;
  transition: all 0.3s ease;
}

a:hover {
  color: #60b0ff;
}

/* Profile Avatar hover effect */
a[href*="profile"]:hover div[style*="border: 2px solid"] {
  border-color: rgba(74, 158, 255, 0.6) !important;
}

a[href*="profile"]:hover {
  opacity: 0.8;
}
/* Message cards */
.message-card {
  word-wrap: break-word;
  overflow-wrap: break-word;
}