/* Modern ELO Rating System Styles */

:root {
  --primary-color: #4361ee;
  --primary-light: #4895ef;
  --primary-dark: #3f37c9;
  --accent-color: #f72585;
  --success-color: #4cc9f0;
  --warning-color: #f8961e;
  --danger-color: #e63946;
  --light-bg: #f8f9fa;
  --dark-bg: #212529;
  --text-color: #212529;
  --text-light: #6c757d;
  --border-color: #dee2e6;
  --card-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  --header-height: 60px;
  --sidebar-width: 250px;
  --container-width: 1200px;
  --border-radius: 8px;
  --transition: all 0.3s ease;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', Oxygen, Ubuntu, Cantarell, 'Open Sans', sans-serif;
  background-color: #f5f7fa;
  color: var(--text-color);
  line-height: 1.6;
  padding: 0;
  margin: 0;
}

/* Typography */
h1, h2, h3, h4, h5 {
  font-weight: 600;
  color: var(--dark-bg);
  margin-bottom: 1rem;
}

h1 {
  font-size: 2rem;
}

h2 {
  font-size: 1.5rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.5rem;
  margin-bottom: 1.25rem;
}

h3 {
  font-size: 1.25rem;
}

/* Layout */
.app-container {
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 1.5rem;
}

.container {
  display: flex;
  gap: 2rem;
  margin-bottom: 2rem;
}

.column {
  flex: 1;
  background-color: white;
  border-radius: var(--border-radius);
  padding: 1.5rem;
  box-shadow: var(--card-shadow);
}

/* App Header */
.app-header {
  background-color: white;
  padding: 1rem 2rem;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  margin-bottom: 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.app-title {
  margin: 0;
  color: var(--primary-color);
  display: flex;
  align-items: center;
}

.app-title i {
  margin-right: 0.75rem;
  font-size: 1.75rem;
}

.user-info {
  display: flex;
  align-items: center;
  color: var(--text-light);
  font-size: 0.9rem;
}

.user-info span {
  margin-right: 1rem;
  font-weight: 500;
  color: var(--text-color);
}

/* Login & Register */
.login-container {
  max-width: 400px;
  margin: 5rem auto;
  padding: 2rem;
  background-color: white;
  border-radius: var(--border-radius);
  box-shadow: var(--card-shadow);
}

.login-header {
  text-align: center;
  margin-bottom: 2rem;
}

.login-title {
  color: var(--primary-color);
  margin-bottom: 0.5rem;
}

.login-subtitle {
  color: var(--text-light);
  font-weight: normal;
  font-size: 1rem;
}

.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
}

.form-control {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  font-size: 1rem;
  transition: var(--transition);
}

.form-control:focus {
  border-color: var(--primary-light);
  outline: none;
  box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.25);
}

.form-footer {
  text-align: center;
  margin-top: 1.5rem;
  color: var(--text-light);
}

.form-footer a {
  color: var(--primary-color);
  text-decoration: none;
  font-weight: 500;
}

.form-footer a:hover {
  text-decoration: underline;
}

/* Buttons */
.btn {
  cursor: pointer;
  display: inline-block;
  background-color: #3498db;
  color: white;
  border: none;
  border-radius: 4px;
  padding: 10px 15px;
  font-size: 1rem;
  font-weight: 500;
  text-align: center;
  transition: all 0.3s ease;
}

.btn-block {
  width: 100%;
  display: block;
}

.btn:hover {
  background-color: #2980b9;
  transform: translateY(-1px);
}

.btn-secondary {
  background-color: var(--text-light);
}

.btn-secondary:hover {
  background-color: var(--text-color);
}

.btn-success {
  background-color: var(--success-color);
}

.btn-success:hover {
  background-color: #38b6d8;
}

.btn-danger {
  background-color: var(--danger-color);
}

.btn-danger:hover {
  background-color: #d32f3b;
}

.btn-warning {
  background-color: var(--warning-color);
}

.btn-warning:hover {
  background-color: #e87b1c;
}

.btn-sm {
  padding: 0.4rem 0.8rem;
  font-size: 0.875rem;
}

/* Navigation Tabs */
.tab-nav {
  background-color: #f8f9fa;
  margin-bottom: 2rem;
  display: flex;
  overflow: hidden;
  box-shadow: none;
  border-bottom: 1px solid #dee2e6;
}

.tab-button {
  flex: none;
  background-color: #f8f9fa;
  border: none;
  padding: 1rem 1.5rem;
  font-size: 1rem;
  font-weight: 500;
  color: #6c757d;
  transition: all 0.3s ease;
  position: relative;
  cursor: pointer;
  margin-right: 0.5rem;
}

.tab-button:hover {
  color: #4361ee;
  background-color: rgba(67, 97, 238, 0.05);
}

.tab-button.active {
  color: #fff;
  background-color: #3498db;
  border-radius: 4px 4px 0 0;
}

.tab-button.active::after {
  display: none;
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

/* Tables */
.table-container {
  overflow-x: auto;
  margin-bottom: 1.5rem;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1rem;
}

th, td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}

th {
  font-weight: 600;
  color: var(--text-color);
  background-color: #f8f9fa;
}

tbody tr:hover {
  background-color: rgba(0, 0, 0, 0.02);
}

/* Forms & Inputs */
input, select, textarea {
  padding: 0.75rem 1rem;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  width: 100%;
  margin-bottom: 1rem;
  font-size: 1rem;
  transition: var(--transition);
}

input:focus, select:focus, textarea:focus {
  border-color: var(--primary-light);
  outline: none;
  box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.25);
}

label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
}

/* Filter Section */
.filter-section {
  padding: 1rem;
  background-color: #f8f9fa;
  border-radius: var(--border-radius);
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.filter-section label {
  margin-bottom: 0;
  white-space: nowrap;
}

.filter-section select {
  margin-bottom: 0;
}

/* Team Setup */
.team-section {
  background-color: #f8f9fa;
  border-radius: var(--border-radius);
  padding: 1.25rem;
  margin-bottom: 1.5rem;
}

.team-title {
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  margin-bottom: 1rem;
}

.team-title .badge {
  margin-left: 0.5rem;
}

.team-players {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
}

/* Match Cards */
.match-card, .group-card {
  background-color: white;
  border-radius: var(--border-radius);
  box-shadow: var(--card-shadow);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  border-left: 4px solid var(--primary-color);
}

.match-card h3, .group-card h3 {
  display: flex;
  align-items: center;
  margin-bottom: 1rem;
}

.match-date {
  color: var(--text-light);
  font-size: 0.875rem;
  margin-left: auto;
}

.match-details {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-bottom: 1rem;
}

.match-team {
  display: flex;
  flex-direction: column;
}

.match-team-header {
  display: flex;
  align-items: center;
  margin-bottom: 0.5rem;
}

.match-team-name {
  font-weight: 600;
  display: flex;
  align-items: center;
}

.match-team.winner .match-team-name {
  color: var(--primary-color);
}

.match-team-players {
  color: var(--text-light);
  font-size: 0.9rem;
}

.match-scores {
  display: flex;
  justify-content: space-between;
  background-color: #f8f9fa;
  padding: 0.75rem 1rem;
  border-radius: 4px;
  margin-bottom: 1rem;
}

.match-game {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
}

.match-score {
  font-weight: 600;
  font-size: 1.1rem;
}

.match-game-label {
  font-size: 0.75rem;
  color: var(--text-light);
  margin-bottom: 0.25rem;
}

.match-stats {
  display: flex;
  justify-content: space-between;
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-color);
}

.match-stat {
  text-align: center;
}

.match-stat-value {
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--primary-color);
}

.match-stat-label {
  font-size: 0.8rem;
  color: var(--text-light);
}

.match-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
}

/* Game Scores Input */
.team-container {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.team {
  flex: 1;
  background-color: #f8f9fa;
  padding: 1rem;
  border-radius: var(--border-radius);
}

.team p {
  margin-bottom: 0.5rem;
  font-weight: 500;
}

.score-input {
  width: 70px;
  text-align: center;
  font-size: 1.2rem;
  font-weight: 600;
  padding: 0.5rem;
}

/* Badges & Chips */
.badge {
  display: inline-block;
  padding: 0.35em 0.65em;
  font-size: 0.75em;
  font-weight: 700;
  line-height: 1;
  color: #fff;
  text-align: center;
  white-space: nowrap;
  vertical-align: baseline;
  border-radius: 50rem;
  background-color: var(--primary-color);
}

.badge-success {
  background-color: var(--success-color);
}

.badge-warning {
  background-color: var(--warning-color);
}

.badge-danger {
  background-color: var(--danger-color);
}

.chip {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  background-color: #e9ecef;
  border-radius: 50rem;
  font-size: 0.875rem;
  margin-right: 0.5rem;
  margin-bottom: 0.5rem;
  color: var(--text-color);
}

.chip-close {
  margin-left: 0.5rem;
  cursor: pointer;
  font-weight: bold;
  font-size: 0.8rem;
}

.admin-badge {
  background-color: #f8961e;
  color: white;
  font-size: 0.75rem;
  padding: 2px 5px;
  border-radius: 3px;
  margin-left: 5px;
}

.role-icon {
  margin-left: 5px;
  font-size: 0.9rem;
}

.role-owner {
  color: gold;
}

.role-admin {
  color: #f8961e;
}

/* Group Card */
.group-card {
  border-left: 4px solid var(--success-color);
}

.group-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.group-title {
  display: flex;
  align-items: center;
}

.group-description {
  color: var(--text-light);
  margin-bottom: 1rem;
}

.group-meta {
  display: flex;
  gap: 1.5rem;
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-color);
}

.group-meta-item {
  display: flex;
  flex-direction: column;
}

.group-meta-value {
  font-weight: 600;
}

.group-meta-label {
  font-size: 0.8rem;
  color: var(--text-light);
}

.empty-groups {
    text-align: center;
    padding: 3rem 1rem;
    background-color: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 2rem;
}

.empty-groups i {
    font-size: 3rem;
    color: #3498db;
    margin-bottom: 1rem;
    opacity: 0.7;
}

.empty-groups h3 {
    margin-bottom: 0.5rem;
    color: #212529;
}

.empty-groups p {
    color: #6c757d;
    max-width: 400px;
    margin: 0 auto;
}

.members-list {
  margin-bottom: 1.5rem;
}

.members-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.members-title {
  font-weight: 600;
  margin: 0;
}

.join-code-section {
  background-color: #f8f9fa;
  border-radius: var(--border-radius);
  padding: 1rem;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.join-code-label {
  font-size: 0.875rem;
  color: var(--text-light);
  margin-bottom: 0.25rem;
}

.join-code {
  font-family: monospace;
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: 1px;
  color: var(--primary-color);
}

.join-code-actions {
  display: flex;
  gap: 0.5rem;
}

/* Streaks */
.streak-win {
  color: #2ecc71;
  font-weight: bold;
  display: flex;
  align-items: center;
}

.streak-loss {
  color: #e74c3c;
  font-weight: bold;
  display: flex;
  align-items: center;
}

.streak-icon {
  margin-right: 0.25rem;
}

/* Utilities */
.hidden {
  display: none !important;
}

.text-center {
  text-align: center;
}

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-4 { margin-top: 1rem; }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }

/* Responsive Design */
@media (max-width: 768px) {
  .container {
    flex-direction: column;
  }
  
  .match-details {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .match-scores {
    flex-wrap: wrap;
  }
  
  .match-game {
    flex: 1 0 30%;
    margin-bottom: 0.5rem;
  }
  
  .app-header {
    flex-direction: column;
    text-align: center;
    padding: 1rem;
  }
  
  .user-info {
    margin-top: 1rem;
  }
  
  .tab-nav {
    flex-wrap: wrap;
  }
  
  .tab-button {
    flex-basis: 50%;
  }
  
  .team-players {
    grid-template-columns: 1fr;
  }
  
  .filter-section {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .filter-section select {
    width: 100%;
  }
}

/* Add Font Awesome for icons */
@import url('https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta3/css/all.min.css');