/* NGW Quiznight - Main Styles */
/* Swiss/International Design with LaTeX Aesthetic */

:root {
  /* Colors */
  --ngw-turquoise: #00A59A;
  --ngw-purple: #694893;
  --accent-primary: #694893;
  --accent-secondary: #00A59A;
  --bg-white: #ffffff;
  --bg-light: #f5f5f5;
  --text-primary: #1a1a1a;
  --text-secondary: #666666;
  --border-light: #e0e0e0;
  --border-medium: #cccccc;
  --used-card-red: #d32f2f;
  
  /* Team Colors */
  --team-color-1: #694893;
  --team-color-2: #00A59A;
  --team-color-3: #FF6B6B;
  --team-color-4: #FFD93D;
  --team-color-5: #6BCB77;
  --team-color-6: #4D96FF;
  
  /* Typography */
  --font-primary: 'Fredoka', 'Quicksand', 'Nunito', 'Poppins', sans-serif;
  --font-mono: 'Courier New', 'Monaco', monospace;
  --font-body: 'Fredoka', 'Quicksand', 'Nunito', 'Poppins', sans-serif;
  
  /* Font Sizes (Modular Scale 1.25) */
  --text-xs: 12px;
  --text-sm: 14px;
  --text-base: 16px;
  --text-lg: 20px;
  --text-xl: 25px;
  --text-2xl: 31px;
  --text-3xl: 39px;
  --text-4xl: 49px;
  
  /* Spacing (8px base) */
  --space-1: 8px;
  --space-2: 16px;
  --space-3: 24px;
  --space-4: 32px;
  --space-5: 40px;
  --space-6: 48px;
  --space-8: 64px;
  
  /* Shadows */
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 4px 8px rgba(0, 0, 0, 0.15);
  --shadow-lg: 0 8px 16px rgba(0, 0, 0, 0.2);
}

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

/* Base Styles */
body {
  font-family: var(--font-primary);
  color: var(--text-primary);
  background: var(--bg-light);
  line-height: 1.5;
  font-size: var(--text-base);
}

#app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header */
#header {
  background: var(--bg-white);
  border-bottom: 1px solid var(--border-light);
  padding: var(--space-2) var(--space-3);
}

.header-content {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
}

.header-content .logo-container {
  background: var(--accent-primary);
  padding: var(--space-1);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.header-content .logo {
  height: 35px;
  width: auto;
  display: block;
}

.header-content h1 {
  font-size: var(--text-lg);
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--accent-primary);
  flex: 1;
  text-align: center;
}

.header-content .quiz-date {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--text-secondary);
  min-width: 100px;
  text-align: right;
}

/* Scoreboard */
#scoreboard {
  background: var(--bg-white);
  border-bottom: 1px solid var(--border-light);
  padding: var(--space-3) var(--space-4);
}

#scoreboard h2 {
  font-size: var(--text-lg);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: var(--space-2);
  color: var(--text-primary);
}

.scoreboard-list {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.scoreboard-item {
  background: var(--bg-light);
  border: 1px solid var(--border-light);
  padding: var(--space-2) var(--space-3);
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-width: 200px;
  flex: 1;
  transition: transform 0.2s;
}

.scoreboard-item .team-name {
  font-weight: 500;
  font-size: var(--text-base);
}

.scoreboard-item .score {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: var(--text-lg);
  color: var(--accent-primary);
}

.scoreboard-item .score-controls {
  display: flex;
  gap: var(--space-1);
  align-items: center;
}

.scoreboard-item .btn-adjust {
  background: var(--accent-secondary);
  color: white;
  border: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.scoreboard-item .btn-adjust:hover {
  transform: scale(1.1);
  box-shadow: var(--shadow-sm);
}

.scoreboard-item .btn-adjust.minus {
  background: var(--used-card-red);
}

.scoreboard-empty {
  max-width: 1200px;
  margin: 0 auto;
  text-align: center;
  color: var(--text-secondary);
  font-style: italic;
}

/* Score update animation */
@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.15); }
}

.score-update {
  animation: pulse 0.4s ease;
}

/* Main Content */
#main-content {
  flex: 1;
  padding: var(--space-4);
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}

/* Page visibility */
.page {
  display: none;
}

.page.active {
  display: block;
  animation: fadeIn 0.3s ease-out;
}

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

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-primary);
  font-weight: 700;
  line-height: 1.2;
}

h1 {
  font-size: var(--text-3xl);
}

h2 {
  font-size: var(--text-2xl);
}

h3 {
  font-size: var(--text-xl);
}

/* Buttons */
button {
  font-family: var(--font-primary);
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

button:focus {
  outline: 2px solid var(--accent-primary);
  outline-offset: 2px;
}

.btn-primary {
  background: var(--accent-primary);
  color: var(--bg-white);
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-sm);
  border-radius: 8px;
}

.btn-primary:hover {
  background: #553a75;
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  background: var(--bg-white);
  color: var(--accent-secondary);
  border: 2px solid var(--accent-secondary);
  padding: calc(var(--space-2) - 2px) calc(var(--space-3) - 2px);
  font-size: var(--text-sm);
  border-radius: 8px;
}

.btn-secondary:hover {
  background: #e6f7f6;
  transform: translateY(-1px);
}

.btn-back {
  background: transparent;
  color: var(--text-secondary);
  border: none;
  padding: var(--space-1) var(--space-2);
  font-size: var(--text-sm);
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

.btn-back:hover {
  color: var(--text-primary);
  background: var(--bg-light);
}

/* Input Fields */
input[type="text"] {
  font-family: var(--font-primary);
  font-size: var(--text-base);
  padding: var(--space-2);
  border: 1px solid var(--border-medium);
  border-radius: 2px;
  background: var(--bg-white);
  color: var(--text-primary);
  transition: border-color 0.2s;
}

input[type="text"]:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 2px rgba(105, 72, 147, 0.1);
}

input[type="text"]::placeholder {
  color: var(--text-secondary);
}

/* Cards */
.card {
  background: var(--bg-white);
  border: 1px solid var(--border-light);
  border-radius: 2px;
  box-shadow: var(--shadow-sm);
  padding: var(--space-4);
  transition: box-shadow 0.2s, transform 0.2s;
}

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

/* Responsive */
@media (max-width: 767px) {
  .header-content {
    flex-direction: column;
    text-align: center;
  }
  
  .header-content .logo {
    height: 50px;
  }
  
  .header-content h1 {
    font-size: var(--text-xl);
  }
  
  .header-content .quiz-date {
    text-align: center;
  }
  
  .scoreboard-list {
    flex-direction: column;
  }
  
  .scoreboard-item {
    min-width: 100%;
  }
  
  #main-content {
    padding: var(--space-2);
  }
}

@media (min-width: 768px) and (max-width: 1023px) {
  .scoreboard-list {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Utility Classes */
.text-center {
  text-align: center;
}

.mt-1 { margin-top: var(--space-1); }
.mt-2 { margin-top: var(--space-2); }
.mt-3 { margin-top: var(--space-3); }
.mt-4 { margin-top: var(--space-4); }

.mb-1 { margin-bottom: var(--space-1); }
.mb-2 { margin-bottom: var(--space-2); }
.mb-3 { margin-bottom: var(--space-3); }
.mb-4 { margin-bottom: var(--space-4); }
