/**
 * Somang Schedule Frontend Styles
 *
 * This CSS is preserved exactly from the original design.
 * Do not modify unless absolutely necessary.
 */

/* ========== Container ========== */
.somang-schedule-container {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  max-width: 100%;
  margin: 0 auto;
}

/* ========== Filter Section ========== */
.somang-filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  margin-bottom: 28px;
  padding: 12px 18px;
  background: #f8f8f8;
  border-radius: 8px;
  border: 1px solid #e0e0e0;
}

.somang-filter-label {
  font-size: 13px;
  font-weight: 600;
  color: #444;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 10px;
}

.somang-filter-label::before {
  content: "";
  display: inline-block;
  width: 3px;
  height: 16px;
  background: #c00000;
  border-radius: 2px;
}

.somang-filter-select {
  padding: 9px 32px 9px 12px;
  font-size: 14px;
  font-weight: 500;
  color: #222;
  background-color: #fff;
  border: 1px solid #ccc;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  white-space: nowrap;
}

.somang-filter-select:hover {
  border-color: #999;
}

.somang-filter-select:focus {
  outline: none;
  border-color: #c00000;
  box-shadow: 0 0 0 3px rgba(192, 0, 0, 0.1);
}

/* ========== Date Range Filter ========== */
.somang-date-range {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
}

.somang-date-input {
  padding: 8px 10px;
  font-size: 14px;
  font-weight: 500;
  color: #222;
  background: #fff;
  border: 1px solid #ccc;
  border-radius: 6px;
  transition: border-color 0.2s, box-shadow 0.2s;
  width: 138px;
}

.somang-date-input:hover {
  border-color: #999;
}

.somang-date-input:focus {
  outline: none;
  border-color: #c00000;
  box-shadow: 0 0 0 3px rgba(192, 0, 0, 0.1);
}

.somang-date-separator {
  font-size: 14px;
  color: #bbb;
  line-height: 1;
  flex-shrink: 0;
}

.somang-schedule-container .somang-date-clear,
.somang-schedule-container .somang-date-clear:visited {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 7px 11px !important;
  font-family: inherit !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  line-height: 1 !important;
  color: #888 !important;
  background: transparent !important;
  border: 1px solid #ddd !important;
  border-radius: 6px !important;
  box-shadow: none !important;
  cursor: pointer !important;
  transition: color 0.2s, border-color 0.2s, background 0.2s !important;
  white-space: nowrap !important;
  flex-shrink: 0 !important;
  text-decoration: none !important;
  letter-spacing: 0 !important;
  text-transform: none !important;
}

.somang-schedule-container .somang-date-clear:hover,
.somang-schedule-container .somang-date-clear:focus {
  color: #c00000 !important;
  border-color: #c00000 !important;
  background: rgba(192, 0, 0, 0.04) !important;
  box-shadow: none !important;
  outline: none !important;
}

/* ========== Section Cards ========== */
.somang-section {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
  overflow: hidden;
  border: 1px solid #e8e8e8;
}

.somang-section--stats {
  margin-bottom: 32px;
}

.somang-section--schedule {
  margin-bottom: 0;
}

/* ========== Section Header ========== */
.somang-section-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 24px;
  background: linear-gradient(180deg, #fafafa 0%, #f5f5f5 100%);
  border-bottom: 1px solid #e8e8e8;
}

.somang-section-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(180deg, #c00000 0%, #900000 100%);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 16px;
  box-shadow: 0 2px 6px rgba(192, 0, 0, 0.3);
}

.somang-section-title {
  font-size: 16px;
  font-weight: 700;
  color: #111;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.somang-section-subtitle {
  font-size: 13px;
  color: #666;
  font-weight: 400;
  margin-left: auto;
}

/* ========== Stats Table ========== */
.somang-stats-wrap {
  width: 100%;
  overflow-x: auto;
}

.somang-stats-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  min-width: 600px;
}

.somang-stats-table thead th {
  padding: 14px 16px;
  background: linear-gradient(180deg, #1a1a1a 0%, #000 100%);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  text-align: center;
  white-space: nowrap;
}

.somang-stats-table thead th:first-child {
  text-align: left;
}

.somang-stats-table tbody td {
  padding: 14px 16px;
  text-align: center;
  color: #333;
  font-weight: 500;
  background: #fff;
  border-bottom: 1px solid #f0f0f0;
}

.somang-stats-table tbody td:first-child {
  text-align: left;
  font-weight: 700;
}

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

.somang-stats-table tbody tr:hover td {
  background: #fef8f8;
}

.somang-stats-table .stat-highlight {
  color: #0a7c0a;
  font-weight: 700;
}

.somang-stats-table .stat-streak {
  background: #e8f5e9;
  color: #0a7c0a;
  padding: 4px 10px;
  border-radius: 4px;
  font-weight: 700;
  font-size: 12px;
  display: inline-block;
}

.somang-stats-table .stat-streak.loss {
  background: #ffebee;
  color: #c00000;
}

/* ========== Stats Mobile Cards ========== */
.somang-stats-cards {
  display: none;
  gap: 16px;
  padding: 16px;
}

.somang-stat-card {
  background: #f9f9f9;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid #eee;
}

.somang-stat-card-header {
  background: linear-gradient(180deg, #1a1a1a 0%, #000 100%);
  color: #fff;
  padding: 14px 16px;
  font-weight: 700;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.somang-stat-card-body {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  background: #e0e0e0;
}

.somang-stat-item {
  background: #fff;
  padding: 14px 16px;
  text-align: center;
}

.somang-stat-item.full-width {
  grid-column: span 2;
}

.somang-stat-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #888;
  margin-bottom: 4px;
}

.somang-stat-value {
  font-size: 18px;
  font-weight: 700;
  color: #111;
}

.somang-stat-value.small {
  font-size: 14px;
}

.somang-stat-value.win {
  color: #0a7c0a;
}

/* ========== Schedule Table Wrapper ========== */
.somang-smart-table-wrap {
  width: 100%;
  overflow-x: auto;
}

/* ========== Schedule Table ========== */
.somang-smart-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 15px;
}

/* ========== Table Header ========== */
.somang-smart-table thead {
  position: sticky;
  top: 0;
  z-index: 10;
}

.somang-smart-table th {
  padding: 16px 18px;
  background: linear-gradient(180deg, #1a1a1a 0%, #000 100%);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  text-align: left;
  cursor: pointer;
  user-select: none;
  position: relative;
  transition: background 0.2s ease;
  white-space: nowrap;
}

.somang-smart-table th:hover {
  background: linear-gradient(180deg, #2a2a2a 0%, #111 100%);
}

.somang-smart-table th::after {
  content: "\21C5";
  margin-left: 8px;
  opacity: 0.4;
  font-size: 11px;
}

.somang-smart-table th:last-child::after {
  content: none;
}

/* ========== Table Body ========== */
.somang-smart-table td {
  padding: 14px 18px;
  border-bottom: 1px solid #f0f0f0;
  color: #333;
  vertical-align: middle;
  transition: background 0.15s ease;
}

.somang-smart-table tbody tr {
  transition: all 0.15s ease;
}

.somang-smart-table tbody tr:hover {
  background-color: #fef8f8;
}

.somang-smart-table tbody tr:hover td {
  color: #111;
}

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

/* ========== Cell Styling ========== */
.somang-smart-table td:nth-child(1) {
  font-weight: 600;
  color: #111;
  white-space: nowrap;
}

.somang-smart-table td:nth-child(2) {
  font-weight: 600;
}

.somang-smart-table td:nth-child(3) {
  font-weight: 500;
}

.somang-smart-table td:nth-child(5) {
  font-size: 13px;
  color: #666;
}

.somang-smart-table td:nth-child(6) {
  font-weight: 600;
  text-align: center;
}

/* ========== Video Button ========== */
.somang-smart-table .video-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(180deg, #d40000 0%, #b00000 100%);
  color: #fff;
  padding: 8px 14px;
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  border-radius: 6px;
  transition: all 0.2s ease;
  box-shadow: 0 2px 4px rgba(192, 0, 0, 0.2);
}

.somang-smart-table .video-btn::before {
  content: "\25B6";
  font-size: 9px;
}

.somang-smart-table .video-btn:hover {
  background: linear-gradient(180deg, #e00000 0%, #c00000 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(192, 0, 0, 0.3);
}

.somang-smart-table .video-btn:active {
  transform: translateY(0);
}

/* ========== Team Badge Styling ========== */
.team-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  white-space: nowrap;
}

.team-badge.junior { background: #ffe5e5; color: #a00000; }
.team-badge.prep { background: #e5e5e5; color: #333; }
.team-badge.u16 { background: #fff0e5; color: #b35000; }
.team-badge.u18 { background: #e5f0ff; color: #0055b3; }

/* ========== Venue Styling ========== */
.venue-home {
  color: #0a7c0a;
  font-weight: 600;
}

.venue-away {
  color: #666;
}

/* ========== MOBILE STYLES ========== */
@media screen and (max-width: 768px) {
  .somang-filter-bar {
    display: flex;
    width: 100%;
    box-sizing: border-box;
    margin-bottom: 20px;
  }

  .somang-filter-select {
    flex: 1;
  }

  .somang-date-range {
    width: 100%;
    flex-wrap: wrap;
  }

  .somang-date-input {
    flex: 1;
    min-width: 0;
    width: auto;
  }

  .somang-section {
    border-radius: 12px;
  }

  .somang-section--stats {
    margin-bottom: 24px;
  }

  .somang-section-header {
    padding: 14px 16px;
  }

  .somang-section-icon {
    width: 32px;
    height: 32px;
    font-size: 14px;
  }

  .somang-section-title {
    font-size: 14px;
  }

  .somang-section-subtitle {
    display: none;
  }

  /* Hide stats table, show cards */
  .somang-stats-wrap {
    display: none;
  }

  .somang-stats-cards {
    display: flex;
    flex-direction: column;
  }

  .somang-smart-table-wrap {
    box-shadow: none;
    background: transparent;
    border-radius: 0;
    overflow: visible;
    padding: 16px;
  }

  .somang-smart-table {
    border: none;
  }

  .somang-smart-table thead {
    display: none;
  }

  .somang-smart-table tbody {
    display: flex;
    flex-direction: column;
    gap: 14px;
  }

  .somang-smart-table tbody tr {
    display: flex;
    flex-direction: column;
    background: #f9f9f9;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    padding: 0;
    overflow: hidden;
    border: 1px solid #eee;
  }

  .somang-smart-table tbody tr:hover {
    background: #f9f9f9;
  }

  .somang-smart-table td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid #eee;
    text-align: right;
    background: #fff;
  }

  .somang-smart-table td:last-child {
    border-bottom: none;
  }

  .somang-smart-table td::before {
    content: attr(data-label);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #888;
    text-align: left;
    padding-right: 16px;
  }

  /* Card header - Date & Team row */
  .somang-smart-table td:nth-child(1) {
    background: linear-gradient(180deg, #1a1a1a 0%, #000 100%);
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    border-radius: 12px 12px 0 0;
  }

  .somang-smart-table td:nth-child(1)::before {
    color: rgba(255,255,255,0.6);
  }

  .somang-smart-table td:nth-child(2) {
    background: #f8f8f8;
    padding-top: 14px;
    padding-bottom: 14px;
  }

  .somang-smart-table td:nth-child(3) {
    font-size: 15px;
    font-weight: 600;
    color: #111;
  }

  .somang-smart-table td:nth-child(5) {
    font-size: 13px;
    color: #666;
  }

  .somang-smart-table td:nth-child(6) {
    text-align: right;
  }

  .somang-smart-table td:nth-child(7) {
    background: #f8f8f8;
    padding: 14px 16px;
    justify-content: center;
    border-radius: 0 0 12px 12px;
  }

  .somang-smart-table td:nth-child(7)::before {
    display: none;
  }

  .somang-smart-table .video-btn {
    width: 100%;
    justify-content: center;
    padding: 12px 16px;
    font-size: 14px;
  }

  .somang-smart-table tbody tr td:first-child {
    border-radius: 12px 12px 0 0;
  }

  .somang-smart-table tbody tr td:last-child {
    border-radius: 0 0 12px 12px;
  }
}

@media screen and (max-width: 380px) {
  .somang-filter-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .somang-filter-label {
    justify-content: center;
  }
}

/* ========== Loading State ========== */
.somang-loading {
  opacity: 0.5;
  pointer-events: none;
  position: relative;
}

.somang-loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 24px;
  height: 24px;
  margin: -12px 0 0 -12px;
  border: 3px solid #c00000;
  border-radius: 50%;
  border-top-color: transparent;
  animation: somang-spin 0.8s linear infinite;
}

@keyframes somang-spin {
  to { transform: rotate(360deg); }
}
