/* ==========================================================================
   INCREDIBLE INDIA EXPLORER - CHESS HERITAGE EXPLORER STYLESHEET
   ========================================================================== */

@import url("../../styles.css");

/* Container & Global Scope */
.chess-explorer-page {
  background-color: var(--bg-dark-deep, #090d16);
  color: var(--text-light, #f8fafc);
  font-family: var(--font-body, 'Outfit', sans-serif);
  min-height: 100vh;
  margin: 0;
  padding: 0;
  overflow-x: hidden;
}

.chess-hero {
  position: relative;
  padding: 100px 20px 60px;
  background: radial-gradient(circle at 50% 20%, rgba(255, 153, 51, 0.15), transparent 70%),
              linear-gradient(180deg, rgba(15, 23, 42, 0.95) 0%, rgba(9, 13, 22, 1) 100%);
  border-bottom: 1px solid var(--glass-border, rgba(255, 255, 255, 0.1));
  text-align: center;
}

.chess-hero-bg-grid {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: 
    linear-gradient(to right, rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 40px 40px;
  opacity: 0.5;
  pointer-events: none;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 18px;
  border-radius: 30px;
  background: rgba(255, 153, 51, 0.15);
  border: 1px solid rgba(255, 153, 51, 0.4);
  color: var(--primary-saffron, #ff9933);
  font-weight: 600;
  font-size: 0.9rem;
  letter-spacing: 0.5px;
  margin-bottom: 20px;
  text-transform: uppercase;
}

.chess-hero h1 {
  font-family: var(--font-heading, 'Playfair Display', serif);
  font-size: 3.2rem;
  font-weight: 800;
  margin-bottom: 16px;
  background: linear-gradient(135deg, #ffffff 0%, #ffb01f 50%, #ff9933 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1.2;
}

.chess-hero p.hero-subtitle {
  max-width: 800px;
  margin: 0 auto 40px;
  font-size: 1.15rem;
  color: var(--text-muted, #94a3b8);
  line-height: 1.6;
}

/* Stat Counters Banner */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  max-width: 1100px;
  margin: 0 auto;
}

.stat-card {
  background: var(--bg-dark-card, rgba(30, 41, 59, 0.65));
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--border-radius-lg, 18px);
  padding: 20px;
  text-align: center;
  transition: transform 0.3s ease, border-color 0.3s ease;
}

.stat-card:hover {
  transform: translateY(-4px);
  border-color: rgba(255, 153, 51, 0.4);
}

.stat-number {
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--primary-saffron, #ff9933);
  font-family: var(--font-heading, serif);
}

.stat-label {
  font-size: 0.9rem;
  color: var(--text-muted, #94a3b8);
  margin-top: 4px;
}

/* Quick Navigation Sticky Bar */
.subnav-bar {
  position: sticky;
  top: 70px;
  z-index: 90;
  background: rgba(15, 23, 42, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding: 12px 20px;
}

.subnav-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  gap: 12px;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 4px;
}

.subnav-container::-webkit-scrollbar {
  display: none;
}

.subnav-btn {
  padding: 8px 18px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-muted, #94a3b8);
  font-size: 0.9rem;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.25s ease;
}

.subnav-btn:hover,
.subnav-btn.active {
  background: var(--primary-saffron, #ff9933);
  color: #000;
  border-color: var(--primary-saffron, #ff9933);
  font-weight: 600;
  box-shadow: 0 0 15px rgba(255, 153, 51, 0.3);
}

/* Main Section Containers */
.chess-section {
  max-width: 1200px;
  margin: 0 auto;
  padding: 60px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.section-header {
  margin-bottom: 40px;
}

.section-header .section-tag {
  color: var(--primary-gold, #ffb01f);
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  display: block;
  margin-bottom: 6px;
}

.section-header h2 {
  font-family: var(--font-heading, serif);
  font-size: 2.2rem;
  font-weight: 700;
  margin-bottom: 10px;
}

.section-header p {
  color: var(--text-muted, #94a3b8);
  font-size: 1.05rem;
  max-width: 700px;
}

/* Evolution Timeline */
.timeline-container {
  position: relative;
  padding-left: 30px;
  border-left: 2px solid rgba(255, 153, 51, 0.3);
}

.timeline-item {
  position: relative;
  margin-bottom: 40px;
}

.timeline-marker {
  position: absolute;
  left: -41px;
  top: 0;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--primary-saffron, #ff9933);
  border: 4px solid #090d16;
  box-shadow: 0 0 10px rgba(255, 153, 51, 0.5);
}

.timeline-card {
  background: var(--bg-dark-card, rgba(30, 41, 59, 0.65));
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--border-radius-lg, 18px);
  padding: 24px;
  transition: transform 0.3s ease;
}

.timeline-card:hover {
  transform: translateX(6px);
  border-color: rgba(255, 176, 31, 0.4);
}

.timeline-period {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 12px;
  background: rgba(255, 176, 31, 0.15);
  color: var(--primary-gold, #ffb01f);
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 10px;
}

.timeline-card h3 {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.timeline-card .subtitle {
  color: var(--primary-saffron, #ff9933);
  font-weight: 500;
  font-size: 1rem;
  margin-bottom: 12px;
}

.timeline-card p {
  color: var(--text-muted, #94a3b8);
  line-height: 1.6;
}

/* Tabs & Filter Bar Controls */
.filter-tabs {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.tab-btn {
  padding: 10px 20px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-light, #f8fafc);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.tab-btn.active,
.tab-btn:hover {
  background: var(--primary-saffron, #ff9933);
  color: #000;
  border-color: var(--primary-saffron, #ff9933);
}

.search-filter-box {
  display: flex;
  gap: 16px;
  margin-bottom: 30px;
  flex-wrap: wrap;
}

.search-input, .select-filter {
  padding: 12px 18px;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s ease;
}

.search-input {
  flex: 1;
  min-width: 250px;
}

.search-input:focus, .select-filter:focus {
  border-color: var(--primary-saffron, #ff9933);
  box-shadow: 0 0 10px rgba(255, 153, 51, 0.2);
}

/* Data Table Styling */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  border-radius: var(--border-radius-lg, 18px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: var(--bg-dark-card, rgba(30, 41, 59, 0.65));
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.95rem;
}

.data-table th {
  background: rgba(15, 23, 42, 0.9);
  color: var(--primary-gold, #ffb01f);
  padding: 16px;
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.8rem;
  letter-spacing: 0.5px;
  border-bottom: 2px solid rgba(255, 255, 255, 0.1);
}

.data-table td {
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  color: var(--text-light, #f8fafc);
}

.data-table tbody tr:hover {
  background: rgba(255, 153, 51, 0.08);
}

.badge-gold {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 12px;
  background: rgba(255, 176, 31, 0.2);
  color: var(--primary-gold, #ffb01f);
  font-weight: 600;
  font-size: 0.85rem;
}

/* Champions Grid */
.champions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;
}

.champion-card {
  background: var(--bg-dark-card, rgba(30, 41, 59, 0.65));
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--border-radius-lg, 18px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: all 0.3s ease;
  cursor: pointer;
}

.champion-card:hover {
  transform: translateY(-6px);
  border-color: var(--primary-saffron, #ff9933);
  box-shadow: var(--shadow-soft, 0 8px 30px rgba(0,0,0,0.3));
}

.card-header-banner {
  padding: 24px;
  color: #fff;
  position: relative;
}

.card-header-banner .icon-avatar {
  font-size: 2.5rem;
  margin-bottom: 10px;
}

.card-header-banner h3 {
  font-size: 1.4rem;
  font-weight: 700;
  margin: 0;
}

.card-header-banner .title-tag {
  font-size: 0.85rem;
  opacity: 0.9;
  margin-top: 4px;
}

.champion-card-body {
  padding: 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.champion-meta {
  display: flex;
  gap: 12px;
  font-size: 0.85rem;
  color: var(--text-muted, #94a3b8);
  margin-bottom: 12px;
}

.champion-summary {
  font-size: 0.95rem;
  color: #cbd5e1;
  line-height: 1.5;
  margin-bottom: 16px;
}

.view-profile-btn {
  align-self: flex-start;
  padding: 8px 16px;
  border-radius: 8px;
  background: rgba(255, 153, 51, 0.15);
  color: var(--primary-saffron, #ff9933);
  border: 1px solid rgba(255, 153, 51, 0.3);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.champion-card:hover .view-profile-btn {
  background: var(--primary-saffron, #ff9933);
  color: #000;
}

/* Modal Popup */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-content {
  background: var(--bg-dark-modal, #0f172a);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 20px;
  max-width: 650px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 30px;
  position: relative;
  box-shadow: 0 20px 50px rgba(0,0,0,0.5);
}

.close-modal-btn {
  position: absolute;
  top: 20px;
  right: 20px;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: #fff;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Interactive Chessboard Section */
.chessboard-layout {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 30px;
  align-items: start;
}

@media (max-width: 900px) {
  .chessboard-layout {
    grid-template-columns: 1fr;
  }
}

.chessboard-container {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.chessboard-wrapper {
  position: relative;
  width: 100%;
  max-width: 480px;
  aspect-ratio: 1 / 1;
  background: #262421;
  border-radius: 12px;
  padding: 12px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.6);
  border: 2px solid rgba(255, 255, 255, 0.1);
}

.board-grid {
  width: 100%;
  height: 100%;
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  grid-template-rows: repeat(8, 1fr);
  border-radius: 4px;
  overflow: hidden;
}

.square {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.2rem;
  user-select: none;
  position: relative;
  transition: background-color 0.15s ease;
}

.square.light {
  background-color: #f0d9b5;
  color: #333;
}

.square.dark {
  background-color: #b58863;
  color: #fff;
}

.square.highlight {
  background-color: rgba(255, 200, 0, 0.6) !important;
}

.square .piece {
  width: 85%;
  height: 85%;
  object-fit: contain;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}

.board-controls {
  display: flex;
  gap: 12px;
  margin-top: 20px;
  width: 100%;
  max-width: 480px;
  justify-content: center;
}

.board-ctrl-btn {
  flex: 1;
  padding: 12px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
  font-size: 1.1rem;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.board-ctrl-btn:hover {
  background: var(--primary-saffron, #ff9933);
  color: #000;
}

.game-info-panel {
  background: var(--bg-dark-card, rgba(30, 41, 59, 0.65));
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--border-radius-lg, 18px);
  padding: 24px;
}

.game-selector-select {
  width: 100%;
  margin-bottom: 20px;
}

.moves-list-box {
  max-height: 240px;
  overflow-y: auto;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 12px;
  display: grid;
  grid-template-columns: 40px 1fr 1fr;
  gap: 6px;
  font-size: 0.9rem;
  font-family: monospace;
}

.move-num {
  color: var(--text-muted, #94a3b8);
}

.move-ply {
  padding: 4px 8px;
  border-radius: 4px;
  cursor: pointer;
}

.move-ply:hover,
.move-ply.active {
  background: var(--primary-saffron, #ff9933);
  color: #000;
  font-weight: bold;
}

.move-commentary {
  margin-top: 16px;
  padding: 14px;
  border-radius: 10px;
  background: rgba(255, 176, 31, 0.1);
  border-left: 3px solid var(--primary-gold, #ffb01f);
  font-size: 0.9rem;
  color: #e2e8f0;
}

/* Quiz Section */
.quiz-card {
  background: var(--bg-dark-card, rgba(30, 41, 59, 0.65));
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--border-radius-lg, 18px);
  padding: 36px;
  max-width: 750px;
  margin: 0 auto;
}

.quiz-option {
  display: block;
  width: 100%;
  padding: 14px 20px;
  margin-bottom: 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #fff;
  text-align: left;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.quiz-option:hover {
  background: rgba(255, 153, 51, 0.15);
  border-color: var(--primary-saffron, #ff9933);
}

.quiz-option.correct {
  background: rgba(16, 185, 129, 0.25) !important;
  border-color: #10b981 !important;
  color: #a7f3d0;
}

.quiz-option.incorrect {
  background: rgba(239, 68, 68, 0.25) !important;
  border-color: #ef4444 !important;
  color: #fca5a5;
}

/* Light Theme Overrides */
[data-theme="light"] .chess-explorer-page {
  background-color: #f8fafc;
  color: #0f172a;
}

[data-theme="light"] .chess-hero {
  background: radial-gradient(circle at 50% 20%, rgba(255, 153, 51, 0.1), transparent 70%),
              linear-gradient(180deg, #f1f5f9 0%, #e2e8f0 100%);
}

[data-theme="light"] .chess-hero h1 {
  background: linear-gradient(135deg, #0f172a 0%, #b45309 50%, #d97706 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

[data-theme="light"] .stat-card,
[data-theme="light"] .timeline-card,
[data-theme="light"] .table-responsive,
[data-theme="light"] .champion-card,
[data-theme="light"] .game-info-panel,
[data-theme="light"] .quiz-card {
  background: #ffffff;
  border-color: #cbd5e1;
  color: #0f172a;
}

[data-theme="light"] .data-table th {
  background: #f1f5f9;
  color: #b45309;
}

[data-theme="light"] .data-table td {
  color: #1e293b;
  border-bottom-color: #e2e8f0;
}

[data-theme="light"] .search-input,
[data-theme="light"] .select-filter {
  background: #ffffff;
  color: #0f172a;
  border-color: #cbd5e1;
}

[data-theme="light"] .subnav-bar {
  background: rgba(255, 255, 255, 0.92);
}
