@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700;800&family=Jost:wght@300;400;500;600;700&display=swap");

:root {
  --primary-color: #000000;
  --secondary-color: #ffffff;
  --accent-color: #000000;
  --success-color: #000000;
  --warning-color: #000000;
  --light-square: #ffffff;
  --dark-square: #000000;
  --text-color: #000000;
  --text-light: #ffffff;
  --bg-color: #ffffff;
  --white: #ffffff;
  --black: #000000;
  --light-gray: #f8f9fa;
  --border-color: #000000;
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  --shadow-hover: 0 8px 30px rgba(0, 0, 0, 0.15);
}

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

body {
  font-family: "Poppins", sans-serif;
  background-color: var(--white);
  color: var(--black);
  line-height: 1.6;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: "Jost", sans-serif;
  font-weight: 600;
  color: var(--black);
}

/* Header Styles */
.header {
  background: var(--black);
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: var(--shadow);
  color: var(--white);
  padding: 1rem 0;
}

.logo {
  font-family: "Jost", sans-serif;
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--white);
  text-decoration: none;
  transition: all 0.3s ease;
}

.logo:hover {
  transform: scale(1.05);
  color: var(--white);
  opacity: 0.8;
}

.navbar-nav .nav-link {
  font-family: "Poppins", sans-serif;
  color: var(--white) !important;
  font-weight: 500;
  margin: 0 10px;
  transition: all 0.3s ease;
  position: relative;
}

.navbar-nav .nav-link:hover {
  color: var(--white) !important;
  opacity: 0.7;
  transform: translateY(-2px);
}

.navbar-nav .nav-link.active {
  color: var(--white) !important;
  opacity: 0.8;
}

.navbar-toggler {
  border-color: var(--white);
}

.navbar-toggler-icon {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255, 255, 255, 1%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

/* Ad Placeholder Styles */
.ad-placeholder {
  background: var(--white);
  border: 2px dashed var(--black);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--black);
  font-weight: 500;
  min-height: 100px;
  margin: 20px 0;
  border-radius: 8px;
  transition: all 0.3s ease;
}

.ad-placeholder:hover {
  background: #f8f9fa;
  border-color: var(--black);
}

.header-ad {
  min-height: 90px;
  margin: 0;
}

/* Game Section Styles */
.game-section {
  background: var(--white);
  border-radius: 15px;
  box-shadow: var(--shadow);
  padding: 30px;
  margin: 30px 0;
  transition: transform 0.3s ease;
  border: 1px solid var(--black);
}

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

/* Chessboard Styles */
.chessboard-container {
  display: flex;
  justify-content: center;
  margin: 20px 0;
  padding: 20px;
}

.chessboard {
  display: grid;
  grid-template-columns: repeat(8, 60px);
  grid-template-rows: repeat(8, 60px);
  gap: 0;
  border: 3px solid var(--black);
  margin: 0 auto;
  box-shadow: var(--shadow);
}

.square {
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 2.5rem;
  transition: all 0.2s ease;
}

.square.light {
  background-color: var(--white);
}

.square.dark {
  background-color: var(--black);
  color: var(--white);
}

.square:hover {
  opacity: 0.8;
  transform: scale(1.05);
}

.square.selected {
  box-shadow: inset 0 0 0 4px #666;
  background-color: #f0f0f0 !important;
}

.piece {
  user-select: none;
  pointer-events: none;
}

/* Player Info Styles */
.player-info {
  display: flex;
  justify-content: space-between;
  margin: 20px 0;
  padding: 20px;
  background: var(--white);
  border-radius: 10px;
  box-shadow: var(--shadow);
  border: 1px solid var(--black);
}

.player {
  text-align: center;
  flex: 1;
}

.player-name {
  font-family: "Jost", sans-serif;
  font-weight: 600;
  font-size: 1.1rem;
  margin-bottom: 10px;
  color: var(--black);
}

.timer {
  font-size: 1.5rem;
  font-weight: bold;
  color: var(--black);
  font-family: "Poppins", monospace;
  background: var(--white);
  padding: 10px 15px;
  border-radius: 8px;
  border: 2px solid var(--black);
  display: inline-block;
  min-width: 100px;
}

.timer.active {
  background: var(--black);
  color: var(--white);
  animation: timerPulse 2s infinite;
}

@keyframes timerPulse {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
  100% {
    transform: scale(1);
  }
}

/* Game Controls */
.game-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  justify-content: center;
  margin: 25px 0;
}

.control-btn {
  background: var(--black);
  color: var(--white);
  border: none;
  padding: 12px 25px;
  border-radius: 25px;
  font-weight: 500;
  font-size: 0.95rem;
  transition: all 0.3s ease;
  cursor: pointer;
  box-shadow: var(--shadow);
  font-family: "Poppins", sans-serif;
}

.control-btn:hover {
  background: var(--white);
  color: var(--black);
  border: 2px solid var(--black);
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
}

.control-btn:active {
  transform: translateY(-1px);
}

.control-btn i {
  margin-right: 8px;
}

/* Game Status */
.game-status {
  text-align: center;
  padding: 15px;
  background: var(--white);
  border-radius: 8px;
  margin: 20px 0;
  font-weight: 500;
  font-size: 1.1rem;
  border: 1px solid var(--black);
  font-family: "Poppins", sans-serif;
}

/* Move History */
.move-history {
  background: var(--white);
  border-radius: 10px;
  padding: 20px;
  max-height: 400px;
  overflow-y: auto;
  border: 1px solid var(--black);
  box-shadow: var(--shadow);
}

.move-history h5 {
  color: var(--black);
  margin-bottom: 15px;
  font-weight: 600;
  font-family: "Jost", sans-serif;
}

.move-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.move-item {
  padding: 8px 12px;
  background: #f8f9fa;
  border-radius: 5px;
  font-family: "Poppins", monospace;
  font-size: 0.9rem;
  transition: background-color 0.2s ease;
  border: 1px solid var(--black);
}

.move-item:hover {
  background: #e9ecef;
}

.move-entry {
  padding: 5px;
  border-bottom: 1px solid var(--black);
  font-family: "Poppins", monospace;
}

.move-entry:hover {
  background-color: #f8f9fa;
}

/* Game Info */
.game-info {
  background: var(--white);
  border-radius: 10px;
  padding: 20px;
  border: 1px solid var(--black);
  box-shadow: var(--shadow);
}

.game-info h5 {
  color: var(--black);
  margin-bottom: 15px;
  font-weight: 600;
  font-family: "Jost", sans-serif;
}

.info-item {
  margin-bottom: 10px;
  padding: 8px 0;
  border-bottom: 1px solid #f8f9fa;
}

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

/* Article Section */
.article-section {
  background: var(--white);
  border-radius: 15px;
  box-shadow: var(--shadow);
  padding: 40px;
  margin: 30px 0;
  border: 1px solid var(--black);
}

.article-section h1,
.article-section h2,
.article-section h3 {
  color: var(--black);
  margin-bottom: 20px;
  font-family: "Jost", sans-serif;
}

.article-section h1 {
  font-size: 2.5rem;
  text-align: center;
  margin-bottom: 30px;
}

.article-section h2 {
  font-size: 1.8rem;
  border-bottom: 2px solid var(--black);
  padding-bottom: 10px;
  margin-top: 30px;
}

.article-section h3 {
  font-size: 1.4rem;
  margin-top: 25px;
}

.article-section p {
  margin-bottom: 20px;
  text-align: justify;
  line-height: 1.8;
  font-family: "Poppins", sans-serif;
}

.article-section ul,
.article-section ol {
  margin-bottom: 20px;
  padding-left: 30px;
}

.article-section li {
  margin-bottom: 8px;
}

/* Theme Variations */
.theme-classic .square.light {
  background-color: var(--white) !important;
}
.theme-classic .square.dark {
  background-color: var(--black) !important;
  color: var(--white) !important;
}

.theme-modern .square.light {
  background-color: var(--white) !important;
}
.theme-modern .square.dark {
  background-color: var(--black) !important;
  color: var(--white) !important;
}

.theme-blue .square.light {
  background-color: var(--white) !important;
}
.theme-blue .square.dark {
  background-color: var(--black) !important;
  color: var(--white) !important;
}

.theme-purple .square.light {
  background-color: var(--white) !important;
}
.theme-purple .square.dark {
  background-color: var(--black) !important;
  color: var(--white) !important;
}

.theme-wood .square.light {
  background-color: var(--white) !important;
}
.theme-wood .square.dark {
  background-color: var(--black) !important;
  color: var(--white) !important;
}

/* Footer Styles */
.footer {
  background: var(--black);
  color: var(--white);
  padding: 40px 0;
  margin-top: 50px;
}

.footer h5 {
  color: var(--white);
  margin-bottom: 20px;
  font-weight: 600;
  font-family: "Jost", sans-serif;
}

.footer a {
  color: var(--white);
  text-decoration: none;
  transition: color 0.3s ease;
  font-family: "Poppins", sans-serif;
}

.footer a:hover {
  color: var(--white);
  opacity: 0.7;
}

.social-icons a {
  font-size: 1.5rem;
  margin: 0 10px;
  display: inline-block;
  transition: transform 0.3s ease;
}

.social-icons a:hover {
  transform: translateY(-3px);
}

/* Button Styles */
.btn {
  font-family: "Poppins", sans-serif;
  font-weight: 500;
  border-radius: 8px;
  padding: 10px 20px;
  transition: all 0.3s ease;
}

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

.btn-primary:hover {
  background: var(--white);
  border-color: var(--black);
  color: var(--black);
}

.btn-outline-primary {
  background: var(--white);
  border-color: var(--black);
  color: var(--black);
}

.btn-outline-primary:hover {
  background: var(--black);
  border-color: var(--black);
  color: var(--white);
}

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

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

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

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

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

.btn-info:hover {
  background: var(--white);
  border-color: var(--black);
  color: var(--black);
}

.btn-outline-info {
  background: var(--white);
  border-color: var(--black);
  color: var(--black);
}

.btn-outline-info:hover {
  background: var(--black);
  border-color: var(--black);
  color: var(--white);
}

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

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

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

.btn-secondary:hover {
  background: var(--black);
  border-color: var(--black);
  color: var(--white);
}

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

.btn-dark:hover {
  background: var(--white);
  border-color: var(--black);
  color: var(--black);
}

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

.btn-light:hover {
  background: var(--black);
  border-color: var(--black);
  color: var(--white);
}

/* Card Styles */
.card {
  background: var(--white);
  border: 1px solid var(--black);
  border-radius: 10px;
  box-shadow: var(--shadow);
}

.card-header {
  background: var(--black);
  color: var(--white);
  border-bottom: 1px solid var(--black);
  font-family: "Jost", sans-serif;
  font-weight: 600;
}

.card-body {
  background: var(--white);
  color: var(--black);
  font-family: "Poppins", sans-serif;
}

/* Alert Styles */
.alert {
  border-radius: 8px;
  border: 1px solid var(--black);
  font-family: "Poppins", sans-serif;
}

.alert-info {
  background: var(--white);
  color: var(--black);
  border-color: var(--black);
}

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

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

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

/* Form Styles */
.form-control {
  border: 2px solid var(--black);
  border-radius: 8px;
  font-family: "Poppins", sans-serif;
  background: var(--white);
  color: var(--black);
}

.form-control:focus {
  border-color: var(--black);
  box-shadow: 0 0 0 0.2rem rgba(0, 0, 0, 0.25);
  background: var(--white);
  color: var(--black);
}

.form-select {
  border: 2px solid var(--black);
  border-radius: 8px;
  font-family: "Poppins", sans-serif;
  background: var(--white);
  color: var(--black);
}

.form-select:focus {
  border-color: var(--black);
  box-shadow: 0 0 0 0.2rem rgba(0, 0, 0, 0.25);
}

/* Dropdown Styles */
.dropdown-menu {
  background: var(--white);
  border: 1px solid var(--black);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.dropdown-item {
  color: var(--black);
  font-family: "Poppins", sans-serif;
}

.dropdown-item:hover {
  background: var(--black);
  color: var(--white);
}

/* Responsive Design */
@media (max-width: 768px) {
  .game-section {
    padding: 20px;
  }

  .article-section {
    padding: 25px;
  }

  .article-section h1 {
    font-size: 2rem;
  }

  .player-info {
    flex-direction: column;
    gap: 15px;
  }

  .timer {
    font-size: 1.5rem;
  }

  .control-btn {
    padding: 10px 20px;
    font-size: 0.9rem;
  }

  .chessboard {
    grid-template-columns: repeat(8, 45px);
    grid-template-rows: repeat(8, 45px);
  }

  .square {
    width: 45px;
    height: 45px;
    font-size: 2rem;
  }
}

@media (max-width: 576px) {
  .game-controls {
    flex-direction: column;
    align-items: center;
  }

  .control-btn {
    width: 200px;
    margin-bottom: 10px;
  }

  .chessboard {
    grid-template-columns: repeat(8, 35px);
    grid-template-rows: repeat(8, 35px);
  }

  .square {
    width: 35px;
    height: 35px;
    font-size: 1.5rem;
  }
}

/* Loading Animation */
.loading {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid rgba(0, 0, 0, 0.3);
  border-radius: 50%;
  border-top-color: var(--black);
  animation: spin 1s ease-in-out infinite;
}

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

/* Smooth Scrolling */
html {
  scroll-behavior: smooth;
}

/* Focus Styles for Accessibility */
button:focus,
.btn:focus,
.form-control:focus,
.form-select:focus {
  outline: 2px solid var(--black);
  outline-offset: 2px;
}

/* Print Styles */
@media print {
  .header,
  .footer,
  .ad-placeholder,
  .game-controls {
    display: none;
  }

  .game-section,
  .article-section {
    box-shadow: none;
    border: 1px solid var(--black);
  }
}

/* Additional Styles for Specific Pages */
.game-id-display {
  background: var(--black);
  color: var(--white);
  padding: 15px;
  border-radius: 10px;
  text-align: center;
  margin: 15px 0;
  box-shadow: var(--shadow);
  font-family: "Poppins", sans-serif;
}

.game-id-code {
  font-size: 1.8rem;
  font-weight: bold;
  font-family: "Poppins", monospace;
  letter-spacing: 2px;
  margin: 10px 0;
  padding: 10px;
  background: var(--white);
  color: var(--black);
  border-radius: 5px;
}

.multiplayer-options {
  background: var(--white);
  border-radius: 10px;
  padding: 20px;
  margin: 15px 0;
  border: 2px solid var(--black);
}

.debug-info {
  background: var(--white);
  border: 1px solid var(--black);
  border-radius: 5px;
  padding: 10px;
  margin: 10px 0;
  font-family: "Poppins", monospace;
  font-size: 0.8rem;
}

/* Hero Sections */
.rules-hero,
.stats-hero,
.settings-hero,
.hero-section {
  background: var(--black);
  color: var(--white);
  padding: 80px 0;
  text-align: center;
  margin-bottom: 50px;
}

.rules-hero h1,
.stats-hero h1,
.settings-hero h1,
.hero-section h1 {
  font-family: "Jost", sans-serif;
  font-size: 3.5rem;
  font-weight: 700;
  margin-bottom: 20px;
  color: var(--white);
}

.rules-hero p,
.stats-hero p,
.settings-hero p,
.hero-section p {
  font-family: "Poppins", sans-serif;
  font-size: 1.3rem;
  opacity: 0.9;
  color: var(--white);
}

/* Rule Sections */
.rule-section {
  background: var(--white);
  border-radius: 15px;
  padding: 40px;
  margin-bottom: 30px;
  box-shadow: var(--shadow);
  transition: transform 0.3s ease;
  border: 1px solid var(--black);
}

.rule-section:hover {
  transform: translateY(-5px);
}

.rule-section h2 {
  color: var(--black);
  font-size: 2.2rem;
  margin-bottom: 25px;
  border-bottom: 3px solid var(--black);
  padding-bottom: 15px;
  font-family: "Jost", sans-serif;
}

/* Piece Showcase */
.piece-showcase {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 25px;
  margin: 30px 0;
}

.piece-card {
  background: var(--white);
  border-radius: 12px;
  padding: 25px;
  text-align: center;
  border: 2px solid var(--black);
  transition: all 0.3s ease;
}

.piece-card:hover {
  border-color: var(--black);
  transform: scale(1.02);
  box-shadow: var(--shadow-hover);
}

.piece-icon {
  font-size: 4rem;
  margin-bottom: 15px;
  display: block;
  color: var(--black);
}

.piece-name {
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--black);
  margin-bottom: 10px;
  font-family: "Jost", sans-serif;
}

.piece-description {
  color: var(--black);
  line-height: 1.6;
  font-family: "Poppins", sans-serif;
}

/* Special Moves */
.special-moves {
  background: #f8f9fa;
  border-radius: 15px;
  padding: 30px;
  margin: 30px 0;
  border: 1px solid var(--black);
}

.special-move-item {
  background: var(--white);
  border-radius: 10px;
  padding: 20px;
  margin-bottom: 20px;
  border-left: 5px solid var(--black);
}

.special-move-item h4 {
  color: var(--black);
  margin-bottom: 15px;
  font-family: "Jost", sans-serif;
}

/* Game Objectives */
.game-objectives {
  background: #f8f9fa;
  border-radius: 15px;
  padding: 30px;
  margin: 30px 0;
  border: 1px solid var(--black);
}

.objective-item {
  background: var(--white);
  border-radius: 10px;
  padding: 20px;
  margin-bottom: 15px;
  display: flex;
  align-items: center;
  border: 1px solid var(--black);
}

.objective-icon {
  font-size: 2.5rem;
  margin-right: 20px;
  color: var(--black);
}

/* Quick Reference */
.quick-reference {
  background: var(--black);
  color: var(--white);
  border-radius: 15px;
  padding: 30px;
  margin: 30px 0;
}

.quick-reference h3 {
  color: var(--white);
  margin-bottom: 20px;
  font-family: "Jost", sans-serif;
}

.reference-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
}

.reference-item {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 15px;
  text-align: center;
  border: 1px solid var(--white);
}

/* Interactive Demo */
.interactive-demo {
  background: var(--black);
  color: var(--white);
  border-radius: 15px;
  padding: 40px;
  text-align: center;
  margin: 40px 0;
}

.demo-board {
  display: grid;
  grid-template-columns: repeat(8, 40px);
  grid-template-rows: repeat(8, 40px);
  gap: 1px;
  margin: 20px auto;
  border: 2px solid var(--white);
  border-radius: 8px;
  overflow: hidden;
  width: fit-content;
}

.demo-square {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

.demo-square.light {
  background-color: var(--white);
  color: var(--black);
}

.demo-square.dark {
  background-color: var(--black);
  color: var(--white);
}

/* Feature Cards */
.feature-card {
  background: var(--white);
  border-radius: 20px;
  padding: 40px;
  text-align: center;
  box-shadow: var(--shadow);
  transition: all 0.3s ease;
  height: 100%;
  border: 1px solid var(--black);
}

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

.feature-icon {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 25px;
  font-size: 2.5rem;
  color: var(--white);
  background: var(--black);
}

/* Stats Cards */
.stat-card {
  background: var(--white);
  border-radius: 20px;
  padding: 30px;
  text-align: center;
  box-shadow: var(--shadow);
}
