/* src/assets/css/views/trainings.css */
/* Training view styles */

/* ========================================
   TRAINING VIEW CONTAINER
   ======================================== */

.trainings-view-container {
  background: #f8f9fa;
  min-height: calc(100vh - 150px);
  padding-bottom: 180px; /* Space for fixed footer */
  margin: 0;
  padding-left: 0;
  padding-right: 0;
  padding-top: 0;
}

/* ========================================
   TRAINING FEED
   ======================================== */

.trainings-feed {
  background: transparent;
}

.trainings-feed-header {
  padding-bottom: 0.5rem;
  margin-bottom: 0 !important;
}

.trainings-feed-title {
  color: #2e3092;
  font-size: 1.65rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

/* Backwards compatibility with old class name */
.trainings-title {
  color: var(--gold-blue);
  font-weight: 600;
  font-size: 1.4rem;
  margin-bottom: 0;
}

/* ========================================
   DESKTOP TABLE VIEW
   ======================================== */

/* Table responsive wrapper */
.table-responsive {
  border-radius: var(--radius-md);
  overflow: visible;  /* Allow dropdowns to show outside table */
  position: relative;
}

.trainings-table {
  background: white;
  border: 2px solid var(--gold-yellow);
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: 0;
  width: 100%;
  table-layout: auto;  /* Allow table to shrink naturally */
}

.trainings-table thead {
  background-color: #ffcf63 !important;
  color: #2e3092 !important;
  position: relative;
  z-index: 10;
}

.trainings-table thead th {
  font-weight: 600;
  padding: 0.75rem 0.5rem;
  border: none;
  background-color: #ffcf63 !important;
  color: #2e3092 !important;
  white-space: nowrap;
  font-size: 0.8rem;
}

.trainings-table thead th .btn-link {
  text-decoration: none;
  transition: transform var(--transition-fast);
}

.trainings-table thead th .btn-link:hover {
  transform: rotate(180deg);
}

/* Excel-style Filter Headers */
.trainings-table thead th.filter-header {
  position: relative;
  cursor: default;
}

/* Filter Icon */
.filter-icon {
  color: #2e3092;
  font-size: 0.75rem;
  opacity: 0.7;
  transition: opacity var(--transition-fast);
}

.filter-icon:hover {
  opacity: 1;
}

/* Filter Dropdown */
.filter-dropdown {
  position: relative;
  display: inline-block;
}

.filter-menu {
  display: none;
  position: fixed;
  z-index: 10000;
  min-width: 200px;
  max-width: 300px;
  background: white;
  border: 2px solid var(--gold-yellow);
  border-radius: var(--radius-md);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.filter-menu.show {
  display: block;
  animation: filterMenuSlideIn 0.2s ease;
}

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

.filter-menu-content {
  padding: 1rem;
}

.filter-menu-content label {
  color: var(--gold-blue);
  display: block;
}

.filter-menu-content .form-control,
.filter-menu-content .form-select {
  border: 1px solid #ddd;
  font-size: 0.875rem;
  transition: border-color var(--transition-fast);
}

.filter-menu-content .form-control:focus,
.filter-menu-content .form-select:focus {
  border-color: var(--gold-blue);
  box-shadow: 0 0 0 0.15rem rgba(46, 48, 146, 0.1);
}

.trainings-table tbody tr {
  transition: background-color var(--transition-fast);
}

/* Alternating row colors */
.trainings-table tbody tr:nth-child(odd):not(.participant-row) {
  background-color: #ffff99 !important;
  --bs-table-bg: #ffff99 !important;
}

.trainings-table tbody tr:nth-child(even):not(.participant-row) {
  background-color: #ffffcc !important;
  --bs-table-bg: #ffffcc !important;
}

.trainings-table tbody tr:hover:not(.participant-row) {
  background-color: #ffdb00 !important;
  --bs-table-hover-bg: #ffdb00 !important;
}

.trainings-table tbody tr.table-active {
  background-color: #e6e6cc !important;
}

.trainings-table tbody td {
  padding: 0.75rem 0.5rem;
  vertical-align: middle;
  border-bottom: 1px solid var(--color-border);
  background-color: transparent !important;  /* Let row background show through */
  font-size: 0.8rem;
}

/* Compact icon column */
.trainings-table tbody td:nth-child(2) {
  padding: 0.75rem 0.25rem;
  width: 30px;
}

/* Compact action column */
.trainings-table tbody td:last-child {
  white-space: nowrap;
}

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

/* Participant rows (expanded) */
.trainings-table tbody tr.participant-row {
  background-color: #ffffdd;
}

.trainings-table tbody tr.participant-row:hover {
  background-color: #ffffe8;
}

.trainings-table tbody tr.participant-row td {
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
  color: var(--color-text-light);
}

/* ========================================
   MOBILE CARD VIEW
   ======================================== */

.training-card {
  border: 2px solid var(--gold-yellow);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-normal);
}

.training-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.training-card.closed {
  opacity: 0.7;
  border-color: var(--color-border);
}

.training-card .card-title {
  color: var(--gold-blue);
  font-weight: 600;
  font-size: 0.9rem;
}

.training-card .card-text {
  font-size: 0.8rem;
  color: var(--color-text);
}

.training-stats {
  padding: 0.75rem;
  background-color: rgba(46, 48, 146, 0.03);
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
}

.participants-list {
  padding: 0.75rem;
  background-color: rgba(255, 219, 0, 0.1);
  border-radius: var(--radius-sm);
}

.participants-list ul {
  margin: 0;
  padding-left: 1rem;
}

/* ========================================
   BUTTONS & BADGES
   ======================================== */

.btn-outline-gold-blue {
  color: var(--gold-blue);
  border: 2px solid var(--gold-blue);
  font-weight: 600;
  transition: all var(--transition-fast);
}

.btn-outline-gold-blue:hover {
  background-color: var(--gold-blue);
  color: white;
  border-color: var(--gold-blue);
}

.btn-outline-gold-blue:active,
.btn-outline-gold-blue:focus {
  background-color: var(--color-hover);
  border-color: var(--color-hover);
  color: white;
}

.btn-outline-gold-red {
  color: var(--gold-red);
  border: 2px solid var(--gold-red);
  font-weight: 600;
  transition: all var(--transition-fast);
}

.btn-outline-gold-red:hover {
  background-color: var(--gold-red);
  color: white;
  border-color: var(--gold-red);
}

.btn-outline-gold-red:active,
.btn-outline-gold-red:focus {
  background-color: #d11820;
  border-color: #d11820;
  color: white;
}

.badge.bg-gold {
  background-color: var(--gold-yellow) !important;
  color: var(--color-text);
  font-weight: 600;
  padding: 0.5rem 0.75rem;
  font-size: 0.85rem;
}

/* ========================================
   TEXT UTILITIES
   ======================================== */

.text-gold-blue {
  color: var(--gold-blue);
}

.text-gold-yellow {
  color: var(--gold-yellow);
}

/* ========================================
   RESPONSIVE ADJUSTMENTS
   ======================================== */

/* ========================================
   MOBILE FILTERS
   ======================================== */

.mobile-filters {
  background: white;
  padding: 1rem;
  border: 2px solid var(--gold-yellow);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  animation: filterSlideIn 0.3s ease;
}

@keyframes filterSlideIn {
  from {
    opacity: 0;
    max-height: 0;
    overflow: hidden;
  }
  to {
    opacity: 1;
    max-height: 500px;
  }
}

.mobile-filters .form-control,
.mobile-filters .form-select {
  border: 1px solid #ddd;
}

.mobile-filters .form-control:focus,
.mobile-filters .form-select:focus {
  border-color: var(--gold-blue);
  box-shadow: 0 0 0 0.15rem rgba(46, 48, 146, 0.1);
}

/* Mobile (<768px) */
@media (max-width: 767px) {
  .trainings-feed-title {
    font-size: 1.5rem;
  }

  .trainings-title {
    font-size: 1.25rem;
  }

  .training-card .card-body {
    padding: 1rem;
  }

  .training-stats {
    font-size: 0.85rem;
  }
}

/* Tablet (768px - 991px) */
@media (min-width: 768px) and (max-width: 991px) {
  .trainings-table tbody td {
    padding: 0.75rem;
    font-size: 0.9rem;
  }
}

/* Desktop (992px+) */
@media (min-width: 992px) {
  .trainings-table {
    font-size: 0.95rem;
  }
}
