/* Cross overlay for completed/crossed-out cells */
.cell-cross {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 10;
}
.cell-cross:before,
.cell-cross:after {
  content: "";
  position: absolute;
  top: 10%;
  left: 48%;
  width: 4%;
  height: 80%;
  background: #ff4757;
  border-radius: 2px;
}
.cell-cross:before {
  transform: rotate(45deg);
}
.cell-cross:after {
  transform: rotate(-45deg);
}
/* Pokemon Bingo Card Generator Styles */

.bingo-container {
  max-width: 600px;
  margin: 0 auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.bingo-grid {
  display: grid;
  grid-template-columns: repeat(5, 120px);
  grid-template-rows: repeat(5, 120px);
  gap: 8px;
  margin: 20px 0;
  background: #2d2e4a;
  padding: 15px;
  border-radius: 10px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
  width: fit-content;
  justify-content: center;
}

.bingo-cell {
  width: 120px;
  height: 120px;
  min-width: 120px;
  min-height: 120px;
  max-width: 120px;
  max-height: 120px;
  border: 2px solid #74b9ff;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #636e72;
  cursor: pointer;
  position: relative;
  padding: 5px;
  box-sizing: border-box;
  overflow: hidden;
}

.bingo-cell:hover {
  border-color: #0984e3;
  background: #55a3ff;
}

.bingo-cell.center {
  background: #00b894;
  border-color: #00a085;
}

.bingo-cell.center:hover {
  background: #00cec9;
  border-color: #00b894;
}

.bingo-cell img {
  max-width: 80px;
  max-height: 80px;
  object-fit: contain;
}

.bingo-cell .pokemon-name {
  font-size: 10px;
  font-weight: bold;
  text-align: center;
  margin-top: 2px;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
  line-height: 1.1;
  display: flex;
}

.bingo-cell .pokemon-number {
  font-size: 8px;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

.controls {
  display: flex;
  gap: 15px;
  justify-content: center;
  margin: 20px 0;
  flex-wrap: wrap;
  width: 100%;
}

.btn {
  padding: 12px 24px;
  border: none;
  border-radius: 25px;
  cursor: pointer;
  font-weight: bold;
  font-size: 14px;
  transition: all 0.3s ease;
  text-decoration: none;
  display: inline-block;
  text-align: center;
}

.btn-primary {
  background: linear-gradient(45deg, #74b9ff, #0984e3);
  color: white;
}

.btn-primary:hover {
  background: linear-gradient(45deg, #0984e3, #74b9ff);
  transform: translateY(-2px);
}

.btn-secondary {
  background: linear-gradient(45deg, #00b894, #00cec9);
  color: white;
}

.btn-secondary:hover {
  background: linear-gradient(45deg, #00cec9, #00b894);
  transform: translateY(-2px);
}

.btn-download {
  background: linear-gradient(45deg, #e17055, #d63031);
  color: white;
}

.btn-download:hover {
  background: linear-gradient(45deg, #d63031, #e17055);
  transform: translateY(-2px);
}

.btn-locked {
  background: linear-gradient(45deg, #fd79a8, #e84393);
  color: white;
}

.btn-locked:hover {
  background: linear-gradient(45deg, #e84393, #fd79a8);
  transform: translateY(-2px);
}

.bingo-cell.completed {
  position: relative;
  opacity: 0.7;
}

.bingo-cell.completed::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    45deg,
    transparent 40%,
    #e74c3c 40%,
    #e74c3c 60%,
    transparent 60%
  );
  pointer-events: none;
  z-index: 2;
}

.bingo-cell.completed::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    -45deg,
    transparent 40%,
    #e74c3c 40%,
    #e74c3c 60%,
    transparent 60%
  );
  pointer-events: none;
  z-index: 2;
}

.loading {
  opacity: 0.6;
  pointer-events: none;
  min-height: 120px;
  max-height: 120px;
  overflow: hidden;
  margin: 0;
}

.loading::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border: 2px solid #ddd;
  border-top: 2px solid #74b9ff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  z-index: 1;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

.bingo-title {
  text-align: center;
  color: #2d3436;
  margin-bottom: 20px;
  font-size: 2.5em;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.bingo-subtitle {
  text-align: center;
  color: #636e72;
  margin-bottom: 30px;
  font-size: 1.1em;
}

.back-link {
  display: inline-block;
  margin-bottom: 20px;
  color: #74b9ff;
  text-decoration: none;
  font-weight: bold;
}

.back-link:hover {
  color: #0984e3;
}

/* Dark mode styles */
body.dark-mode .bingo-title {
  color: #ddd;
}

body.dark-mode .bingo-subtitle,
body.dark-mode .bingo-instructions {
  color: #b2bec3;
}

body.dark-mode .bingo-grid {
  background: #2d2e4a;
}

body.dark-mode .bingo-cell {
  background: #636e72;
  border-color: #74b9ff;
}

body.dark-mode .bingo-cell:hover {
  background: #55a3ff;
}

/* Light mode styles */
body.light-mode {
  background: #f5f6fa;
  color: #2d3436;
}

.container.light-mode {
  background: #fff;
  color: #2d3436;
}

body.light-mode .bingo-title {
  color: #2d3436;
}

body.light-mode .bingo-subtitle,
body.light-mode .bingo-instructions {
  color: #636e72;
}

body.light-mode .bingo-grid {
  background: #fff;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

body.light-mode .bingo-cell {
  background: #f5f6fa;
  border-color: #74b9ff;
  color: #2d3436;
}

body.light-mode .bingo-cell:hover {
  background: #74b9ff;
  color: white;
}

body.light-mode .bingo-cell.center {
  background: #f5f6fa;
  border-color: #74b9ff;
}

body.light-mode .bingo-cell.center:hover {
  background: #74b9ff;
  border-color: #74b9ff;
}

body.light-mode .back-link {
  color: #0984e3;
}

body.light-mode .back-link:hover {
  color: #74b9ff;
}

/* Responsive design */
@media (max-width: 768px) {
  .bingo-container {
    padding: 10px;
  }

  .bingo-grid {
    grid-template-columns: repeat(5, min(18vw, 100px));
    grid-template-rows: repeat(5, min(18vw, 100px));
    gap: min(1.2vw, 6px);
    padding: 10px;
  }

  .bingo-cell {
    width: min(18vw, 100px);
    height: min(18vw, 100px);
    min-width: min(18vw, 100px);
    min-height: min(18vw, 100px);
    max-width: min(18vw, 100px);
    max-height: min(18vw, 100px);
  }

  .bingo-cell img {
    max-width: min(12vw, 60px);
    max-height: min(12vw, 60px);
  }

  .bingo-cell .pokemon-name {
    font-size: min(2vw, 8px);
  }

  .bingo-cell .pokemon-number {
    font-size: min(1.8vw, 7px);
  }

  .controls {
    flex-direction: column;
    align-items: center;
  }

  .btn {
    width: 80%;
    max-width: 300px;
  }
}

@media (max-width: 480px) {
  .bingo-grid {
    grid-template-columns: repeat(5, min(16vw, 80px));
    grid-template-rows: repeat(5, min(16vw, 80px));
    gap: min(1vw, 4px);
    padding: 8px;
  }

  .bingo-cell {
    width: min(16vw, 80px);
    height: min(16vw, 80px);
    min-width: min(16vw, 80px);
    min-height: min(16vw, 80px);
    max-width: min(16vw, 80px);
    max-height: min(16vw, 80px);
  }

  .bingo-cell img {
    max-width: min(10vw, 50px);
    max-height: min(10vw, 50px);
  }

  .bingo-cell .pokemon-name {
    font-size: min(1.8vw, 7px);
  }

  .bingo-cell .pokemon-number {
    font-size: min(1.6vw, 6px);
  }
}

/* Ensure images are visible for html2canvas capture */
.bingo-cell img {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  transform: none !important;
  filter: none !important;
}

/* Remove any transitions during capture */
.bingo-grid.capturing,
.bingo-grid.capturing * {
  transition: none !important;
  animation: none !important;
}
