/* ===========================
   Age Group Page Styling
   =========================== */

.age-group-section {
  min-height: 100vh;
  padding: 3rem 1.5rem;
  background: #ffffff;
}

.age-group-container {
  max-width: 1200px;
  margin: 0 auto;
}

/* Header */
.age-group-header {
  text-align: center;
  margin-bottom: 3rem;
  animation: slideDown 0.6s ease-out;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.age-group-title {
  margin-bottom: 0.5rem;
  font-size: 3rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #111827;
  background: linear-gradient(135deg, #aa912b 0%, #8f7923 100%);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.age-group-subtitle {
  margin-top: 0.5rem;
  font-size: 1.125rem;
  font-weight: 500;
  color: #6b7280;
}

/* Main Content Layout */
.age-group-content {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 2.5rem;
  animation: fadeIn 0.8s ease-out 0.2s both;
}

/* Prevent grid/flex children from forcing horizontal overflow */
.age-group-content > * {
  min-width: 0;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Section Card Base */
.section-card {
  padding: 2rem;
  border: 1px solid #e5e7eb;
  border-radius: 1rem;
  background: #ffffff;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08), 0 2px 4px rgba(0, 0, 0, 0.05);
  transition: all 0.3s ease;
}

.section-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
}

/* Section Title */
.section-title {
  margin-top: 0;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  font-size: 1.5rem;
  font-weight: 700;
  color: #111827;
  border-bottom: 2px solid #aa912b;
}

/* Timetable Section */
.timetable-section {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.timetable-wrapper {
  overflow-x: auto;
}

/* Hide empty message by default (shown only on mobile when all days are empty) */
.timetable-empty-message {
  display: none;
}

.timetable {
  width: 100%;
  margin-top: 1rem;
  border-collapse: collapse;
  table-layout: fixed;
}

.timetable thead {
  background: #aa912b;
}

.timetable th {
  padding: 1rem;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-align: left;
  text-transform: uppercase;
  color: #ffffff;
}

.timetable tbody tr {
  border-bottom: 1px solid #e5e7eb;
}

.timetable tbody tr:hover {
  background: #f9fafb;
}

.timetable td {
  padding: 1.25rem 1rem;
  font-size: 0.95rem;
  color: #6b7280;
}

.timetable .col-day {
  width: 22%;
  font-weight: 700;
  color: #111827;
}

.day-label {
  display: inline-block;
  font-size: 0.9rem;
  font-weight: 600;
  color: #111827;
}

.timetable tbody .col-time {
  width: 26%;
  font-weight: 600;
  color: #6b7280;
}

.timetable .col-garderoba {
  width: 26%;
}

.timetable .col-notes {
  width: 26%;
}

/* Igrišče Link Styling - matches original cell-value styling */
.igrisce-link {
  color: #6b7280;
  text-decoration: none;
  font-weight: normal;
}

.igrisce-link:hover {
  text-decoration: underline;
}

/* Sidebar */
.sidebar {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.sidebar > * {
  min-width: 0;
}

/* Trainer Card */
.trainer-card {
  position: relative;
  overflow: hidden;
  text-align: center;
}

/* Accent bar above trainer removed per request */

.trainer-image-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.5rem;
  border: 2px solid #e5e7eb;
  border-radius: 0.75rem;
  aspect-ratio: 1;
  background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
  overflow: hidden;
}

.trainer-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.trainer-info {
  padding: 0 0.5rem;
}

.trainer-name {
  margin: 0 0 0.25rem 0;
  font-size: 1.25rem;
  font-weight: 700;
  color: #111827;
}

.trainer-title {
  margin: 0 0 1.5rem 0;
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #aa912b;
}

.trainer-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid #e5e7eb;
}

.stat {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.stat-number {
  display: block;
  font-size: 1.5rem;
  font-weight: 700;
  color: #aa912b;
}

.stat-label {
  margin-top: 0.25rem;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #6b7280;
}

/* Competition Card */
.competition-card {
  display: flex;
  flex-direction: column;
}

.competition-list {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  flex: 1;
}

.empty-state {
  margin: 0;
  font-size: 0.95rem;
  font-style: italic;
  text-align: center;
  color: #9ca3af;
}

.schedule-footer {
  margin-top: 1rem;
  padding-top: 1rem;
  text-align: center;
  border-top: 1px solid #e5e7eb;
}

.schedule-footer small {
  font-size: 0.8rem;
  color: #d1d5db;
}

/* Responsive Design */
@media (max-width: 968px) {
  .age-group-content {
    grid-template-columns: 1fr;
  }

  .sidebar {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .trainer-card,
  .competition-card {
    flex: 1 1 320px;
    min-width: 0;
  }

  .age-group-title {
    font-size: 2.5rem;
  }

  .trainer-image-wrapper {
    aspect-ratio: 1 / 1;
    max-width: 240px;
    margin-left: auto;
    margin-right: auto;
  }

  /* Avoid clipping trainer info when cards sit in flex rows */
  .trainer-card {
    overflow: visible;
  }

  /* Soften the top accent bar on narrow widths */
  .trainer-card::before {
    top: 0.5rem;
    left: 1rem;
    right: 1rem;
    height: 3px;
    border-radius: 999px;
  }
}

@media (max-width: 770px) {
  /*
    Mobile global styles add extra top padding to any `.page-content > section`.
    The age-group page already has its own spacing, so that extra padding makes
    the title look like it "jumps" down and leaves a big blank gap.
  */
  .page-content > section.age-group-section {
    padding-top: 0.75rem !important;
  }

  /* Title sits too low because the global layout already offsets for the fixed nav */
  .age-group-section {
    min-height: auto;
    padding: 1.25rem 1rem 2.5rem;
  }

  .age-group-header {
    margin-bottom: 1.25rem;
  }

  .section-card {
    padding: 1.5rem;
  }

  /* Mobile timetable: show full text (no ...), no sideways scroll */
  .timetable-wrapper {
    overflow-x: hidden;
  }

  .timetable thead {
    display: none;
  }

  .timetable,
  .timetable tbody,
  .timetable tr {
    display: block;
    width: 100%;
  }

  .timetable tr {
    border: 1px solid #e5e7eb;
    border-radius: 0.75rem;
    margin-bottom: 0.75rem;
    background: #ffffff;
    overflow: hidden;
  }

  /* Hide empty days on mobile */
  .timetable tr.empty-day {
    display: none;
  }

  /* When all days are empty on mobile, hide table and show message */
  .timetable-all-empty .timetable {
    display: none;
  }

  .timetable-all-empty .timetable-empty-message {
    display: block;
    text-align: center;
    padding: 2rem 1rem;
  }

  .timetable td {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0.75rem;
    padding: 0.75rem;
    width: auto !important;
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
  }

  .timetable td .cell-value {
    flex: 1;
    min-width: 0;
    text-align: center;
  }

  .timetable td .cell-value.is-empty {
    text-align: center;
  }

  .timetable td::before {
    flex: 0 0 auto;
    width: 5.5rem;
    font-weight: 700;
    color: #111827;
  }

  /* Day is the card header (no "Dan:" label) */
  .timetable td.col-day {
    justify-content: center;
    gap: 0;
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
    font-weight: 700;
  }

  .timetable td.col-day::before {
    content: none;
    display: none;
  }

  .timetable td.col-time::before {
    content: "URA";
  }

  .timetable td.col-garderoba::before {
    content: "GARDEROBA";
  }

  .timetable td.col-notes::before {
    content: "IGRIŠČE";
  }

  /* Igrišče link on mobile - matches cell-value styling */
  .timetable td .igrisce-link {
    flex: 1;
    min-width: 0;
    text-align: center;
  }
}

@media (max-width: 640px) {
  .age-group-section {
    padding: 0.75rem 1rem 2.5rem;
  }

  .age-group-title {
    font-size: 2rem;
  }

  .trainer-image-wrapper {
    aspect-ratio: 1 / 1;
    width: 100%;
    max-width: 320px;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 1rem;
  }

  .trainer-title {
    margin-bottom: 1rem;
  }

  .age-group-content {
    gap: 1.5rem;
  }

  .sidebar {
    flex-direction: column;
  }

  .timetable .day-label {
    font-size: 0.8rem;
    white-space: nowrap;
  }

  .section-title {
    font-size: 1.25rem;
    margin-bottom: 1rem;
  }
}
