:root {
  --primary-color: #ff6f61;
  --secondary-color: #6b5b95;
  --dark: #2c3e50;
  --light: #f8f9fa;
}

* {
  box-sizing: border-box;
}

html {
  font-size: var(--base-font-size); /* Set root font size */
}

body {
  font-family: 'Inter', sans-serif;
  line-height: 1.6;
  color: var(--dark);
  background-color: var(--white);
  font-size: 1rem; /* 16px by default */
}

/* Additional API Demo Styles */
.main-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 2rem 2rem 0 2rem;
}

.header {
  text-align: center;
  padding: 2rem;
  background: linear-gradient(
    135deg,
    var(--primary-color),
    var(--secondary-color)
  );
  border-radius: 16px;
  color: white;
}

.header h1 {
  margin: 0 0 1rem 0;
  font-size: 2.5rem;
}

.header p {
  margin: 0;
  font-size: 1.1rem;
  opacity: 0.9;
}

/* Style for the header action buttons */
.header-actions {
  display: flex;
  gap: 1rem;
  margin: 1.5rem;
  flex-wrap: wrap;
  justify-content: center;
}

.header-actions .btn {
  background: var(--primary-color, #6b5b95);
  color: #fff;
  border-radius: 8px;
  padding: 10px 22px;
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  box-shadow: 0 2px 8px rgba(44, 62, 80, 0.06);
  transition: background 0.2s, transform 0.2s;
  border: none;
  display: inline-block;
}

.header-actions .btn:hover {
  background: var(--secondary-color, #1abc9c);
  color: #fff;
  transform: translateY(-2px) scale(1.04);
}

/* Statistics Dashboard */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
  margin-bottom: 3rem;
}

.stat-card {
  background: white;
  padding: 2rem;
  border-radius: 12px;
  text-align: center;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  border: 1px solid var(--light);
  transition: transform 0.3s ease;
}

.stat-card:hover {
  transform: translateY(-5px);
}

.stat-number {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--primary-color);
  margin: 0;
}

.stat-label {
  color: var(--secondary-color);
  font-weight: 600;
  margin: 0.5rem 0 0 0;
}

/* Controls */
.demo-controls {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr 1fr 1fr 1fr;
  gap: 1rem;
  margin-bottom: 2rem;
  padding: 1.5rem;
  background: var(--light);
  border-radius: 12px;
}

.demo-controls .control-group {
  display: flex;
  flex-direction: column;
  min-width: 0; /* Allow items to shrink */
}

.demo-controls .api-actions {
  grid-column: 1 / -1; /* Span full width */
  display: flex;
  gap: 1rem;
  justify-content: center;
  margin-top: 1rem;
}

.control-group {
  display: flex;
  flex-direction: column;
  min-width: 150px;
}

.control-group label {
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--secondary-color);
}

.control-group select,
.control-group input {
  padding: 0.75rem;
  border: 2px solid #e5e7eb;
  border-radius: 8px;
  font-size: 1rem; /* Change font size */
  font-family: 'Inter', sans-serif; /* Match your site font */
  color: #2c3e50; /* Text color */
  background: #fff;
  transition: border-color 0.3s;
  font-size: 0.9rem;
}

/* Style the dropdown options */
.control-group select option {
  font-size: 1rem; /* Option font size */
  color: #2c3e50; /* Option text color */
  font-family: 'Inter', sans-serif;
  background: #fff;
}

.control-group select:focus,
.control-group input:focus {
  outline: none;
  border-color: var(--primary-color);
}

/* Hide default arrow */
.control-group select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background: #fff
    url('data:image/svg+xml;utf8,<svg fill="gray" height="20" viewBox="0 0 20 20" width="20" xmlns="http://www.w3.org/2000/svg"><path d="M7.293 7.293a1 1 0 011.414 0L10 8.586l1.293-1.293a1 1 0 111.414 1.414l-2 2a1 1 0 01-1.414 0l-2-2a1 1 0 010-1.414z"/></svg>')
    no-repeat right 0.75rem center/1.2em;
  padding-right: 2.5em; /* space for arrow */
}

/* Optional: style on focus */
.control-group select:focus {
  border-color: var(--primary-color, #ff6f61);
  outline: none;
}

.api-actions {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.api-actions .api-btn {
  flex: 0 0 auto;
  min-width: 120px;
}

.api-actions[style*='width: 100%'] {
  flex-wrap: wrap;
}

.api-actions[style*='width: 100%'] .api-btn {
  flex: 1;
  min-width: 120px;
}

.api-btn {
  padding: 0.75rem 1.5rem;
  background: var(--primary-color);
  color: white;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.api-btn:hover {
  background: var(--dark);
  transform: translateY(-2px);
}

.api-btn.secondary {
  background: var(--secondary-color);
}

/* Results Display */
.results-container {
  background: white;
  border-radius: 12px;
  padding: 2rem;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  margin-bottom: 2rem;
}

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

.results-count {
  color: var(--secondary-color);
  font-weight: 600;
}

.format-selector {
  display: flex;
  gap: 0.5rem;
}

.format-btn {
  padding: 0.5rem 1rem;
  border: 2px solid var(--primary-color);
  background: white;
  color: var(--primary-color);
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

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

/* Game Cards Grid */
.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 0.5rem;
}

.game-card {
  background: white;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  border: 1px solid var(--light);
  position: relative;
  cursor: pointer;
}

.game-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.game-image-container {
  position: relative;
  overflow: hidden;
}

.game-image {
  width: 100%;
  object-fit: cover;
  background: var(--light);
  transition: transform 0.3s ease;
}

.game-card:hover .game-image {
  transform: scale(1.05);
}

.play-button-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.game-card:hover .play-button-overlay {
  opacity: 1;
  pointer-events: auto;
}

.play-game-btn {
  background: var(--primary-color);
  color: white;
  border: none;
  padding: 1rem 2rem;
  border-radius: 50px;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  box-shadow: 0 4px 15px rgba(255, 111, 97, 0.3);
}

.play-game-btn:hover {
  background: var(--dark);
  transform: scale(1.05);
  box-shadow: 0 6px 20px rgba(255, 111, 97, 0.4);
}

.play-game-btn:active {
  transform: scale(0.95);
}

.play-icon {
  width: 0;
  height: 0;
  border-left: 8px solid white;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  margin-left: 2px;
}

.game-info {
  padding: 1.5rem;
}

.game-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0 0 0.5rem 0;
  color: var(--dark);
}

.game-provider {
  color: var(--secondary-color);
  font-weight: 600;
  margin: 0 0 1rem 0;
}

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

.game-meta span {
  font-size: 0.8rem;
}

.meta-tag {
  padding: 0.25rem 0.75rem;
  background: var(--light);
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--secondary-color);
}

.meta-tag.rtp {
  background: rgba(107, 91, 149, 0.1);
  color: var(--secondary-color);
}

.meta-tag.volatility {
  background: rgba(255, 111, 97, 0.1);
  color: var(--primary-color);
}

/* Loading States */
.loading {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 3rem;
  color: var(--secondary-color);
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid var(--light);
  border-top: 4px solid var(--primary-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-right: 1rem;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* Error States */
.error-message {
  background: #fee2e2;
  color: #dc2626;
  padding: 1rem;
  border-radius: 8px;
  margin: 1rem 0;
  border-left: 4px solid #dc2626;
}

/* Pagination */
.api-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 2px solid var(--light);
}

.page-btn {
  padding: 0.75rem 1rem;
  border: 2px solid var(--primary-color);
  background: white;
  color: var(--primary-color);
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.page-btn:hover:not(:disabled) {
  background: var(--primary-color);
  color: white;
}

.page-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.page-info {
  color: var(--secondary-color);
  font-weight: 600;
}

/* Modal Styles */
.game-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(10px);
  z-index: 10000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  box-sizing: border-box;
}

.game-modal.active {
  display: flex;
}

.modal-content {
  background: white;
  border-radius: 16px;
  width: 100%;
  max-width: 1200px;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
  animation: modalSlideIn 0.3s ease-out;
}

.content-section {
  margin: 20px auto;
  padding: 20px;
  background-color: #fff; /* Assuming a light theme from main.css */
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05); /* Subtle shadow */
}
.content-section h1,
.content-section h2 {
  color: #333; /* Standard text color */
  margin-bottom: 0.75em;
}
.content-section h1 {
  text-align: center;
  font-size: 2.2em;
  margin-bottom: 1em;
}
.content-section h2 {
  font-size: 1.6em;
  border-bottom: 1px solid #eee;
  padding-bottom: 0.3em;
  margin-top: 1.5em;
}
.content-section p {
  font-size: 1em;
  line-height: 1.6;
  color: #555;
  margin-bottom: 1em;
}
.content-section ul {
  list-style: disc;
  padding-left: 20px;
  margin-bottom: 1em;
}
.content-section li {
  margin-bottom: 0.5em;
  color: #555;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: scale(0.9) translateY(-20px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 2rem;
  border-bottom: 1px solid var(--light);
  position: sticky;
  top: 0;
  background: white;
  border-radius: 16px 16px 0 0;
  z-index: 1;
}

.modal-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--dark);
  margin: 0;
}

.modal-close {
  background: rgba(0, 0, 0, 0.1);
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  color: var(--secondary-color);
  font-size: 1.2rem;
  font-weight: 700;
}

.modal-close:hover {
  background: var(--primary-color);
  color: white;
  transform: scale(1.1);
}

.modal-body {
  padding: 0;
}

.game-iframe-container {
  position: relative;
  width: 100%;
  height: 600px;
  background: var(--light);
  display: flex;
  align-items: center;
  justify-content: center;
}

.game-iframe {
  width: 100%;
  height: 100%;
  border: none;
  border-radius: 0;
}

.game-loading {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  color: var(--secondary-color);
}

.game-loading .loading-spinner {
  width: 50px;
  height: 50px;
  margin: 0 auto 1rem;
}

.game-description {
  padding: 2rem;
  border-bottom: 1px solid var(--light);
}

.game-description h3 {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--dark);
  margin: 0 0 1rem 0;
}

.game-description p {
  color: var(--secondary-color);
  line-height: 1.6;
  margin: 0;
}

.game-details {
  padding: 2rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

.detail-card {
  background: var(--light);
  padding: 1.5rem;
  border-radius: 12px;
  text-align: center;
  transition: transform 0.3s ease;
}

.detail-card:hover {
  transform: translateY(-3px);
}

.detail-card h4 {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--secondary-color);
  margin: 0 0 0.5rem 0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.detail-card .value {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--dark);
  margin: 0;
}

/* Pros and Cons */

.card-pair-wrapper {
  display: flex;
  gap: 2rem;
  flex-wrap: wrap;
  margin-bottom: 2rem;
  justify-content: center;
}

.info-card {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 12px rgb(0 0 0 / 6%);
  padding: 1.5rem 1.2rem 1.2rem 1.2rem;
  flex: 1 1 260px;
}

.info-card-positive h3 {
  color: #1abc9c;
  margin-bottom: 0.7rem;
  font-size: 1.2rem;
}

.info-card-negative h3 {
  color: #e74c3c;
  margin-bottom: 0.7rem;
  font-size: 1.2rem;
}

.info-card ul {
  padding-left: 1.2em;
  margin: 0;
  font-size: 1rem;
}

.info-card li {
  margin-bottom: 0.5em;
  list-style: disc;
}

@media (max-width: 700px) {
  .card-pair-wrapper {
    flex-direction: column;
    gap: 1.2rem;
  }
}

/* Sign Up / Login Form */

.signup-section {
  background: linear-gradient(
    135deg,
    var(--primary-color),
    var(--secondary-color)
  );
  color: #fff;
  border-radius: 18px;
  box-shadow: 0 4px 24px rgba(44, 62, 80, 0.1);
  padding: 0rem 2rem 4rem 2rem;
  margin: 2rem auto 0 auto;
  max-width: 800px; /* Increased from 440px */
  text-align: center;
  position: relative;
  overflow: hidden;
}

.signup-section::before {
  content: '';
  position: absolute;
  top: -40px;
  right: -40px;
  width: 120px;
  height: 120px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 50%;
  z-index: 0;
}

.signup-section h2 {
  color: #fff;
  margin-bottom: 0.5rem;
  font-size: 1.7rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  z-index: 1;
  position: relative;
}

.signup-section p {
  color: #f8f9fa;
  margin-bottom: 1.5rem;
  font-size: 1.08rem;
  opacity: 0.92;
  z-index: 1;
  position: relative;
}

.signup-form {
  display: flex;
  gap: 0.7rem;
  justify-content: center;
  flex-wrap: wrap;
  z-index: 1;
  position: relative;
}

.signup-input {
  padding: 0.8em 1.1em;
  border-radius: 8px;
  border: none;
  font-size: 1.05rem;
  min-width: 180px;
  flex: 1 1 180px;
  background: #fff;
  color: var(--dark);
  box-shadow: 0 2px 8px rgba(44, 62, 80, 0.06);
  transition: box-shadow 0.2s, border 0.2s;
}

.signup-input:focus {
  outline: none;
  box-shadow: 0 0 0 2px var(--secondary-color);
}

.signup-btn {
  padding: 0.8em 1.7em;
  border-radius: 8px;
  font-size: 1.05rem;
  font-weight: 700;
  background: var(--secondary-color, #6b5b95);
  color: #fff;
  border: none;
  transition: background 0.2s, transform 0.2s;
  box-shadow: 0 2px 8px rgba(44, 62, 80, 0.08);
  cursor: pointer;
}

.signup-btn:hover {
  background: var(--primary-color, #ff6f61);
  transform: translateY(-2px) scale(1.04);
}

@media (max-width: 600px) {
  .signup-section {
    padding: 1.2rem 0.5rem 1.5rem 0.5rem;
    max-width: 98vw;
  }
  .signup-form {
    gap: 0.7rem;
  }
}

/* Footer Styles */

.site-footer {
  background: linear-gradient(
    135deg,
    var(--primary-color),
    var(--secondary-color)
  );
  color: #fff;
  padding: 2rem 0 1rem 0;
  margin-top: 3rem;
  border-radius: 16px 16px 0 0;
  box-shadow: 0 -2px 12px rgba(44, 62, 80, 0.06);
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  text-align: center;
}

.footer-brand {
  margin-bottom: 1rem;
}

.footer-logo {
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: 1px;
  margin-right: 0.5rem;
}

.footer-tagline {
  font-size: 1rem;
  opacity: 0.85;
}

.footer-links {
  margin-bottom: 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1.2rem;
  justify-content: center;
}

.footer-link {
  color: #fff;
  text-decoration: none;
  font-weight: 500;
  opacity: 0.92;
  transition: opacity 0.2s;
}

.footer-link:hover {
  opacity: 1;
  text-decoration: underline;
}

.footer-copy {
  font-size: 0.95rem;
  opacity: 0.8;
}

/* Responsive */
@media (max-width: 600px) {
  .footer-content {
    padding: 0 1rem;
  }
  .footer-links {
    gap: 0.7rem;
    font-size: 0.98rem;
  }
  .footer-logo {
    font-size: 1.1rem;
  }
}

/* Responsive Design for Controls */
@media (max-width: 1200px) {
  .demo-controls {
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 1rem;
  }
}

@media (max-width: 768px) {
  .main-container {
    padding: 1rem 1rem 0 1rem;
  }

  .demo-controls {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .control-group {
    min-width: 100%;
  }

  .api-actions {
    justify-content: stretch;
  }

  .api-actions .api-btn {
    flex: 1;
    min-width: auto;
  }

  .tab-navigation {
    flex-direction: column;
  }

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

  .game-modal {
    padding: 1rem;
  }

  .modal-content {
    max-height: 95vh;
  }

  .game-iframe-container {
    height: 400px;
  }

  .game-details {
    grid-template-columns: 1fr;
    padding: 1rem;
  }

  .game-description {
    padding: 1rem;
  }

  .modal-header {
    padding: 1rem;
  }
}
