/* Modern Professional Styling for Badminton Court Planner */

:root {
  /* Primary colors - Clean blue theme */
  --primary-color: #1e40af;
  --primary-dark: #1e3a8a;
  --primary-light: #3b82f6;
  --primary-lighter: #dbeafe;
  
  /* Secondary colors - Fresh green accent */
  --secondary-color: #059669;
  --secondary-dark: #047857;
  --secondary-light: #10b981;
  --secondary-lighter: #d1fae5;
  
  /* Accent colors */
  --accent-color: #f59e0b;
  --accent-dark: #d97706;
  
  /* Status colors */
  --success-color: #10b981;
  --danger-color: #ef4444;
  --warning-color: #f59e0b;
  --info-color: #3b82f6;
  
  /* Neutral colors */
  --text-primary: #111827;
  --text-secondary: #6b7280;
  --text-light: #9ca3af;
  --text-white: #ffffff;
  
  /* Background colors */
  --bg-primary: #ffffff;
  --bg-secondary: #f8fafc;
  --bg-tertiary: #f1f5f9;
  --bg-dark: #1f2937;
  
  /* Border and shadow */
  --border-color: #e2e8f0;
  --border-light: #f1f5f9;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  
  --border-radius: 8px;
  --border-radius-lg: 12px;
  --transition: all 0.2s ease-in-out;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  line-height: 1.6;
  color: var(--text-primary);
  background-color: var(--bg-secondary);
  font-size: 14px;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: 0.5rem;
}

h1 { font-size: 2.25rem; }
h2 { font-size: 1.875rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }

p {
  margin-bottom: 1rem;
  color: var(--text-secondary);
}

/* Layout */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

.header {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
  color: white;
  padding: 2rem 0;
  box-shadow: var(--shadow-md);
}

.header h1 {
  margin: 0;
  font-size: 2rem;
  font-weight: 700;
}

.header .subtitle {
  color: rgba(255, 255, 255, 0.9);
  font-size: 1.1rem;
  margin-top: 0.5rem;
}

/* Navigation */
.nav {
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border-color);
  padding: 0;
  box-shadow: var(--shadow);
}

.nav-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem;
}

.nav-brand {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary-color);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nav-brand i {
  color: var(--secondary-color);
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 2rem;
  margin: 0;
}

.nav-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 500;
  transition: var(--transition);
  padding: 0.5rem 1rem;
  border-radius: var(--border-radius);
}

.nav-links a:hover {
  color: var(--primary-color);
  background-color: var(--bg-secondary);
}

/* Cards */
.card {
  background: var(--bg-primary);
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow);
  border: 1px solid var(--border-color);
  overflow: hidden;
  transition: var(--transition);
}

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

.card-header {
  padding: 1.5rem;
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-secondary);
}

.card-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 0;
  color: var(--text-primary);
}

.card-body {
  padding: 1.5rem;
}

.card-footer {
  padding: 1rem 1.5rem;
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
}

/* Grid System */
.grid {
  display: grid;
  gap: 1.5rem;
}

.grid-cols-1 { grid-template-columns: 1fr; }
.grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid-cols-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 768px) {
  .grid-cols-2, .grid-cols-3, .grid-cols-4 {
    grid-template-columns: 1fr;
  }
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: 16px;
  border: 2px solid transparent;
  transition: var(--transition);
  cursor: pointer;
  text-decoration: none;
  min-height: 2.75rem;
  gap: 0.5rem;
  font-family: inherit;
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
  color: white;
  border-color: transparent;
  box-shadow: var(--shadow);
}

.btn-primary:hover:not(:disabled) {
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-color) 100%);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

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

.btn-secondary:hover:not(:disabled) {
  background: var(--bg-secondary);
}

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

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

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

.btn-sm {
  padding: 0.5rem 1rem;
  font-size: 0.75rem;
  min-height: 2rem;
}

.btn-lg {
  padding: 1.25rem 2rem;
  font-size: 1rem;
  min-height: 3.5rem;
}

.btn-block {
  width: 100%;
  justify-content: center;
}

.btn-text,
.btn-loading {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Forms */
.form-group {
  margin-bottom: 1.5rem;
}

.form-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  color: var(--text-primary);
  font-size: 0.875rem;
}

.form-label i {
  color: var(--primary-color);
  width: 1rem;
  flex-shrink: 0;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 1rem 1.25rem;
  border: 2px solid var(--border-color);
  border-radius: 16px;
  font-size: 0.9rem;
  transition: all 0.2s ease;
  background: var(--bg-primary);
  font-family: inherit;
  line-height: 1.5;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 4px rgba(30, 64, 175, 0.1);
  transform: translateY(-1px);
}

.form-input::placeholder {
  color: var(--text-light);
  font-size: 0.875rem;
}

.form-hint {
  margin-top: 0.75rem;
  padding: 0.75rem 1rem;
  background: var(--bg-secondary);
  border-radius: 12px;
  font-size: 0.8rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border: 1px solid var(--border-light);
}

.form-hint i {
  color: var(--secondary-color);
  flex-shrink: 0;
}

.form-hint strong {
  color: var(--primary-color);
  font-weight: 600;
}

/* Tables */
.table-container {
  background: var(--bg-primary);
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow);
  border: 1px solid var(--border-color);
  overflow: hidden;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.table th,
.table td {
  padding: 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}

.table th {
  background: var(--bg-secondary);
  font-weight: 600;
  color: var(--text-primary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.75rem;
}

.table tbody tr:hover {
  background: var(--bg-secondary);
}

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

/* Status badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 9999px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.badge-success {
  background: var(--secondary-lighter);
  color: var(--secondary-dark);
}

.badge-warning {
  background: rgba(249, 115, 22, 0.1);
  color: var(--warning-color);
}

.badge-danger {
  background: rgba(239, 68, 68, 0.1);
  color: var(--danger-color);
}

.badge-primary {
  background: var(--primary-lighter);
  color: var(--primary-dark);
}

/* Alerts */
.alert {
  padding: 1rem 1.25rem;
  border-radius: 12px;
  margin-bottom: 1.5rem;
  border-left: 4px solid;
  font-size: 0.875rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.alert i {
  flex-shrink: 0;
}

.alert-success {
  background: var(--secondary-lighter);
  border-left-color: var(--secondary-color);
  color: var(--secondary-dark);
}

.alert-danger {
  background: #fef2f2;
  border-left-color: var(--danger-color);
  color: #991b1b;
}

.alert-warning {
  background: #fffbeb;
  border-left-color: var(--warning-color);
  color: #92400e;
}

.alert-info {
  background: var(--primary-lighter);
  border-left-color: var(--primary-color);
  color: var(--primary-dark);
}

/* Stats Cards */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: linear-gradient(135deg, var(--secondary-color) 0%, var(--secondary-dark) 100%);
  color: white;
  padding: 2rem;
  border-radius: var(--border-radius-lg);
  text-align: center;
  box-shadow: var(--shadow-md);
}

.stat-value {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.stat-label {
  font-size: 0.875rem;
  opacity: 0.9;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Loading and animations */
.loading {
  display: inline-block;
  width: 1rem;
  height: 1rem;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: currentColor;
  animation: spin 0.8s linear infinite;
}

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

.fade-in {
  animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
  from { 
    opacity: 0; 
    transform: translateY(10px); 
  }
  to { 
    opacity: 1; 
    transform: translateY(0); 
  }
}

/* Login Page Specific Styles */
.login-container {
  min-height: 100vh;
  background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 50%, #cbd5e1 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.login-wrapper {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
}

.login-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  background: var(--bg-primary);
  border-radius: 16px;
  box-shadow: var(--shadow-xl);
  overflow: hidden;
  min-height: 600px;
  border: 1px solid var(--border-light);
}

.login-brand {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
  color: var(--text-white);
  padding: 3rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
}

.brand-header {
  text-align: center;
  margin-bottom: 3rem;
  position: relative;
  z-index: 1;
}

.brand-header i {
  font-size: 4rem;
  margin-bottom: 1rem;
  color: var(--text-white);
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.1));
}

.brand-header h1 {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--text-white);
}

.brand-header p {
  font-size: 1.1rem;
  color: rgba(255, 255, 255, 0.9);
  margin: 0;
  line-height: 1.6;
}

.features-list {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  position: relative;
  z-index: 1;
}

.feature-item {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}

.feature-icon {
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(10px);
  width: 3rem;
  height: 3rem;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.feature-icon i {
  font-size: 1.25rem;
  color: var(--text-white);
}

.feature-content h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--text-white);
}

.feature-content p {
  font-size: 0.9rem;
  opacity: 0.9;
  margin: 0;
  line-height: 1.5;
  color: var(--text-white);
}

.login-forms {
  padding: 3rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: var(--bg-primary);
}

.form-container {
  max-width: 400px;
  width: 100%;
  margin: 0 auto;
}

.login-tabs {
  display: flex;
  background: var(--bg-secondary);
  border-radius: 12px;
  padding: 4px;
  margin-bottom: 2rem;
  border: 1px solid var(--border-color);
}

.login-tab {
  flex: 1;
  padding: 0.75rem 1rem;
  background: none;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--text-secondary);
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.login-tab:hover {
  color: var(--primary-color);
  background: rgba(30, 64, 175, 0.05);
}

.login-tab.active {
  background: var(--primary-color);
  color: var(--text-white);
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}

.tab-content h2 {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

.form-subtitle {
  color: var(--text-secondary);
  margin-bottom: 2rem;
  font-size: 0.95rem;
}

#alertContainer {
  margin-bottom: 1rem;
}

/* Dashboard specific */
.dashboard-main {
  padding: 2rem 0;
}

.page-header {
  margin-bottom: 2rem;
}

.page-title {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.page-subtitle {
  color: var(--text-secondary);
  font-size: 1.1rem;
}

/* Responsive utilities */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.p-0 { padding: 0; }
.p-1 { padding: 0.5rem; }
.p-2 { padding: 1rem; }
.p-3 { padding: 1.5rem; }
.p-4 { padding: 2rem; }

/* Mobile responsiveness */
@media (max-width: 768px) {
  .container {
    padding: 0 0.75rem;
  }
  
  .header {
    padding: 1.5rem 0;
  }
  
  .header h1 {
    font-size: 1.5rem;
  }
  
  .nav-container {
    flex-direction: column;
    gap: 1rem;
  }
  
  .nav-links {
    flex-direction: column;
    gap: 0.5rem;
  }
  
  .card-body {
    padding: 1rem;
  }
  
  .btn {
    width: 100%;
    justify-content: center;
  }
  
  .table-container {
    overflow-x: auto;
  }
  
  .stats-grid {
    grid-template-columns: 1fr;
  }
  
  .login-container {
    padding: 1rem;
    background: var(--bg-secondary);
  }
  
  .login-content {
    grid-template-columns: 1fr;
    gap: 0;
    border-radius: 12px;
  }
  
  .login-brand {
    padding: 2rem;
    text-align: center;
  }
  
  .brand-header {
    margin-bottom: 2rem;
  }
  
  .brand-header h1 {
    font-size: 2rem;
  }
  
  .features-list {
    gap: 1.5rem;
  }
  
  .feature-item {
    flex-direction: column;
    text-align: center;
    gap: 0.75rem;
  }
  
  .login-forms {
    padding: 2rem;
  }
  
  .form-input,
  .form-select,
  .form-textarea {
    padding: 0.875rem 1rem;
  }
}

@media (max-width: 480px) {
  .login-tabs {
    flex-direction: column;
    gap: 4px;
  }
  
  .login-tab {
    justify-content: center;
    padding: 0.875rem 1rem;
  }
  
  .brand-header i {
    font-size: 3rem;
  }
  
  .brand-header h1 {
    font-size: 1.75rem;
  }
}

/* Dark mode support (optional) */
@media (prefers-color-scheme: dark) {
  .dark-mode {
    --bg-primary: #1f2937;
    --bg-secondary: #111827;
    --text-primary: #f9fafb;
    --text-secondary: #d1d5db;
    --text-light: #9ca3af;
    --border-color: #374151;
  }
}

/* Dashboard Specific Styles */
.dashboard-container {
    min-height: 100vh;
    background: var(--bg-secondary);
}

.dashboard-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: var(--text-white);
    padding: 2rem 0;
    box-shadow: var(--shadow-md);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 2rem;
}

.dashboard-title {
    font-size: 2.25rem;
    font-weight: 700;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.dashboard-title i {
    color: rgba(255, 255, 255, 0.9);
}

.dashboard-subtitle {
    color: rgba(255, 255, 255, 0.8);
    margin: 0.5rem 0 0 0;
    font-size: 1.1rem;
}

.header-stats {
    display: flex;
    gap: 2rem;
}

.stat-item {
    text-align: center;
    background: rgba(255, 255, 255, 0.1);
    padding: 1rem 1.5rem;
    border-radius: 12px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.stat-item .stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.stat-item .stat-label {
    font-size: 0.8rem;
    opacity: 0.9;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.dashboard-nav {
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

.nav-tabs {
    display: flex;
    gap: 0;
    overflow-x: auto;
    padding: 0.5rem 0;
}

.nav-tab {
    padding: 1rem 1.5rem;
    background: none;
    border: none;
    cursor: pointer;
    font-weight: 600;
    color: var(--text-secondary);
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
    border-bottom: 3px solid transparent;
}

.nav-tab:hover {
    color: var(--primary-color);
    background: var(--bg-secondary);
}

.nav-tab.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
    background: var(--bg-secondary);
}

.dashboard-main {
    padding: 2rem 0;
}

.dashboard-section {
    display: none;
}

.dashboard-section.active {
    display: block;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.section-header h2 {
    font-size: 1.75rem;
    font-weight: 700;
    margin: 0;
}

.section-header p {
    color: var(--text-secondary);
    margin: 0.5rem 0 0 0;
    flex-basis: 100%;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: var(--shadow);
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 1rem;
}

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

.stat-icon {
    width: 3rem;
    height: 3rem;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.25rem;
}

.stat-details .stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.stat-details .stat-label {
    color: var(--text-secondary);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.team-section {
    background: var(--bg-secondary);
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.team-section h3 {
    margin-bottom: 1rem;
    color: var(--text-primary);
    font-size: 1.25rem;
}

.loading-state {
    text-align: center;
    padding: 2rem;
    color: var(--text-secondary);
}

/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: var(--bg-primary);
    border-radius: 16px;
    box-shadow: var(--shadow-xl);
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

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

.modal-header h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.25rem;
    cursor: pointer;
    color: var(--text-secondary);
    padding: 0.5rem;
    border-radius: 8px;
    transition: var(--transition);
}

.modal-close:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.modal-body {
    padding: 1.5rem;
}

/* Mobile responsiveness for dashboard */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        text-align: center;
    }
    
    .header-stats {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .nav-tabs {
        justify-content: flex-start;
    }
    
    .section-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .grid-cols-2 {
        grid-template-columns: 1fr;
    }
    
    .team-section {
        margin-bottom: 1rem;
    }
}

/* Court Organization Styles */
.active-players-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.player-checkbox {
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 1rem;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.player-checkbox:hover {
    border-color: var(--primary-color);
    background: var(--bg-primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.player-checkbox.active {
    border-color: var(--primary-color);
    background: var(--primary-lighter);
}

.player-checkbox input[type="checkbox"] {
    width: 1.25rem;
    height: 1.25rem;
    cursor: pointer;
}

.player-checkbox label {
    cursor: pointer;
    margin: 0;
    flex: 1;
    font-weight: 500;
}

.court-assignment {
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    transition: var(--transition);
}

.court-assignment:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow);
}

.court-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--border-color);
}

.court-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-color);
}

.court-match {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.court-team {
    flex: 1;
    background: var(--bg-primary);
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid var(--border-light);
}

.team-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.team-players {
    font-weight: 600;
    color: var(--text-primary);
}

.vs-separator {
    font-weight: 700;
    font-size: 1.5rem;
    color: var(--text-secondary);
    padding: 0 1rem;
}

.match-balance {
    margin-top: 0.75rem;
    padding: 0.75rem;
    background: var(--primary-lighter);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.match-balance i {
    color: var(--primary-color);
}

.match-balance-text {
    font-size: 0.875rem;
    color: var(--primary-dark);
    font-weight: 600;
}

.recent-game-item {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.recent-game-item:last-child {
    border-bottom: none;
}

.game-teams {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.game-teams .score {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-color);
    padding: 0 1rem;
}

.game-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.mb-3 {
    margin-bottom: 1.5rem;
}

.match-score-input {
    margin-top: 1rem;
    padding: 1rem;
    background: var(--bg-primary);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.score-form {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.score-inputs {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1;
}

.score-input-group {
    flex: 1;
}

.score-input-group label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.score-input {
    width: 100%;
    text-align: center;
    font-size: 1.25rem;
    font-weight: 700;
    padding: 0.75rem;
}

.score-separator {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-secondary);
    padding-top: 1.5rem;
}

@media (max-width: 768px) {
    .score-form {
        flex-direction: column;
    }
    
    .score-inputs {
        width: 100%;
    }
}

/* Subscription Styles */
.current-plan-display {
    display: flex;
    align-items: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.plan-badge {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 1.5rem 2rem;
    border-radius: 12px;
    font-size: 1.5rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.plan-details {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
}

.plan-detail-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.1rem;
    color: var(--text-secondary);
}

.plan-detail-item i {
    color: var(--primary-color);
}

.pricing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.pricing-card {
    background: var(--bg-primary);
    border: 2px solid var(--border-color);
    border-radius: 16px;
    padding: 2rem;
    position: relative;
    transition: var(--transition);
}

.pricing-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-color);
}

.pricing-card.featured {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-md);
}

.popular-badge {
    position: absolute;
    top: -12px;
    right: 20px;
    background: var(--accent-color);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.pricing-header {
    text-align: center;
    padding-bottom: 1.5rem;
    border-bottom: 2px solid var(--border-color);
    margin-bottom: 1.5rem;
}

.pricing-header h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.pricing-price {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 0.25rem;
}

.price-currency {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-secondary);
}

.price-amount {
    font-size: 3rem;
    font-weight: 700;
    color: var(--primary-color);
}

.price-period {
    font-size: 1rem;
    color: var(--text-secondary);
}

.pricing-features {
    margin-bottom: 1.5rem;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 0;
    font-size: 0.95rem;
}

.feature-item i {
    color: var(--success-color);
    font-size: 1rem;
}

.player-checkbox.has-played {
    opacity: 0.6;
}

.played-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.7rem;
    color: var(--success-color);
    margin-left: 0.5rem;
    font-weight: 600;
}

/* Login Page Pricing */
.login-pricing-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.login-pricing-card {
    background: var(--bg-primary);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 1.25rem;
    text-align: center;
    transition: var(--transition);
    position: relative;
}

.login-pricing-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-color);
}

.login-pricing-card.featured {
    border-color: var(--primary-color);
    background: linear-gradient(135deg, rgba(30, 64, 175, 0.05) 0%, rgba(30, 58, 138, 0.05) 100%);
}

.pricing-popular {
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--accent-color);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.pricing-icon {
    width: 3rem;
    height: 3rem;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    color: white;
    font-size: 1.25rem;
}

.pricing-plan-name {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.pricing-plan-price {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.pricing-plan-price span {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.pricing-plan-features {
    text-align: left;
}

.pricing-feature-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
    padding: 0.4rem 0;
}

.pricing-feature-item i {
    color: var(--success-color);
    font-size: 0.75rem;
    flex-shrink: 0;
}

@media (max-width: 768px) {
    .login-pricing-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .login-pricing-card {
        padding: 1rem;
    }
    
    .pricing-plan-price {
        font-size: 1.5rem;
    }
}

.game-count-badge {
    display: inline-block;
    font-size: 0.7rem;
    color: var(--text-secondary);
    margin-left: 0.5rem;
    font-weight: 500;
}

.ranking-toggle {
    display: flex;
    gap: 0.5rem;
}

.ranking-toggle-btn {
    opacity: 0.6;
    transition: var(--transition);
}

.ranking-toggle-btn.active {
    opacity: 1;
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.ranking-toggle-btn:hover {
    opacity: 1;
}

@media (max-width: 768px) {
    .section-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .ranking-toggle {
        margin-top: 1rem;
        width: 100%;
    }
    
    .ranking-toggle-btn {
        flex: 1;
    }
}

/* Demo Timer Bar */
#demoTimerBar {
    background: linear-gradient(135deg, var(--warning-color) 0%, var(--accent-dark) 100%);
    color: white;
    padding: 0.75rem 0;
    box-shadow: var(--shadow);
}

.demo-timer-alert {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.demo-timer-content {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1rem;
    font-weight: 600;
}

.demo-timer-content i {
    font-size: 1.25rem;
}

.demo-timer-info {
    font-size: 0.875rem;
    opacity: 0.9;
}

#demoTimerBar.warning {
    background: linear-gradient(135deg, var(--danger-color) 0%, #dc2626 100%);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.85; }
}

@media (max-width: 768px) {
    .demo-timer-alert {
        flex-direction: column;
        text-align: center;
    }
}

/* Tournament Styles */
.tournament-card {
    background: var(--bg-primary);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    cursor: pointer;
    transition: var(--transition);
}

.tournament-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-color);
}

.tournament-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.tournament-header h4 {
    margin: 0;
    color: var(--text-primary);
}

.tournament-info {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.tournament-stat {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.tournament-stat i {
    color: var(--primary-color);
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal-content {
    background: var(--bg-primary);
    border-radius: 16px;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
}

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

.modal-header h3 {
    margin: 0;
    color: var(--text-primary);
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.5rem;
    line-height: 1;
    transition: var(--transition);
}

.modal-close:hover {
    color: var(--text-primary);
}

.modal-body {
    padding: 1.5rem;
}

/* Team Selection */
.team-row {
    margin-bottom: 0.75rem;
}

.team-row-content {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.team-number {
    min-width: 60px;
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.team-row-content select {
    flex: 1;
}

/* Groups Grid */
.groups-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.group-card {
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
}

.group-header {
    background: var(--primary-color);
    color: white;
    padding: 1rem;
    text-align: center;
}

.group-header h4 {
    margin: 0;
    font-size: 1.25rem;
}

.group-standings {
    padding: 1rem;
}

.standings-table {
    width: 100%;
    border-collapse: collapse;
}

.standings-table th {
    background: var(--bg-primary);
    padding: 0.5rem;
    text-align: left;
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--text-secondary);
    border-bottom: 2px solid var(--border-color);
}

.standings-table td {
    padding: 0.75rem 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

.standings-table tbody tr:hover {
    background: var(--bg-primary);
}

.standings-table tbody tr:first-child {
    background: rgba(5, 150, 105, 0.1);
    font-weight: 600;
}

.standings-table tbody tr:nth-child(2) {
    background: rgba(5, 150, 105, 0.05);
}

/* Group Matches */
.group-matches {
    padding: 1rem;
    border-top: 2px solid var(--border-color);
}

.group-matches h5 {
    margin-top: 0;
    margin-bottom: 1rem;
    color: var(--text-primary);
    font-size: 0.875rem;
    text-transform: uppercase;
}

.match-form {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    padding: 0.75rem;
    background: var(--bg-primary);
    border-radius: 8px;
}

.match-teams {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
    font-size: 0.875rem;
}

.match-teams span {
    color: var(--text-secondary);
}

.match-teams input {
    width: 50px;
    text-align: center;
    padding: 0.25rem;
    font-weight: 700;
}

/* Knockout Bracket */
.knockout-bracket {
    display: flex;
    gap: 2rem;
    overflow-x: auto;
    padding: 2rem 0;
}

.knockout-round {
    min-width: 250px;
}

.round-title {
    text-align: center;
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.knockout-matches {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.knockout-match {
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 1rem;
    position: relative;
}

.knockout-match.completed {
    border-color: var(--success-color);
}

.match-team {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    background: var(--bg-primary);
    border-radius: 8px;
    border: 2px solid transparent;
    transition: var(--transition);
}

.match-team:last-of-type {
    margin-bottom: 0;
}

.match-team.winner {
    border-color: var(--success-color);
    background: rgba(5, 150, 105, 0.1);
    font-weight: 700;
}

.match-score {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-color);
    min-width: 30px;
    text-align: center;
}

.knockout-match-form {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.knockout-match-form input {
    width: 60px;
    text-align: center;
    font-weight: 700;
}

/* Responsive */
@media (max-width: 768px) {
    .groups-grid {
        grid-template-columns: 1fr;
    }
    
    .tournament-info {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .knockout-bracket {
        flex-direction: column;
    }
    
    .knockout-round {
        width: 100%;
    }
    
    .team-row-content {
        flex-wrap: wrap;
    }
    
    .team-number {
        width: 100%;
    }
}

.match-record-container {
    margin-bottom: 1rem;
    padding: 1rem;
    background: var(--bg-primary);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.match-header {
    margin-bottom: 0.75rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.875rem;
}

.sets-form {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.sets-container {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.set-input {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    background: var(--bg-secondary);
    border-radius: 6px;
}

.set-input label {
    min-width: 50px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.set-input input {
    width: 60px;
    text-align: center;
    font-weight: 700;
    padding: 0.25rem;
}

.set-input span {
    color: var(--text-secondary);
    font-weight: 700;
}

.form-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
}

.set-scores {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--border-color);
}

.set-score {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    background: var(--bg-primary);
    border-radius: 4px;
    color: var(--text-secondary);
}

.knockout-match.pending {
    background: var(--bg-secondary);
    border: 2px dashed var(--border-color);
    padding: 2rem 1rem;
    text-align: center;
}

.match-pending-text {
    color: var(--text-secondary);
    font-style: italic;
}