@import '../styles/_tokens.css';
@import '../styles/tokens/_tokens.play.css';

/* ========================================
 * PLAY PAGE DESKTOP STYLES
 * ======================================== */

/* Base page styles */
body {
  background: #111;
  color: #ddd;
  margin: 0;
  padding: 0;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  min-height: 100vh;
  overflow-x: hidden;
}

.homepage-container {
  display: flex;
  min-height: 100vh;
}

.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  transition: margin-left 0.3s ease;
}

.main-content.sidebar-collapsed {
  margin: 0 auto;
}

/* Ensure the board and panel are properly centered */
.play-row {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  justify-content: center;
  gap: 20px;
  width: 100%;
  max-width: 1300px; /* board width + panel width + gap */
  margin: 0 auto;
}

.page-title {
  font-size: 2.5em; 
  margin-bottom: 30px; 
  color: #2ecc71; 
  text-align: center;
}

.board-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  width: 100%;
  justify-content: center;
}

/* Board Layout - using new class names */

.play-board-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}

/* Board container */
#board {
  display: flex;
  flex-wrap: wrap;
  width: 800px;
  height: 800px;
  border-radius: 8px;
  background: #f0d9b5;
  overflow: hidden;
}

/* Board squares */
.square {
  width: 100px;
  height: 100px;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 45px;
  user-select: none;
  position: relative;
  overflow: visible;
}

.square.light {
  background-color: var(--board-light, #f0d9b5);
}

.square.dark {
  background-color: var(--board-dark, #b58863);
}

.square.selected {
  outline: 3px solid yellow;
  outline-offset: -3px;
  background-color: rgba(255, 255, 0, 0.25);
}

.square .dot {
  width: 15px;
  height: 15px;
  background-color: rgba(0, 0, 0, 0.3);
  border-radius: 50%;
  pointer-events: none;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 3;
}

.square.check {
  background-color: #ff4d4d !important;
}

/* Square coordinate labels */
.square-label-file {
  position: absolute;
  bottom: 2px;
  right: 4px;
  font-size: 14px;
  font-family: 'Segoe UI', 'Arial', 'Helvetica Neue', sans-serif;
  pointer-events: none;
  z-index: 1;
}

.square-label-rank {
  position: absolute;
  top: 2px;
  left: 4px;
  font-size: 14px;
  font-family: 'Segoe UI', 'Arial', 'Helvetica Neue', sans-serif;
  pointer-events: none;
  z-index: 1;
}

.light-label {
  color: var(--board-light-label, #b58863);
}

.dark-label {
  color: var(--board-dark-label, #f0d9b5);
}

/* Framed board style effects */
#board[data-board-style="Framed"] {
  border: 8px solid #8b4513 !important;
  border-radius: 8px;
  box-shadow: 
    0 0 0 2px #654321,
    0 0 0 6px #8b4513,
    0 0 0 8px #654321,
    0 4px 8px rgba(0,0,0,0.3);
}

#board[data-board-style="Framed"] .square {
  border: 1px solid rgba(139, 69, 19, 0.3);
}

/* Right panel (gameModePanel) - using exact inline styles from original */
#gameModePanel {
  min-width: 500px;
  max-width: 500px;
  width: 500px;
  height: 800px;
  background: linear-gradient(to bottom, #1a1a1a, #111);
  border: 1px solid #2d2d2d;
  border-radius: 12px;
  margin-left: 35px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.7); 
  overflow: hidden;
  font-family: 'Segoe UI', 'Arial', 'Helvetica Neue', sans-serif;
  color: #ddd;
  padding: 20px; 
  box-sizing: border-box;
  transition: transform 0.3s ease, opacity 0.3s ease;
  position: relative;
}

/* Settings Icon */
#settingsIcon {
  width: 16px;
  height: 16px;
  cursor: pointer;
  position: absolute;
  top: 8px;
  left: 8px;
  opacity: 0.7;
  transition: opacity 0.2s;
  z-index: 10;
  filter: brightness(0) saturate(100%) invert(85%) sepia(0%) saturate(0%) hue-rotate(0deg) brightness(100%) contrast(100%);
}

/* Game Mode Title Section */
.game-mode-title-section {
  flex-shrink: 0;
  position: relative;
}

#gameModeTitle {
  padding: 18px 0 0 0;
  text-align: center;
  font-size: 1.3em;
  background: transparent;
  color: #ccc;
  font-family: 'Segoe UI', 'Arial', 'Helvetica Neue', sans-serif;
  font-weight: normal;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 64px;
  min-height: 64px;
}

#timeControlIcon {
  width: 64px;
  height: 64px;
  display: none;
}

#timeControlText {
  margin-left: -10px;
}

/* Separator Line */
.separator-line {
  margin: 0 0 20px 0;
  height: 1px;
  background: #2d2d2d;
  width: 94%;
  margin-left: auto;
  margin-right: auto;
}

/* Content Section */
.content-section {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 0px 16px 16px 16px;
  color: #eee;
}

.content-wrapper {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-top: -10px;
}

/* Time Control Groups */
.time-control-group {
  /* Container for each time control section */
}

.time-control-label {
  text-align: left;
  color: #ccc;
  font-size: 1.0em;
  font-weight: 500;
  margin-bottom: 3px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.time-control-label img {
  width: 45px;
  height: 45px;
  margin-left: -5px;
}

.time-control-label span {
  margin-left: -5px;
}

.time-control-buttons {
  display: flex;
  gap: 8px;
  justify-content: space-between;
}

/* Time Buttons */
.time-button {
  flex: 1;
  padding: 24px 8px;
  background: #333 !important;
  color: white !important;
  border-radius: 6px !important;
  cursor: pointer !important;
  font-size: 14px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  border: 0 !important;
  outline: 0 !important;
  box-shadow: 0 !important;
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  appearance: none !important;
  margin: 0 !important;
  transition: background-color 0.2s ease !important;
}

.time-button:hover {
  background: #444 !important;
  border: 0 !important;
  outline: 0 !important;
  box-shadow: 0 !important;
}

.time-button:focus {
  border: 0 !important;
  outline: 0 !important;
  box-shadow: 0 !important;
}

.time-button:active {
  border: 0 !important;
  outline: 0 !important;
  box-shadow: 0 !important;
}

.time-button.selected {
  border: 2px solid #2ecc71 !important;
  outline: 0 !important;
  box-shadow: 0 !important;
  padding: 22px 6px !important;
}

/* Separator Line Bottom */
.separator-line-bottom {
  margin: 20px 0;
  height: 1px;
  background: #2d2d2d;
}

/* Find Match Button Container */
.find-match-container {
  margin-top: 3px;
}

#findMatchBtn {
  width: calc(100% + 1px);
  margin-left: 0.5px;
  padding: 32px 8px;
  background: #2ecc71;
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 18px;
  font-weight: bold;
  cursor: pointer;
  transition: background-color 0.2s ease;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
}

#findMatchBtn:hover {
  background: #4CAF50;
}

/* Settings Modal */
#settingsModal {
  display: none;
}

.settings-tabs .tab-icon img {
  width: 56px;
  height: 56px;
  filter: brightness(0) saturate(100%) invert(85%) sepia(0%) saturate(0%) hue-rotate(0deg) brightness(100%) contrast(100%);
}

.setting-row {
  border-bottom: none;
}

