/* Basketball Stats Tracker - Main Stylesheet */
/* Mobile-first responsive design with consolidated styles */

/* Component imports - must come first */
@import url('components/team-logos.css');
@import url('components/game-detail.css');
@import url('components/box-score.css');

:root {
  --primary-color: #ff6b00;
  --secondary-color: #294c70;
  --accent-color: #ff9e00;
  --text-color: #333;
  --light-text: #fff;
  --background-color: #f5f5f5;
  --card-background: #fff;
  --border-color: #ddd;
  --success-color: #28a745;
  --error-color: #dc3545;
  --warning-color: #ffc107;
  --beta-banner-color: #fff3cd;
  --beta-banner-border: #ffeaa7;
  --beta-banner-text: #856404;
  
  /* Responsive breakpoints */
  --mobile-max: 480px;
  --tablet-min: 481px;
  --tablet-max: 1024px;
  --desktop-min: 1025px;
  
  /* Touch target sizes */
  --touch-target-min: 44px;
  --touch-target-tablet: 42px;
  --touch-target-landscape: 40px;
}

/* Base styles - Mobile first */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.6;
  color: var(--text-color);
  background-color: var(--background-color);
}

/* Container */
.container {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 15px;
}

/* Typography - Mobile first, progressively enhanced */
h1 { font-size: 1.6rem; }
h2 { font-size: 1.4rem; }
h3 { font-size: 1.2rem; }
h4 { font-size: 1.1rem; }
h5 { font-size: 1rem; }
h6 { font-size: 0.95rem; }

/* Header */
.site-header {
  background-color: var(--secondary-color);
  color: var(--light-text);
  padding: 10px 0;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  position: relative;
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: auto;
  position: relative;
}

.site-title {
  width: 100%;
  text-align: center;
  margin-bottom: 0;
}

.site-title a {
  color: var(--light-text);
  text-decoration: none;
  font-size: 1.3rem;
  font-weight: bold;
}

/* Mobile Menu Button - Hidden by default, shown on mobile */
.mobile-menu-btn {
  display: flex;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  right: 15px;
  color: var(--light-text);
  font-size: 1.5rem;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: background-color 0.2s;
  z-index: 1001;
  background: transparent;
  border: none;
  cursor: pointer;
}

.mobile-menu-btn:hover,
.mobile-menu-btn:focus {
  background-color: rgba(255, 255, 255, 0.1);
  opacity: 0.8;
}

/* Navigation - Mobile first */
.main-nav {
  display: none;
  flex-direction: column;
  width: 100%;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background-color: var(--secondary-color);
  z-index: 1000;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  padding-bottom: 15px;
  max-height: calc(100vh - 70px);
  overflow-y: auto;
}

.main-nav.active {
  display: flex !important;
}

.main-nav ul {
  display: flex;
  flex-direction: column;
  width: 100%;
  align-items: stretch;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 0;
}

.main-nav li {
  margin: 0;
  width: 100%;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
}

.main-nav li:last-child {
  border-bottom: none;
}

.main-nav a,
.main-nav .dropdown-toggle {
  display: block;
  padding: 14px 20px;
  width: 100%;
  border-radius: 0;
  font-size: 1rem;
  color: var(--light-text);
  font-weight: 500;
  text-decoration: none;
  transition: background-color 0.2s;
  min-height: var(--touch-target-min);
}

.main-nav a:hover,
.main-nav .dropdown-toggle:hover {
  background-color: rgba(255, 255, 255, 0.15);
}

/* Navigation divider */
.nav-divider {
  display: none;
}

/* User navigation items */
#user-nav-item {
  gap: 10px;
}

#username-display {
  color: var(--light-text);
  font-weight: 500;
  padding: 5px;
}

/* Dropdown navigation */
.nav-dropdown {
  width: 100%;
  position: relative;
}

.dropdown-toggle {
  cursor: pointer;
  width: 100%;
  text-align: left;
  display: block;
  min-width: 120px;
}

.main-nav .dropdown-toggle i.fa-chevron-down {
  float: right;
  transition: transform 0.3s ease;
  margin-top: 4px;
}

.nav-dropdown.active .dropdown-toggle i.fa-chevron-down {
  transform: rotate(180deg);
}

.dropdown-menu {
  position: static !important;
  display: none !important;
  width: 100%;
  box-shadow: none;
  border: none;
  background-color: rgba(0, 0, 0, 0.2);
  margin-top: 0;
  border-radius: 0;
  padding-left: 0;
  list-style: none;
  padding: 0;
  margin: 0;
}

.nav-dropdown.active .dropdown-menu {
  display: block !important;
}

.dropdown-menu li {
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.dropdown-menu li:last-child {
  border-bottom: none;
}

.dropdown-menu a {
  color: var(--light-text);
  padding: 12px 20px 12px 35px;
  font-size: 0.9rem;
  transition: background-color 0.2s ease;
}

.dropdown-menu a:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

.dropdown-menu a i {
  margin-right: 10px;
  width: 18px;
  text-align: center;
}

/* Beta Banner */
.beta-banner {
  background-color: var(--beta-banner-color);
  border-bottom: 2px solid var(--beta-banner-border);
  color: var(--beta-banner-text);
  padding: 8px 0;
  text-align: center;
  font-weight: 500;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  font-size: 0.85rem;
}

.beta-banner .container {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
}

.beta-banner i {
  font-size: 1.1rem;
  color: var(--warning-color);
}

.beta-text {
  line-height: 1.4;
}

.beta-text strong {
  font-weight: 700;
}

/* Generic notification banners */
.banner {
  margin: 1rem 0;
  padding: 0.75rem 1rem;
  border-radius: 0.375rem;
  font-size: 0.9rem;
  border: 1px solid;
  transition: opacity 0.3s ease;
}

.banner.success {
  background-color: #d1edff;
  border-color: #007bff;
  color: #004085;
}

.banner.error {
  background-color: #f8d7da;
  border-color: #dc3545;
  color: #721c24;
}

.banner-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.banner-close {
  background: none;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0;
  margin-left: 0.5rem;
  color: inherit;
}

.banner-close:hover {
  opacity: 0.7;
}

/* Main Content */
.site-content {
  padding: 20px 0;
}

.page-title {
  margin-bottom: 20px;
  color: var(--secondary-color);
  font-size: 1.5rem;
  text-align: center;
}

/* Page Layout */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.header-actions {
  display: flex;
  gap: 10px;
}

/* Cards */
.card {
  background-color: var(--card-background);
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  margin-bottom: 20px;
  padding: 15px;
  overflow: hidden;
}

.card h2 {
  margin-bottom: 12px;
  color: var(--secondary-color);
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 10px;
  font-size: 1.3rem;
}

.card-footer {
  margin-top: 15px;
  padding-top: 15px;
  border-top: 1px solid var(--border-color);
  text-align: right;
}

/* Tables - Mobile first approach */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.data-table th,
.data-table td {
  padding: 6px 4px;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
  vertical-align: middle;
}

.data-table thead th {
  background-color: var(--secondary-color);
  color: var(--light-text);
  font-weight: bold;
  font-size: 0.8rem;
  padding: 8px 4px;
}

.data-table tbody tr:hover {
  background-color: rgba(0, 0, 0, 0.02);
}

.data-table .score {
  font-weight: bold;
  text-align: center;
}

/* Mobile table responsive behavior */
.data-table.desktop-only-table {
  display: none !important;
}

/* Mobile card-based table layout */
.mobile-games-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 15px;
}

.mobile-game-card {
  background-color: var(--card-background);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 12px 15px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.mobile-game-card .game-card-main-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
}

.mobile-game-card .game-card-teams {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.mobile-game-card .team-entry {
  display: flex;
  align-items: center;
  position: relative;
}

.mobile-game-card .team-name {
  font-size: 0.9rem;
  font-weight: 500;
  color: #333;
  flex-grow: 1;
}

.mobile-game-card .team-score {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-color);
  min-width: 25px;
  text-align: right;
  margin-left: 8px;
}

.mobile-game-card .winner-arrow {
  position: absolute;
  right: -20px;
  font-size: 0.9rem;
  color: #666;
}

.mobile-game-card .team-entry.winner .team-score {
  font-weight: 700;
}

.mobile-game-card .game-card-info-action {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
  flex-shrink: 0;
  min-width: 70px;
}

.mobile-game-card .game-time-status .status {
  font-size: 0.75rem;
  font-weight: 600;
  color: #444;
  display: block;
  margin-bottom: 2px;
  text-transform: uppercase;
}

.mobile-game-card .game-time-status .date {
  font-size: 0.7rem;
  color: #666;
}

.mobile-game-card .btn-view-details {
  padding: 5px 10px;
  font-size: 0.75rem;
  min-height: 30px;
  line-height: 1.2;
}

/* Card-style table transformation for general tables */
.data-table:not(.desktop-only-table):not(.mobile-table-view) {
  display: block;
  overflow-x: auto;
  white-space: nowrap;
}

.data-table:not(.desktop-only-table):not(.mobile-table-view) thead,
.data-table:not(.desktop-only-table):not(.mobile-table-view) tbody,
.data-table:not(.desktop-only-table):not(.mobile-table-view) th,
.data-table:not(.desktop-only-table):not(.mobile-table-view) td,
.data-table:not(.desktop-only-table):not(.mobile-table-view) tr {
  display: block;
}

.data-table:not(.desktop-only-table):not(.mobile-table-view) thead tr {
  position: absolute;
  top: -9999px;
  left: -9999px;
}

.data-table:not(.desktop-only-table):not(.mobile-table-view) tr {
  border: 1px solid var(--border-color);
  margin-bottom: 15px;
  border-radius: 6px;
  background-color: var(--card-background);
  padding: 15px;
}

.data-table:not(.desktop-only-table):not(.mobile-table-view) td {
  border: none;
  padding: 8px 0;
  position: relative;
  padding-left: 40%;
  text-align: right;
  white-space: normal;
}

.data-table:not(.desktop-only-table):not(.mobile-table-view) td:before {
  content: attr(data-label) ": ";
  position: absolute;
  left: 6px;
  width: 35%;
  padding-right: 10px;
  white-space: nowrap;
  font-weight: bold;
  text-align: left;
  color: var(--secondary-color);
}

/* Mobile table view - maintain table structure */
.mobile-table-view.data-table {
  display: table;
  width: 100%;
}

.mobile-table-view.data-table thead,
.mobile-table-view.data-table tbody,
.mobile-table-view.data-table tfoot {
  display: table-row-group;
}

.mobile-table-view.data-table thead {
  display: table-header-group;
}

.mobile-table-view.data-table thead tr {
  position: static;
  top: auto;
  left: auto;
  display: table-row;
}

.mobile-table-view.data-table tr {
  display: table-row;
  border: none;
  margin: 0;
  padding: 0;
  background: transparent;
  border-radius: 0;
}

.mobile-table-view.data-table th,
.mobile-table-view.data-table td {
  display: table-cell;
  border-bottom: 1px solid var(--border-color);
  position: static;
  text-align: left;
}

.mobile-table-view.data-table td:before {
  display: none;
}

.mobile-table-view.data-table .text-center {
  text-align: center;
}

/* Hide specific columns on mobile - only apply on mobile devices */
@media screen and (max-width: 480px) {
  .mobile-table-view.data-table th.col-position,
  .mobile-table-view.data-table th.col-height,
  .mobile-table-view.data-table th.col-weight,
  .mobile-table-view.data-table th.col-year,
  .mobile-table-view.data-table th.col-display-name,
  .mobile-table-view.data-table th.col-players,
  .mobile-table-view.data-table td.col-position,
  .mobile-table-view.data-table td.col-height,
  .mobile-table-view.data-table td.col-weight,
  .mobile-table-view.data-table td.col-year,
  .mobile-table-view.data-table td.col-display-name,
  .mobile-table-view.data-table td.col-players {
    display: none;
  }
}

/* Buttons - Mobile first */
.btn, .action-btn {
  display: inline-block;
  background-color: var(--primary-color);
  color: var(--light-text);
  padding: 12px 20px;
  border-radius: 6px;
  text-decoration: none;
  border: none;
  cursor: pointer;
  font-weight: bold;
  transition: background-color 0.2s;
  font-size: 0.95rem;
  min-height: var(--touch-target-min);
}

.btn:hover {
  background-color: var(--accent-color);
}

.btn-sm {
  padding: 8px 15px;
  font-size: 0.85rem;
  min-height: 36px;
}

.btn-primary {
  background-color: var(--primary-color);
}

.btn-primary:hover {
  background-color: var(--accent-color);
}

.btn-success {
  background-color: var(--success-color);
}

.btn-success:hover {
  background-color: #218838;
}

.btn + .btn {
  margin-left: 0;
  margin-top: 0.5rem;
}

/* Action Buttons */
.action-buttons {
  display: grid;
  grid-template-columns: 1fr;
  gap: 15px;
  justify-content: stretch;
}

.action-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-width: auto;
  padding: 20px 15px;
  text-align: center;
  font-size: 0.95rem;
}

.action-btn .icon {
  font-size: 1.8rem;
  margin-bottom: 8px;
}

/* Quick Actions */
.quick-actions-top {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
  margin-bottom: 20px;
  padding: 15px 0;
  border-bottom: 1px solid var(--border-color);
}

.quick-action-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background-color: var(--primary-color);
  color: var(--light-text);
  padding: 15px 20px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 500;
  transition: all 0.2s ease;
  width: 100%;
  min-height: 50px;
  justify-content: center;
  font-size: 1rem;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  border: 1px solid transparent;
}

.quick-action-btn:hover {
  background-color: var(--accent-color);
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.quick-action-btn .icon {
  font-size: 1.4rem;
}

.quick-action-btn .label {
  font-size: 0.9rem;
}

/* Dashboard - Mobile first */
.dashboard {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  align-items: start;
}

.dashboard-section h2 {
  margin-bottom: 20px;
  color: var(--secondary-color);
}

.sidebar {
  order: -1;
}

/* Game layouts */
.game-header {
  text-align: center;
  margin-bottom: 30px;
}

.game-header h2 {
  font-size: 1.5rem;
  color: var(--secondary-color);
}

.game-date {
  color: #666;
  margin-bottom: 10px;
}

.game-score {
  font-size: 1.3rem;
  font-weight: bold;
  color: var(--secondary-color);
}

.game-content-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  align-items: start;
}

.main-content {
  display: grid;
  grid-template-columns: 1fr;
  gap: 30px;
}

/* Old player card styles removed - using shared styles at end of file */

/* Tabs */
.tab-container {
  margin-top: 20px;
}

.tabs {
  display: flex;
  flex-direction: column;
  border-bottom: none;
  gap: 5px;
  margin-bottom: 20px;
}

.tab-btn {
  padding: 15px;
  background-color: var(--card-background);
  border: 1px solid var(--border-color);
  cursor: pointer;
  font-weight: bold;
  color: var(--text-color);
  border-radius: 6px;
  margin-bottom: 5px;
  width: 100%;
}

.tab-btn.active {
  background-color: var(--primary-color);
  color: var(--light-text);
  border-color: var(--primary-color);
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

/* Charts */
.chart-container {
  height: 300px;
  margin: 15px 0;
}

/* Filters */
.filters {
  margin-bottom: 15px;
}

.filter-group {
  margin-bottom: 12px;
}

.filter-group label {
  display: block;
  margin-bottom: 5px;
  font-weight: bold;
}

.filter-select {
  padding: 12px;
  border-radius: 6px;
  border: 1px solid var(--border-color);
  width: 100%;
  max-width: none;
  font-size: 1rem;
}

/* Forms */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
select,
textarea {
  width: 100%;
  padding: 12px;
  font-size: 1rem;
  border-radius: 6px;
  border: 1px solid var(--border-color);
  margin-bottom: 15px;
  min-height: var(--touch-target-min);
  font-family: inherit;
  transition: border-color 0.2s, box-shadow 0.2s;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px rgba(255, 107, 0, 0.1);
}

textarea {
  resize: vertical;
  min-height: 80px;
}

/* Pagination */
.pagination {
  display: flex;
  justify-content: center;
  margin-top: 20px;
  flex-wrap: wrap;
  gap: 5px;
}

.pagination button {
  min-width: var(--touch-target-min);
  min-height: var(--touch-target-min);
  padding: 10px;
  margin: 0;
  border: 1px solid var(--border-color);
  background-color: var(--card-background);
  border-radius: 4px;
  cursor: pointer;
}

.pagination button.active {
  background-color: var(--primary-color);
  color: var(--light-text);
  border-color: var(--primary-color);
}

/* Messages */
.loading-message,
.error-message {
  text-align: center;
  padding: 15px;
  font-size: 0.95rem;
  color: #777;
}

.error-message {
  color: var(--error-color);
}

/* Touch targets */
a, button, input, select, textarea {
  min-height: var(--touch-target-min);
  touch-action: manipulation;
}

.main-nav a, .main-nav .dropdown-toggle, .dropdown-menu a {
  min-height: var(--touch-target-min);
}

/* Utility classes */
.desktop-only {
  display: none !important;
}

.mobile-hidden { display: none !important; }
.mobile-visible { display: block !important; }
.mobile-center { text-align: center !important; }
.mobile-full-width { width: 100% !important; }


.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  margin-bottom: 6px;
  font-weight: 500;
  color: var(--text-color);
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  font-size: 14px;
  font-family: inherit;
  transition: border-color 0.2s, box-shadow 0.2s;
  margin-bottom: 0;
}

.form-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--border-color);
  flex-direction: column;
}

.form-actions .btn {
  width: 100%;
  min-width: 80px;
}

/* Stats Cards Component */
.stats-card {
  margin-bottom: 30px;
}

.stats-card .card-header {
  background-color: var(--secondary-color);
  color: var(--light-text);
  padding: 15px 20px;
  margin: -15px -15px 15px -15px;
  border-radius: 6px 6px 0 0;
}

.stats-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 15px;
}

.stat-item {
  text-align: center;
  padding: 15px;
  background-color: #f8f9fa;
  border-radius: 6px;
  border: 1px solid var(--border-color);
}

.stat-item.stat-highlight {
  background-color: rgba(255, 107, 0, 0.1);
  border-color: var(--primary-color);
}

.stat-label {
  font-size: 0.85rem;
  color: #666;
  margin-bottom: 5px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-value {
  font-size: 1.5rem;
  font-weight: bold;
  color: var(--secondary-color);
  margin-bottom: 3px;
}

.stat-unit {
  font-size: 0.8rem;
  color: #666;
  font-weight: normal;
}

.stat-subtext {
  font-size: 0.75rem;
  color: #888;
  margin-top: 3px;
}

/* Footer */
.site-footer {
  background-color: var(--secondary-color);
  color: var(--light-text);
  padding: 15px 0;
  text-align: center;
  margin-top: 30px;
}

.site-footer .version-info {
  display: block;
  margin-top: 5px;
  font-size: 0.75rem;
  opacity: 0.7;
  font-family: monospace;
}

/* Body scroll lock when mobile menu is open */
body.mobile-menu-active {
  overflow: hidden;
}

/* RESPONSIVE BREAKPOINTS */

/* Smartphone Landscape (481px - 767px) */
@media screen and (min-width: 481px) and (max-width: 767px) {
  /* Show desktop tables, hide mobile games list */
  .mobile-games-list {
    display: none !important;
  }
  
  .data-table.desktop-only-table {
    display: table !important;
    width: 100%;
    border-collapse: collapse;
  }
  
  .data-table.desktop-only-table th,
  .data-table.desktop-only-table td {
    display: table-cell;
  }
  
  .data-table.desktop-only-table tr {
    display: table-row;
  }
  
  .data-table.desktop-only-table thead {
    display: table-header-group;
  }
  
  .data-table.desktop-only-table tbody {
    display: table-row-group;
  }

  /* Adjust mobile menu button for landscape */
  .mobile-menu-btn {
    width: 35px;
    height: 35px;
    font-size: 1.4rem;
    right: 20px;
  }

  /* Reduce touch targets slightly */
  :root {
    --touch-target-min: var(--touch-target-landscape);
  }

  /* Quick actions layout */
  .quick-actions-top {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 15px;
  }

  .quick-action-btn {
    width: auto;
    min-width: 150px;
  }

  /* Action buttons grid */
  .action-buttons {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
  }

  /* Tables restore normal behavior */
  .data-table:not(.desktop-only-table):not(.mobile-table-view) {
    display: table;
    overflow-x: auto;
    font-size: 0.9rem;
  }

  .data-table:not(.desktop-only-table):not(.mobile-table-view) thead,
  .data-table:not(.desktop-only-table):not(.mobile-table-view) tbody,
  .data-table:not(.desktop-only-table):not(.mobile-table-view) th,
  .data-table:not(.desktop-only-table):not(.mobile-table-view) td,
  .data-table:not(.desktop-only-table):not(.mobile-table-view) tr {
    display: table-row-group;
  }

  .data-table:not(.desktop-only-table):not(.mobile-table-view) thead {
    display: table-header-group;
  }

  .data-table:not(.desktop-only-table):not(.mobile-table-view) tr {
    display: table-row;
    border: none;
    margin: 0;
    padding: 0;
    background: transparent;
    border-radius: 0;
  }

  .data-table:not(.desktop-only-table):not(.mobile-table-view) th,
  .data-table:not(.desktop-only-table):not(.mobile-table-view) td {
    display: table-cell;
    border-bottom: 1px solid var(--border-color);
    padding: 8px 12px;
    position: static;
    text-align: left;
  }

  .data-table:not(.desktop-only-table):not(.mobile-table-view) td:before {
    display: none;
  }
}

/* Tablet Portrait (768px - 1024px, portrait) */
@media screen and (min-width: 768px) and (max-width: 1024px) and (orientation: portrait) {
  .container {
    padding: 0 20px;
  }

  /* Hide mobile menu button */
  .mobile-menu-btn {
    display: none;
  }

  /* Restore desktop navigation */
  .main-nav {
    display: flex;
    flex: 1;
    justify-content: center;
    align-items: center;
    margin: 0 20px;
    position: static;
    background: transparent;
    border: none;
    padding: 0;
    max-height: none;
    overflow: visible;
    width: auto;
  }

  .main-nav ul {
    flex-direction: row;
    align-items: center;
    gap: 10px;
    width: auto;
  }

  .main-nav li {
    margin-left: 20px;
    width: auto;
    text-align: left;
    border: none;
  }

  .main-nav li:first-child {
    margin-left: 0;
  }

  .main-nav a,
  .main-nav .dropdown-toggle {
    padding: 5px 10px;
    width: auto;
    font-size: 0.9rem;
    border-radius: 4px;
  }

  .nav-divider {
    display: block;
    width: 1px;
    height: 20px;
    background-color: rgba(255, 255, 255, 0.3);
    margin: 0 10px;
  }

  /* Desktop dropdown behavior */
  .nav-dropdown {
    width: auto;
  }

  .dropdown-toggle {
    width: auto;
    text-align: left;
    min-width: 120px;
  }

  .dropdown-menu {
    position: absolute !important;
    display: none !important;
    top: 100%;
    left: 0;
    background-color: var(--card-background);
    min-width: 200px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    border-radius: 4px;
    z-index: 1000;
    border: 1px solid var(--border-color);
    margin-top: 5px;
    padding: 0;
  }

  .nav-dropdown:hover .dropdown-menu {
    display: block !important;
  }

  .dropdown-menu:hover {
    display: block !important;
  }

  .dropdown-menu a {
    color: var(--text-color);
    padding: 12px 16px;
    font-size: 0.9rem;
  }

  .dropdown-menu a:hover {
    background-color: rgba(255, 107, 0, 0.1);
  }

  /* Typography scaling */
  h1 { font-size: 1.8rem; }
  h2 { font-size: 1.6rem; }
  h3 { font-size: 1.4rem; }

  .site-title a { font-size: 1.4rem; }
  .page-title { font-size: 1.8rem; }

  /* Content adjustments */
  .site-content {
    padding: 30px 0;
  }

  .card {
    padding: 20px;
    margin-bottom: 25px;
  }

  /* Action buttons */
  .action-buttons {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  }

  /* Tablet touch targets */
  :root {
    --touch-target-min: var(--touch-target-tablet);
  }

  /* Tabs horizontal */
  .tabs {
    flex-direction: row;
    border-bottom: 1px solid var(--border-color);
    gap: 0;
  }

  .tab-btn {
    width: auto;
    padding: 10px 20px;
    border-radius: 0;
    border: none;
    border-bottom: 3px solid transparent;
    background: transparent;
    margin: 0;
  }

  .tab-btn.active {
    background: transparent;
    color: var(--primary-color);
    border-bottom: 3px solid var(--primary-color);
  }

  /* Forms can start using columns */
  .form-row {
    display: flex;
    gap: 15px;
  }

  .form-row > * {
    flex: 1;
  }

  .form-actions {
    flex-direction: row;
    justify-content: flex-end;
  }

  .form-actions .btn {
    width: auto;
  }

  /* Stats grid */
  .stats-grid {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  }
}

/* Tablet Landscape (768px - 1024px, landscape) */
@media screen and (min-width: 768px) and (max-width: 1024px) and (orientation: landscape) {
  /* Inherit tablet portrait styles and override specific items */
  .container {
    padding: 0 20px;
  }

  /* Navigation with more spacing */
  .main-nav ul {
    gap: 15px;
  }

  .main-nav a,
  .main-nav .dropdown-toggle {
    font-size: 1rem;
  }

  /* Dashboard can use desktop-like layout */
  .dashboard {
    grid-template-columns: 2fr 1fr;
    gap: 25px;
  }

  .sidebar {
    order: 0;
  }

  .game-content-grid {
    grid-template-columns: 2fr 1fr;
    gap: 25px;
  }

  /* Action buttons three-column override */
  .action-buttons {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  }

  /* Top players horizontal layout */
  .top-players-container {
    flex-direction: row;
    gap: 20px;
  }

  .top-player-box {
    flex: 1;
    flex-direction: column;
    text-align: center;
  }

  /* Chart can be larger */
  .chart-container {
    height: 350px;
  }
}

/* Desktop (1025px+) */
@media screen and (min-width: 1025px) {
  .container {
    padding: 0 20px;
  }

  /* Hide mobile menu button */
  .mobile-menu-btn {
    display: none;
  }

  /* Full desktop navigation */
  .site-header {
    padding: 15px 0;
  }

  .site-header .container {
    flex-wrap: nowrap;
    gap: 20px;
    min-height: 60px;
  }

  .site-title {
    flex-shrink: 0;
    width: auto;
    text-align: left;
  }

  .site-title a {
    font-size: 1.5rem;
  }

  .main-nav {
    display: flex;
    flex: 1;
    justify-content: center;
    align-items: center;
    margin: 0 20px;
    position: static;
    background: transparent;
    border: none;
    padding: 0;
    max-height: none;
    overflow: visible;
    width: auto;
  }

  .main-nav ul {
    flex-direction: row;
    align-items: center;
    gap: 0;
    width: auto;
  }

  .main-nav li {
    margin-left: 20px;
    width: auto;
    text-align: left;
    border: none;
  }

  .main-nav li:first-child {
    margin-left: 0;
  }

  .main-nav a,
  .main-nav .dropdown-toggle {
    padding: 5px 10px;
    width: auto;
    font-size: 1rem;
    border-radius: 4px;
  }

  .nav-divider {
    display: block;
    width: 1px;
    height: 20px;
    background-color: rgba(255, 255, 255, 0.3);
    margin: 0 10px;
  }

  /* Desktop dropdown behavior */
  .nav-dropdown {
    width: auto;
  }

  .dropdown-toggle {
    width: auto;
    text-align: left;
    min-width: 120px;
  }

  .dropdown-menu {
    position: absolute !important;
    display: none !important;
    top: 100%;
    left: 0;
    background-color: var(--card-background);
    min-width: 200px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    border-radius: 4px;
    z-index: 1000;
    border: 1px solid var(--border-color);
    margin-top: 5px;
    padding: 0;
  }

  .nav-dropdown:hover .dropdown-menu {
    display: block !important;
  }

  .dropdown-menu:hover {
    display: block !important;
  }

  .dropdown-menu a {
    color: var(--text-color);
    padding: 12px 16px;
    font-size: 1rem;
  }

  .dropdown-menu a:hover {
    background-color: rgba(255, 107, 0, 0.1);
  }

  /* Beta banner */
  .beta-banner {
    padding: 12px 0;
    font-size: 1rem;
  }

  .beta-banner .container {
    flex-direction: row;
    gap: 10px;
  }

  /* Typography scaling */
  h1 { font-size: 2.2rem; }
  h2 { font-size: 1.8rem; }
  h3 { font-size: 1.5rem; }
  h4 { font-size: 1.3rem; }
  h5 { font-size: 1.1rem; }
  h6 { font-size: 1rem; }

  .page-title {
    font-size: 2rem;
    text-align: left;
    margin-bottom: 30px;
  }

  /* Content */
  .site-content {
    padding: 40px 0;
  }

  .card {
    padding: 20px;
    margin-bottom: 30px;
    border-radius: 8px;
  }

  .card h2 {
    font-size: 1.5rem;
    margin-bottom: 15px;
  }

  /* Tables */
  .data-table {
    font-size: 1rem;
  }

  .data-table th,
  .data-table td {
    padding: 12px 15px;
  }

  /* Always show desktop table */
  .mobile-games-list {
    display: none !important;
  }
  
  .data-table.desktop-only-table {
    display: table !important;
    width: 100%;
    border-collapse: collapse;
  }

  /* Buttons */
  .btn, .action-btn {
    padding: 8px 16px;
    font-size: 1rem;
    border-radius: 4px;
  }

  .btn + .btn {
    margin-left: 0.5rem;
    margin-top: 0;
  }

  /* Action buttons */
  .action-buttons {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    grid-template-columns: none;
  }

  .action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 120px;
    padding: 20px;
    text-align: center;
    width: auto;
    font-size: 1rem;
  }

  .action-btn .icon {
    font-size: 2rem;
    margin-bottom: 10px;
  }

  /* Quick actions */
  .quick-actions-top {
    flex-direction: row;
    gap: 20px;
    justify-content: center;
    align-items: center;
  }

  .quick-action-btn {
    width: auto;
    min-width: auto;
    padding: 12px 20px;
    min-height: auto;
  }

  /* Layouts */
  .dashboard {
    grid-template-columns: 1fr 320px;
    gap: 30px;
  }

  .sidebar {
    order: 0;
  }

  .game-content-grid {
    grid-template-columns: 1fr 320px;
    gap: 30px;
  }

  /* Game header */
  .game-header h2 {
    font-size: 2rem;
  }

  .game-score {
    font-size: 1.5rem;
  }

  /* Top players - removed desktop overrides, using shared styles */

  /* Tabs */
  .tabs {
    flex-direction: row;
    border-bottom: 1px solid var(--border-color);
    gap: 0;
  }

  .tab-btn {
    width: auto;
    padding: 10px 20px;
    border-radius: 0;
    border: none;
    border-bottom: 3px solid transparent;
    background: transparent;
    margin: 0;
  }

  .tab-btn.active {
    background: transparent;
    color: var(--primary-color);
    border-bottom: 3px solid var(--primary-color);
  }

  /* Charts */
  .chart-container {
    height: 400px;
    margin: 20px 0;
  }

  /* Filters */
  .filter-select {
    max-width: 300px;
    width: auto;
    font-size: 1rem;
    padding: 8px 12px;
  }

  /* Forms */
  .form-row {
    display: flex;
    gap: 20px;
  }

  .form-row > * {
    flex: 1;
  }

  .form-actions {
    flex-direction: row;
    justify-content: flex-end;
  }

  .form-actions .btn {
    width: auto;
  }

  /* Modal */
  .modal-content {
    width: 90%;
    margin: auto;
  }

  .modal-header,
  .modal form {
    padding-left: 24px;
    padding-right: 24px;
  }

  /* Stats grid */
  .stats-grid {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  }

  /* Footer */
  .site-footer {
    padding: 20px 0;
    margin-top: 40px;
  }

  .site-footer .version-info {
    display: inline;
    margin-top: 0;
    font-size: 0.85rem;
  }

  /* Utility classes */
  .desktop-only {
    display: block !important;
  }

  /* Override mobile utility classes for desktop */
  .mobile-hidden { display: block !important; }
  .mobile-visible { display: none !important; }
}

/* ============================================================================
   Player Card Styles (Game Leaders / Players of the Week)
   ============================================================================ */

/* Player card container - mobile first */
.top-players-container {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.top-player-box {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  border: 1px solid #dee2e6;
  border-radius: 8px;
  background: #f8f9fa;
}

.player-photo-placeholder {
  flex-shrink: 0;
}

.player-info {
  flex: 1;
  min-width: 0;
}

.player-info .team-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: #6c757d;
  margin: 0 0 0.25rem 0;
}

.player-info .player-name {
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 0.25rem 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.player-info .player-stats {
  font-size: 0.85rem;
  color: #6c757d;
  margin: 0;
  line-height: 1.3;
}

.player-info .game-info {
  font-size: 0.8rem;
  color: #6c757d;
  margin: 0 0 0.25rem 0;
  font-style: italic;
}

/* Mobile styles for smartphone portrait */
@media screen and (max-width: 480px) and (orientation: portrait) {
  /* Player cards - 2x2 grid on mobile */
  .top-players-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    gap: 0.75rem;
  }
  
  .top-player-box {
    flex-direction: column;
    text-align: center;
    padding: 0.5rem;
    gap: 0.5rem;
  }
  
  .player-info .team-name {
    font-size: 0.75rem;
  }
  
  .player-info .player-name {
    font-size: 0.9rem;
  }
  
  .player-info .player-stats {
    font-size: 0.75rem;
  }
  
  .player-info .game-info {
    font-size: 0.7rem;
  }
}