.sudoku-grid {
  display: grid;
  grid-template-columns: repeat(9, 1fr);
  grid-template-rows: repeat(9, 1fr);
  width: 100%;
  aspect-ratio: 1;
  border: 2px solid #cbd5e1;
  border-radius: 0.5rem;
  overflow: hidden;
}

.dark .sudoku-grid {
  border-color: #4b5563;
}

.sudoku-cell {
  position: relative;
  width: 100%;
  height: 100%;
  border: 1px solid #cbd5e1;
}

.dark .sudoku-cell {
  border-color: #4b5563;
}

.thick-top {
  border-top: 2px solid #94a3b8;
}

.dark .thick-top {
  border-top-color: #6b7280;
}

.thick-left {
  border-left: 2px solid #94a3b8;
}

.dark .thick-left {
  border-left-color: #6b7280;
}

.thick-bottom {
  border-bottom: 2px solid #94a3b8;
}

.dark .thick-bottom {
  border-bottom-color: #6b7280;
}

.thick-right {
  border-right: 2px solid #94a3b8;
}

.dark .thick-right {
  border-right-color: #6b7280;
}

.cell-input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  text-align: center;
  outline: none;
  background: transparent;
  z-index: 10;
  color: #1f2937;
  font-size: 1.3rem;
  font-weight: 500;;
}

.dark .cell-input {
  color: #f9fafb;
}

.cell-notes {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  font-size: 8px;
  color: #9ca3af;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.dark .cell-notes {
  color: #9ca3af;
}

.notes-row {
  display: flex;
  flex-direction: row;
  height: 33.33%;
  width: 100%;
}

.note-item {
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  width: 33.33%;
  height: 100%;
}

.number-button {
  background-color: #e5e7eb;
  color: #1f2937;
  font-weight: bold;
  border-radius: 0.25rem;
  width: 2.5rem;
  height: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color 0.2s;
  border: none;
}

.dark .number-button {
  background-color: #4b5563;
  color: #f9fafb;
}

.number-button:hover {
  background-color: #d1d5db;
}

.dark .number-button:hover {
  background-color: #6b7280;
}

.number-button.selected {
  background-color: #3b82f6;
  color: white;
}

.dark .number-button.selected {
  background-color: #1d4ed8;
  color: white;
}

.toggle-btn {
  background-color: #0ea5e9;
  color: white;
  font-weight: bold;
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  transition: background-color 0.3s;
  cursor: pointer;
  border: none;
}

.dark .toggle-btn {
  background-color: #0284c7;
}

.toggle-btn:hover {
  background-color: #0284c7;
}

.toggle-btn.hide-notes {
  background-color: #f43f5e;
}

.toggle-btn.hide-notes:hover {
  background-color: #e11d48;
}

.dark .toggle-btn.hide-notes {
  background-color: #dc2626;
}

.edit-btn {
    background-color: white;
    border: 2px solid #cbd5e1;
    border-radius: 0.5rem;
    width: 2.5rem;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    opacity: 0.5;
    pointer-events: none;
}

.dark .edit-btn {
    background-color: #1f2937;
    border-color: #4b5563;
}

.edit-btn:not(:disabled) {
    pointer-events: auto;
}

.edit-btn.active {
    opacity: 1;
}

.edit-btn:not(:disabled):hover {
    border-color: #cbd5e1;
}

.edit-btn svg {
    color: #6b7280;
}

.dark .edit-btn svg {
    color: #9ca3af;
}

.edit-btn.active {
    border-color: #3b82f6;
}

.edit-btn.active:focus {
    border-color: #3b82f6;
}

.dark .edit-btn.active {
    border-color: #1d4ed8;
}

.dark .edit-btn.active:focus {
    border-color: #1d4ed8;
}

.edit-btn.active svg {
    color: #3b82f6;
}

.dark .edit-btn.active svg {
    color: #1d4ed8;
}

.cell-input.highlighted {
  background-color: #dbeafe;
}

.dark .cell-input.highlighted {
  background-color: #1e3a8a;
}

.note-item.highlighted {
  background-color: #dbeafe;
  color: #1d4ed8;
}

.dark .note-item.highlighted {
  background-color: #1e3a8a;
  color: #93c5fd;
}

/* Theme colors */
.bg-body {
  background-color: #f1f5f9;
}

.dark .bg-body {
  background-color: #0f172a;
}

.bg-card {
  background-color: #ffffff;
}

.dark .bg-card {
  background-color: #1e293b;
}

.text-primary {
  color: #1f2937;
}

.dark .text-primary {
  color: #f1f5f9;
}

.text-secondary {
  color: #6b7280;
}

.dark .text-secondary {
  color: #9ca3af;
}

.text-primary-hover {
  color: #374151;
}

.dark .text-primary-hover {
  color: #d1d5db;
}

.bg-light {
  background-color: #f1f5f9;
}

.text-light-text {
  color: #374151;
}

.bg-light-hover {
  background-color: #e2e8f0;
}

.bg-dark {
  background-color: #374151;
}

.text-dark-text {
  color: #ffffff;
}

.bg-dark-hover {
  background-color: #4b5563;
}

.active-theme {
  background-color: #3b82f6;
  color: white;
}

.active-theme:hover {
  background-color: #2563eb;
}

/* Incorrect flash animation */
.incorrect-flash {
  animation: flash-red 0.5s ease-in-out;
}

@keyframes flash-red {
  0% {
    border-color: #ef4444;
    box-shadow: 0 0 0 2px #ef4444;
  }
  50% {
    border-color: #ef4444;
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.5);
  }
  100% {
    border-color: #cbd5e1;
    box-shadow: none;
  }
}

.dark .incorrect-flash {
  animation: flash-red-dark 0.5s ease-in-out;
}

@keyframes flash-red-dark {
  0% {
    border-color: #ef4444;
    box-shadow: 0 0 0 2px #ef4444;
  }
  50% {
    border-color: #ef4444;
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.5);
  }
  100% {
    border-color: #4b5563;
    box-shadow: none;
  }
}