/* CSS Variables */
:root {
  --primary-color: #4a75a2;
  --primary-hover: #395d82;
  --text-color: #2c3e50;
  --text-secondary: #666;
  --background-color: #f5f5f5;
  --white: #ffffff;
  --shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  --border-radius: 4px;
  --transition: 0.2s ease;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px;
  background-color: var(--background-color);
  min-height: 100vh;
  color: var(--text-color);
}

/* Typography */
h1, h2, h3 {
  color: var(--text-color);
  margin-bottom: 1rem;
}

h1 {
  font-size: 2rem;
  margin-bottom: 1.5rem;
}

h2 {
  font-size: 1.5rem;
}

/* Layout */
.main-content {
  display: flex;
  gap: 20px;
  max-width: 1400px;
  width: 100%;
  position: relative;
}

.content-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.container {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px;
}

/* Board Container */
.board-container {
  width: 500px;
  max-width: 100%;
  position: relative;
  touch-action: none;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

#board {
  width: 100%;
  margin-bottom: 10px;
  box-shadow: var(--shadow);
}

#board * {
  touch-action: none;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

/* Game Info */
.game-info {
  width: 300px;
  max-width: 100%;
}

.moves-container {
  padding: 15px;
  background: var(--white);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
}

#moves {
  height: 350px;
  overflow-y: auto;
  margin-bottom: 10px;
}

.move-row {
  display: flex;
  margin-bottom: 8px;
}

.move-number {
  width: 30px;
  font-weight: bold;
  color: var(--text-secondary);
}

.move {
  flex-grow: 1;
  padding: 3px 8px;
  margin: 0 3px;
  border-radius: var(--border-radius);
  cursor: pointer;
  transition: background-color var(--transition);
}

.move:hover {
  background-color: var(--background-color);
}

.move.active {
  background-color: #e0e0e0;
  font-weight: bold;
}

/* Navigation */
.nav-buttons {
  display: flex;
  justify-content: space-between;
}

.nav-buttons button {
  font-size: 12px;
}

/* Buttons */
button {
  padding: 8px 12px;
  background-color: var(--primary-color);
  color: var(--white);
  border: none;
  border-radius: var(--border-radius);
  cursor: pointer;
  font-size: 14px;
  transition: background-color var(--transition);
}

button:hover {
  background-color: var(--primary-hover);
}

button:disabled {
  background-color: #cccccc;
  cursor: not-allowed;
}

/* Sidebar */
.sidebar {
  width: 300px;
  background: var(--white);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  padding: 15px;
  height: fit-content;
  position: sticky;
  top: 20px;
  align-self: flex-start;
}

.filter-section {
  margin-bottom: 20px;
}

.filter-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.filter-options label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

/* Form Elements */
select, textarea {
  width: 100%;
  padding: 8px;
  border: 1px solid #ccc;
  border-radius: var(--border-radius);
  margin-top: 5px;
  font-family: inherit;
}

#pgn-input {
  height: 100px;
  resize: vertical;
}

/* Video List */
#video-list-container {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.video-item {
  display: flex;
  gap: 10px;
  text-decoration: none;
  color: inherit;
  padding: 8px;
  border-radius: var(--border-radius);
  transition: background-color var(--transition);
}

.video-item:hover {
  background-color: var(--background-color);
}

.video-item img {
  width: 120px;
  height: 68px;
  object-fit: cover;
  border-radius: var(--border-radius);
}

.video-text {
  flex: 1;
}

.video-title {
  font-weight: bold;
  margin-bottom: 4px;
  color: var(--text-color);
}

.video-description {
  font-size: 0.9em;
  color: var(--text-secondary);
}

.chess-com-link {
  font-size: 0.8em;
  color: var(--primary-color);
  text-decoration: none;
  display: inline-block;
  margin-top: 2px;
}

.chess-com-link:hover {
  text-decoration: underline;
}

/* Promotion Modal */
.promotion-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  z-index: 1000;
  justify-content: center;
  align-items: center;
}

.promotion-options {
  display: flex;
  background-color: var(--white);
  padding: 15px;
  border-radius: 8px;
}

.promotion-piece {
  width: 60px;
  height: 60px;
  margin: 5px;
  cursor: pointer;
  border: 2px solid transparent;
  border-radius: var(--border-radius);
  transition: border-color var(--transition);
}

.promotion-piece:hover {
  border-color: var(--primary-color);
}

/* PGN Container */
.pgn-container {
  margin-top: 20px;
  padding: 15px;
  background: var(--white);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  width: 100%;
  max-width: 1000px;
}

.pgn-controls {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Responsive Design */
@media (max-width: 1200px) {
  .main-content {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    max-width: 1000px;
    margin-top: 20px;
    position: static;
  }
}

@media (max-width: 768px) {
  .board-container {
    width: 100%;
  }
  
  .game-info {
    width: 100%;
  }
} 