/* Modern Flyers Theme - Premium Design */
:root {
  /* Colors */
  --primary-color: #F74902; /* Flyers Orange */
  --primary-hover: #D63E02;
  --primary-light: rgba(247, 73, 2, 0.1);
  
  --bg-color: #F4F4F5; /* Light Gray Background */
  --bg-hover: #FAFAFA;
  --surface-color: #FFFFFF;
  
  --text-color: #18181B; /* Zinc 900 */
  --text-secondary: #52525B; /* Zinc 600 */
  --text-muted: #A1A1AA;
  
  --border-color: #E4E4E7; /* Zinc 200 */
  
  --header-bg: #09090B; /* Zinc 950 */
  --header-text: #FFFFFF;
  
  /* Shadows based on Tailwind/Modern standards */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
  
  /* Layout */
  --radius: 0.5rem;
  --max-width: 1200px;
  
  /* Typography */
  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-color);
  color: var(--text-color);
  margin: 0;
  padding: 0;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* Header */
.app-header {
  background-color: var(--header-bg);
  color: var(--header-text);
  padding: 0.75rem 0;
  box-shadow: var(--shadow-md);
  border-bottom: 3px solid var(--primary-color);
  position: sticky;
  top: 0;
  z-index: 50;
}

.header-content {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.app-branding {
  display: flex;
  align-items: center;
  gap: 1rem;
  text-decoration: none;
  color: white;
}

.app-branding:hover {
  text-decoration: none;
  color: white;
}

.app-logo {
  height: 40px;
  width: auto;
  transition: transform 0.2s ease;
}

.app-branding:hover .app-logo {
  transform: scale(1.05);
}

.app-title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.025em;
}

/* Navigation */
.nav-menu {
  display: flex;
  gap: 2rem;
}

.nav-link {
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  transition: color 0.2s ease;
  padding: 0.25rem 0;
  border-bottom: 2px solid transparent;
}

.nav-link:hover,
.nav-link.active {
  color: white;
}

.nav-link.active {
  border-bottom-color: var(--primary-color);
}

/* Layout */
.app-container {
  max-width: var(--max-width);
  margin: 2rem auto;
  padding: 0 1.5rem;
}

/* Page Title with Action */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.page-title {
  margin: 0;
  font-size: 1.875rem;
  font-weight: 700;
  color: var(--text-color);
  letter-spacing: -0.025em;
}

/* Cards */
.card {
  background: var(--surface-color);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
  margin-bottom: 1.5rem;
  overflow: hidden;
  transition: box-shadow 0.2s ease;
}

.card:hover {
  box-shadow: var(--shadow-md);
}

.card-header {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
  background-color: #FAFAFA;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.card-header h2 {
  margin: 0;
  font-size: 0.875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
}

.card-body {
  padding: 1.5rem;
}

/* Typography Helpers */
.text-success { color: #16A34A; font-weight: 600; }
.text-warning { color: #D97706; font-weight: 600; }
.text-danger { color: #DC2626; font-weight: 600; }
.text-muted { color: var(--text-muted); }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
  font-weight: 500;
  font-size: 0.9rem;
  cursor: pointer;
  border: 1px solid transparent;
  width: auto;
  transition: all 0.2s;
  text-decoration: none;
}

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

.btn-primary:hover {
  background-color: var(--primary-hover);
  box-shadow: 0 2px 4px rgba(247, 73, 2, 0.2);
}

.btn-secondary {
  background-color: white;
  color: var(--text-color);
  border-color: var(--border-color);
}

.btn-secondary:hover {
  background-color: #F4F4F5;
  border-color: #D4D4D8;
}

.btn-sm {
  padding: 0.25rem 0.75rem;
  font-size: 0.8rem;
}

/* Form Controls */
.control-group {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  align-items: flex-end;
  margin-bottom: 1rem;
}

.input-wrapper {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
}

select, input[type="text"] {
  height: 40px;
  padding: 0 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  background-color: white;
  font-size: 0.95rem;
  color: var(--text-color);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  min-width: 120px;
}

select:focus, input[type="text"]:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px var(--primary-light);
}

/* Game State Expandable Menu (Custom) */
.game-state-wrapper {
  position: relative;
  height: 40px;
  width: 140px;
}

.game-state-select {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  max-height: 40px;
  overflow: hidden;
  z-index: 20;
  padding: 0.5rem;
  background: white;
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  transition: max-height 0.2s ease, box-shadow 0.2s;
}

.game-state-select:hover, .game-state-select:focus {
  max-height: 250px;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  border-color: var(--primary-color);
}
.game-state-select:not(:hover):not(:focus)::-webkit-scrollbar { display: none; }

/* Tables */
table {
  width: 100%;
  border-collapse: collapse;
}

th {
  text-align: left;
  padding: 0.75rem 1rem;
  border-bottom: 2px solid var(--border-color);
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.875rem;
  background-color: #FAFAFA;
}

td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.95rem;
}

tr:last-child td { border-bottom: none; }
tr:hover td { background-color: #FAFAFA; }

/* Plots */
.plot-container {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 350px;
  padding: 1rem;
  background-color: white;
}

.plot-container img {
  max-width: 100%;
  height: auto;
  border-radius: 4px;
  box-shadow: var(--shadow-sm);
}

/* Utilities */
.divider {
  border: 0;
  border-top: 1px solid var(--border-color);
  margin: 1.5rem 0;
}

.empty-state {
  color: var(--text-muted);
  font-style: italic;
  text-align: center;
  padding: 3rem;
}

.code-snippet {
    background: #27272A;
    color: #E4E4E7;
    padding: 1rem;
    border-radius: var(--radius);
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    font-size: 0.875rem;
    overflow-x: auto;
    margin-bottom: 1rem;
    border: 1px solid #3F3F46;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
  .header-content {
    flex-direction: column;
    gap: 1rem;
    padding: 0 1rem;
  }
  
  .nav-menu {
    gap: 1rem;
    width: 100%;
    justify-content: center;
    overflow-x: auto;
    padding-bottom: 5px;
  }
  
  .app-container {
    padding: 0 1rem;
    margin: 1.5rem auto;
  }

  .control-group {
    flex-direction: column;
    align-items: stretch;
    gap: 1rem;
  }

  .input-wrapper, select, input[type="text"], .game-state-wrapper {
    width: 100% !important;
  }
  
  .action-group {
    flex-direction: column-reverse;
  }
  
  .btn { width: 100%; }
}

/* Pagination */
.pagination { 
  display: flex; 
  justify-content: center; 
  gap: 0.5rem; 
  margin-top: 1.5rem; 
}

.pagination button { 
  padding: 0.5rem 1rem; 
  border: 1px solid var(--border-color); 
  background: white; 
  border-radius: var(--radius); 
  cursor: pointer; 
  transition: all 0.2s; 
  font-size: 0.9rem; 
  color: var(--text-color);
}

.pagination button:hover:not(:disabled) { 
  border-color: var(--primary-color); 
  color: var(--primary-color); 
}

.pagination button:disabled { 
  opacity: 0.5; 
  cursor: not-allowed; 
}

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

/* Sortable Headers */
th.sorted-asc::after { content: " ▲"; font-size: 0.7em; margin-left: 4px; }
th.sorted-desc::after { content: " ▼"; font-size: 0.7em; margin-left: 4px; }
th { cursor: pointer; user-select: none; }

/* Numeric Columns */
.num { 
  text-align: right; 
  font-variant-numeric: tabular-nums; 
}

/* Tabs */
.tabs { 
  display: flex; 
  gap: 1rem; 
  border-bottom: 1px solid var(--border-color); 
  margin-bottom: 1.5rem; 
  overflow-x: auto;
}

.tab { 
  padding: 0.75rem 1.5rem; 
  text-decoration: none; 
  color: var(--text-secondary); 
  font-weight: 500; 
  border-bottom: 2px solid transparent; 
  transition: all 0.2s; 
  white-space: nowrap;
}

.tab:hover { 
  color: var(--primary-color); 
}

.tab.active { 
  color: var(--primary-color); 
  border-bottom-color: var(--primary-color); 
  font-weight: 600; 
}
