/* Spreadsheet Chess Styles */
body {
  margin: 0;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background-color: #f8f9fa;
  color: #333;
}

.app-container {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header Styles */
.app-header {
  background: white;
  border-bottom: 1px solid #e1e5e9;
  padding: 8px 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.app-icon {
  font-size: 24px;
}

.app-title {
  font-size: 20px;
  font-weight: 500;
  color: #5f6368;
  margin: 0;
}

.formula-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: 24px;
}

.formula-label {
  font-size: 14px;
  color: #5f6368;
  font-weight: 500;
}

.formula-input {
  border: 1px solid #dadce0;
  border-radius: 4px;
  padding: 4px 8px;
  font-size: 14px;
  width: 120px;
  background: white;
}

.new-game-btn {
  background: #1a73e8;
  color: white;
  border: none;
  border-radius: 4px;
  padding: 8px 16px;
  font-size: 14px;
  cursor: pointer;
  transition: background-color 0.2s;
}

.new-game-btn:hover {
  background: #1557b0;
}

/* Main Content */
.main-content {
  flex: 1;
  padding: 20px;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
  box-sizing: border-box;
}

.game-container {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 24px;
  align-items: start;
}

/* Chess Board Styles */
.chess-board-container {
  background: white;
  border: 1px solid #dadce0;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.column-headers {
  display: grid;
  grid-template-columns: 40px repeat(8, 1fr);
  background: #f8f9fa;
  border-bottom: 1px solid #dadce0;
}

.corner-cell {
  width: 40px;
  height: 32px;
  border-right: 1px solid #dadce0;
  background: #f8f9fa;
}

.column-header {
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 500;
  color: #5f6368;
  border-right: 1px solid #dadce0;
  background: #f8f9fa;
  font-size: 14px;
}

.column-header:last-child {
  border-right: none;
}

.board-row {
  display: grid;
  grid-template-columns: 40px repeat(8, 1fr);
  border-bottom: 1px solid #dadce0;
}

.board-row:last-child {
  border-bottom: none;
}

.row-header {
  width: 40px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f8f9fa;
  border-right: 1px solid #dadce0;
  font-weight: 500;
  color: #5f6368;
  font-size: 14px;
}

.chess-cell {
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  cursor: pointer;
  border-right: 1px solid #dadce0;
  transition: all 0.2s ease;
  user-select: none;
  position: relative;
}

.chess-cell:last-child {
  border-right: none;
}

.chess-cell:hover {
  background-color: #e8f0fe !important;
}

.selected-cell {
  background-color: #1a73e8 !important;
  color: white;
  box-shadow: inset 0 0 0 2px #1557b0;
}

.valid-move {
  background-color: #e8f5e8 !important;
}

.valid-move::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 12px;
  height: 12px;
  background: #34a853;
  border-radius: 50%;
  opacity: 0.7;
}

.chess-cell:not(:empty).valid-move::after {
  display: none;
}

.chess-cell:not(:empty).valid-move {
  box-shadow: inset 0 0 0 3px #34a853;
}

.check-cell {
  background-color: #fce8e6 !important;
  box-shadow: inset 0 0 0 2px #ea4335;
}

/* Sidebar Styles */
.game-sidebar {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.game-info {
  background: white;
  border: 1px solid #dadce0;
  border-radius: 8px;
  padding: 16px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.status-section h2 {
  margin: 0 0 12px 0;
  color: #1a73e8;
  font-size: 18px;
}

.captured-section h3 {
  margin: 0 0 8px 0;
  color: #5f6368;
  font-size: 14px;
  font-weight: 500;
}

.captured-pieces div {
  font-size: 14px;
  margin-bottom: 4px;
  font-family: monospace;
}

.move-history {
  background: white;
  border: 1px solid #dadce0;
  border-radius: 8px;
  padding: 16px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.move-history h3 {
  margin: 0 0 12px 0;
  color: #5f6368;
  font-size: 14px;
  font-weight: 500;
}

.move-list {
  max-height: 300px;
  overflow-y: auto;
  font-family: monospace;
  font-size: 13px;
}

.move-item {
  padding: 2px 0;
  color: #333;
}

/* Footer */
.app-footer {
  text-align: center;
  padding: 20px;
  background: #f8f9fa;
  border-top: 1px solid #e1e5e9;
  color: #5f6368;
  font-size: 14px;
}

.app-footer a {
  color: #1a73e8;
  text-decoration: none;
}

.app-footer a:hover {
  text-decoration: underline;
}

/* Responsive Design */
@media (max-width: 768px) {
  .game-container {
    grid-template-columns: 1fr;
  }
  
  .chess-cell {
    height: 50px;
    font-size: 24px;
  }
  
  .row-header {
    height: 50px;
  }
  
  .header-content {
    flex-direction: column;
    gap: 12px;
    align-items: stretch;
  }
  
  .formula-bar {
    margin-left: 0;
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .chess-cell {
    height: 40px;
    font-size: 20px;
  }
  
  .row-header {
    height: 40px;
    width: 32px;
  }
  
  .column-headers {
    grid-template-columns: 32px repeat(8, 1fr);
  }
  
  .corner-cell {
    width: 32px;
  }
  
  .main-content {
    padding: 12px;
  }
}