/* Games Hub Styles - WCAG 2.2 AAA Compliant */

/* CSS Variables */
:root {
  --primary: #1e40af;
  --primary-light: #3b82f6;
  --primary-dark: #1e3a8a;
  --accent: #7c3aed;
  --accent-light: #a78bfa;
  --success: #059669;
  --success-light: #10b981;
  --warning: #d97706;
  --danger: #dc2626;
  --dark: #1f2937;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --white: #ffffff;
  --font-heading: 'Montserrat', sans-serif;
  --font-body: 'Open Sans', sans-serif;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
  --transition: all 0.3s ease;
  --quiz-gradient: linear-gradient(135deg, #1e40af 0%, #3b82f6 100%);
  --ethics-gradient: linear-gradient(135deg, #7c3aed 0%, #a78bfa 100%);
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  color: var(--dark);
  line-height: 1.6;
  background-color: var(--white);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.3;
}

/* Skip Link */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background-color: var(--primary);
  color: var(--white);
  padding: 0.75rem 1.5rem;
  z-index: 1000;
  transition: top 0.3s ease;
  text-decoration: none;
  font-weight: 600;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

.skip-link:focus {
  top: 0;
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

/* Focus Styles - WCAG AAA */
*:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

/* Navbar */
.navbar {
  background-color: var(--white);
  box-shadow: var(--shadow-sm);
  padding: 1rem 0;
}

.navbar-brand img {
  max-height: 70px;
  width: auto;
}

.btn-outline-primary {
  border-color: var(--primary);
  color: var(--primary);
  font-weight: 600;
  padding: 0.75rem 1.5rem;
  border-radius: 0.5rem;
  transition: var(--transition);
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

.btn-outline-primary:hover,
.btn-outline-primary:focus {
  background-color: var(--primary);
  border-color: var(--primary);
  color: var(--white);
  transform: translateY(-2px);
}

.btn-outline-secondary {
  border-color: var(--gray-300);
  color: var(--gray-700);
  font-weight: 600;
  padding: 0.75rem 1.5rem;
  border-radius: 0.5rem;
  transition: var(--transition);
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

.btn-outline-secondary:hover,
.btn-outline-secondary:focus {
  background-color: var(--gray-100);
  border-color: var(--gray-500);
  color: var(--dark);
}

/* Hero Section */
.hero-section {
  background: linear-gradient(135deg, #1e40af 0%, #3b82f6 50%, #7c3aed 100%);
  color: var(--white);
  padding: 4rem 0 3rem;
  position: relative;
  overflow: hidden;
}

.hero-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('data:image/svg+xml,<svg width="60" height="60" xmlns="http://www.w3.org/2000/svg"><circle cx="30" cy="30" r="2" fill="rgba(255,255,255,0.1)"/></svg>');
  opacity: 0.5;
}

.hero-content {
  position: relative;
  z-index: 1;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background-color: rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(10px);
  color: var(--white);
  font-weight: 600;
  padding: 0.75rem 1.5rem;
  border-radius: 2rem;
  margin-bottom: 1.5rem;
  font-size: 0.95rem;
  border: 2px solid rgba(255, 255, 255, 0.5);
  min-height: 44px;
}

.hero-title {
  font-size: 3rem;
  font-weight: 800;
  margin-bottom: 1.5rem;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.hero-subtitle {
  font-size: 1.25rem;
  margin-bottom: 2rem;
  opacity: 0.95;
  line-height: 1.6;
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
}

.hero-stats {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 2rem;
  flex-wrap: wrap;
}

.stat-item {
  text-align: center;
}

.stat-number {
  display: block;
  font-size: 2.5rem;
  font-weight: 800;
  font-family: var(--font-heading);
}

.stat-label {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.9);
  font-weight: 500;
}

.stat-divider {
  width: 2px;
  height: 3rem;
  background-color: rgba(255, 255, 255, 0.5);
}

/* Main Content */
.main-content {
  flex: 1;
  padding: 4rem 0;
}

/* Section Styles */
.games-section {
  margin-bottom: 4rem;
}

.section-header {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.section-icon {
  width: 60px;
  height: 60px;
  border-radius: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: var(--white);
  flex-shrink: 0;
}

.quiz-icon {
  background: var(--quiz-gradient);
}

.ethics-icon {
  background: var(--ethics-gradient);
}

.section-title {
  font-size: 2rem;
  font-weight: 800;
  color: var(--dark);
  margin-bottom: 0.25rem;
}

.section-subtitle {
  color: var(--gray-600);
  font-size: 1.1rem;
  margin: 0;
}

/* Games Grid */
.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 2rem;
}

/* Game Cards */
.game-card {
  background-color: var(--white);
  border-radius: 1rem;
  box-shadow: var(--shadow-md);
  border: 2px solid var(--gray-200);
  transition: var(--transition);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.game-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-xl);
}

.quiz-card:hover {
  border-color: var(--primary-light);
}

.ethics-card:hover {
  border-color: var(--accent-light);
}

.game-card-header {
  padding: 1.5rem 1.5rem 1rem;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.game-icon {
  width: 50px;
  height: 50px;
  border-radius: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  color: var(--white);
}

.quiz-card .game-icon {
  background: var(--quiz-gradient);
}

.ethics-card .game-icon {
  background: var(--ethics-gradient);
}

.game-meta {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.game-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.35rem 0.75rem;
  border-radius: 1rem;
  font-size: 0.8rem;
  font-weight: 600;
}

.difficulty-beginner {
  background-color: #d1fae5;
  color: #065f46;
}

.difficulty-intermediate {
  background-color: #fef3c7;
  color: #92400e;
}

.difficulty-advanced {
  background-color: #fee2e2;
  color: #991b1b;
}

.scenario-badge {
  background-color: #ede9fe;
  color: #5b21b6;
}

.time-badge {
  background-color: var(--gray-100);
  color: var(--gray-700);
}

.game-card-body {
  padding: 0 1.5rem 1.5rem;
  flex: 1;
}

.game-title {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--dark);
  margin-bottom: 0.75rem;
}

.game-description {
  color: var(--gray-600);
  margin-bottom: 1rem;
  line-height: 1.6;
}

.game-topics {
  list-style: none;
  padding: 0;
  margin: 0;
}

.game-topics li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0;
  font-size: 0.9rem;
  color: var(--gray-700);
}

.game-topics i {
  color: var(--success);
  font-size: 0.8rem;
}

.game-card-footer {
  padding: 1.25rem 1.5rem;
  background-color: var(--gray-100);
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--gray-200);
}

.question-count {
  color: var(--gray-600);
  font-size: 0.9rem;
  font-weight: 500;
}

.question-count i {
  margin-right: 0.25rem;
}

.btn-play {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border-radius: 0.5rem;
  font-weight: 600;
  text-decoration: none;
  transition: var(--transition);
  min-height: 44px;
}

.quiz-card .btn-play {
  background: var(--quiz-gradient);
  color: var(--white);
}

.quiz-card .btn-play:hover,
.quiz-card .btn-play:focus {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  color: var(--white);
}

.btn-ethics {
  background: var(--ethics-gradient);
  color: var(--white);
}

.btn-ethics:hover,
.btn-ethics:focus {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  color: var(--white);
}

/* Why Games Section */
.why-games-section {
  background-color: var(--gray-100);
  padding: 4rem 3rem;
  border-radius: 1.5rem;
  margin-bottom: 4rem;
}

.why-games-section .section-title {
  margin-bottom: 1rem;
}

.why-games-section .lead {
  color: var(--gray-700);
  margin-bottom: 2rem;
}

.benefits-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.benefits-list li {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.benefit-icon {
  width: 48px;
  height: 48px;
  min-width: 48px;
  background: var(--quiz-gradient);
  border-radius: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  font-size: 1.1rem;
}

.benefits-list strong {
  display: block;
  font-size: 1.1rem;
  color: var(--dark);
  margin-bottom: 0.25rem;
}

.benefits-list span {
  color: var(--gray-600);
  font-size: 0.95rem;
}

.stats-card {
  background-color: var(--white);
  border-radius: 1rem;
  padding: 2rem;
  box-shadow: var(--shadow-lg);
}

.stats-card h3 {
  font-size: 1.25rem;
  color: var(--primary);
  margin-bottom: 1.5rem;
  text-align: center;
}

.stats-card h3 i {
  margin-right: 0.5rem;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

.stat-box {
  text-align: center;
  padding: 1.25rem;
  background-color: var(--gray-100);
  border-radius: 0.75rem;
}

.stat-box .stat-number {
  font-size: 2rem;
  font-weight: 800;
  color: var(--primary);
  font-family: var(--font-heading);
  line-height: 1.2;
}

.stat-box .stat-label {
  font-size: 0.85rem;
  color: var(--gray-600);
  font-weight: 500;
  margin-top: 0.25rem;
}

/* CTA Section */
.cta-section {
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  padding: 3rem;
  border-radius: 1.5rem;
  color: var(--white);
  margin-bottom: 2rem;
}

.cta-section h2 {
  font-size: 2rem;
  margin-bottom: 1rem;
}

.cta-section p {
  font-size: 1.1rem;
  opacity: 0.95;
  margin-bottom: 2rem;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.cta-buttons {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.cta-section .btn-primary {
  background-color: var(--white);
  color: var(--primary);
  border: none;
  font-weight: 600;
  padding: 1rem 2rem;
  min-height: 48px;
}

.cta-section .btn-primary:hover,
.cta-section .btn-primary:focus {
  background-color: var(--gray-100);
  color: var(--primary-dark);
  transform: translateY(-2px);
}

.cta-section .btn-outline-primary {
  border-color: var(--white);
  color: var(--white);
  padding: 1rem 2rem;
  min-height: 48px;
}

.cta-section .btn-outline-primary:hover,
.cta-section .btn-outline-primary:focus {
  background-color: rgba(255, 255, 255, 0.2);
  border-color: var(--white);
  color: var(--white);
}

/* Footer */
.footer {
  background: linear-gradient(135deg, var(--dark) 0%, #374151 100%);
  color: var(--white);
  padding: 2rem 0;
  margin-top: auto;
}

.footer p {
  margin: 0;
  font-size: 0.9rem;
}

.footer a {
  color: var(--primary-light);
  text-decoration: none;
  transition: color 0.2s ease;
}

.footer a:hover,
.footer a:focus {
  color: var(--white);
  text-decoration: underline;
}

/* Responsive Design */
@media (max-width: 991.98px) {
  .hero-title {
    font-size: 2.5rem;
  }

  .section-header {
    flex-direction: column;
    text-align: center;
  }

  .section-title {
    font-size: 1.75rem;
  }

  .games-grid {
    grid-template-columns: 1fr;
  }

  .why-games-section {
    padding: 2.5rem 1.5rem;
  }

  .stat-divider {
    display: none;
  }
}

@media (max-width: 767.98px) {
  .hero-section {
    padding: 3rem 0 2rem;
  }

  .hero-title {
    font-size: 2rem;
  }

  .hero-subtitle {
    font-size: 1.1rem;
  }

  .hero-stats {
    gap: 1.5rem;
  }

  .stat-number {
    font-size: 2rem;
  }

  .main-content {
    padding: 2.5rem 0;
  }

  .games-section {
    margin-bottom: 3rem;
  }

  .game-card-header {
    flex-direction: column;
    gap: 1rem;
  }

  .cta-section {
    padding: 2rem 1.5rem;
  }

  .cta-section h2 {
    font-size: 1.5rem;
  }

  .cta-buttons {
    flex-direction: column;
    width: 100%;
  }

  .cta-buttons .btn {
    width: 100%;
  }

  .stats-grid {
    gap: 0.75rem;
  }

  .stat-box .stat-number {
    font-size: 1.5rem;
  }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
  .game-card {
    border-width: 3px;
  }

  .btn-play,
  .btn-outline-primary,
  .btn-outline-secondary {
    border-width: 3px;
  }
}
