/* General Body Styling */
body {
  font-family: 'Arial', sans-serif;
  background-color: #121212;
  color: white;
  margin: 0;
  padding: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
  overflow: hidden;
  position: relative; /* Required for the pseudo-element to position correctly */
}

/* Container to Center Content */
.container {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background-color: #212121;
  padding: 20px;
  border-radius: 15px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
  width: 100%;
  max-width: 600px; /* Prevents it from becoming too wide on large screens */
  position: relative;
  z-index: 1; /* Ensures the content stays above the background */
}

/* Add Background Image with Opacity */
body::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: url('malware.png');
  background-size:contain;
  background-position: center;
  opacity: 0.3; /* Adjust the opacity as needed */
  z-index: -1; /* Places the background behind the content */
}

/* Difficulty Selection Screen */
#difficulty-screen {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 100%;
}

.difficulty-selection button {
  margin: 15px;
  padding: 18px 36px;
  font-size: 20px;
  background-color: #4CAF50;
  color: white;
  border: none;
  cursor: pointer;
  border-radius: 10px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
  transition: all 0.3s ease;
}

.difficulty-selection button:hover {
  background-color: #45a049;
  transform: scale(1.1);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

/* Game Screen */
#game-screen {
  display: none;
  background-color: #212121;
  padding: 20px;
  width: 100%;
  animation: fadeIn 1s ease-in;
}

.info p {
  font-size: 20px;
  margin: 10px 0;
  font-weight: bold;
  text-shadow: 1px 1px 2px black;
}

/* Grid Container */
.grid-container {
  display: flex;
  justify-content: center;
  margin-top: 30px;
}

/* Grid Styling */
.grid {
  display: grid;
  grid-template-columns: repeat(5, 70px);
  grid-template-rows: repeat(5, 70px);
  gap: 10px;
  justify-content: center;
  transition: all 0.3s ease;
}

.grid-cell {
  width: 70px;
  height: 70px;
  border: 2px solid #444;
  background-color: #333;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  border-radius: 8px;
  transition: all 0.3s ease;
}

.grid-cell:hover {
  background-color: #555;
  transform: scale(1.05);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.grid-cell:active {
  transform: scale(0.95);
  background-color: #777;
}

/* Controls */
.controls {
  margin-top: 30px;
  display: flex;
  justify-content: center;
  gap: 20px;
}

.controls button {
  padding: 12px 28px;
  font-size: 18px;
  background-color: #2196F3;
  color: white;
  border: none;
  cursor: pointer;
  border-radius: 10px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
  transition: all 0.3s ease;
}

.controls button:hover {
  background-color: #0b7dda;
  transform: scale(1.1);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.controls button:active {
  transform: scale(0.95);
  background-color: #0987d9;
}

/* Reveal Safe Cell Styling */
#reveal-safe-cell {
  padding: 12px 28px;
  font-size: 18px;
  background-color: #FFEB3B;
  color: #212121;
  border: none;
  cursor: pointer;
  border-radius: 10px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
  transition: all 0.3s ease;
}

#reveal-safe-cell:hover {
  background-color: #fdd835;
  transform: scale(1.1);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

#reveal-safe-cell:active {
  transform: scale(0.95);
  background-color: #fbc02d;
}

/* Restart Button */
#restart {
  padding: 15px 30px;
  font-size: 22px;
  background-color: #FF5722;
  color: white;
  border: none;
  cursor: pointer;
  border-radius: 10px;
  margin-top: 30px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
  transition: all 0.3s ease;
}

#restart:hover {
  background-color: #e64a19;
  transform: scale(1.1);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

#restart:active {
  transform: scale(0.95);
}

/* Animations */
@keyframes fadeIn {
  0% {
    opacity: 0;
    transform: translateY(-20px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Responsive */
@media (max-width: 768px) {
  .grid-cell {
    width: 50px;
    height: 50px;
  }

  .grid {
    grid-template-columns: repeat(5, 50px);
    grid-template-rows: repeat(5, 50px);
  }

  .difficulty-selection button {
    font-size: 16px;
    padding: 12px 24px;
  }

  .controls button {
    font-size: 16px;
    padding: 10px 22px;
  }

  #restart {
    font-size: 18px;
    padding: 12px 24px;
  }
}

@media (max-width: 480px) {
  .difficulty-selection button {
    font-size: 14px;
    padding: 10px 20px;
  }

  .controls button {
    font-size: 14px;
    padding: 8px 18px;
  }

  #restart {
    font-size: 16px;
    padding: 10px 22px;
  }

  .grid {
    grid-template-columns: repeat(4, 50px);
    grid-template-rows: repeat(4, 50px);
  }

  .info p {
    font-size: 16px;
  }
}

@media (min-width: 1200px) {
  .grid {
    grid-template-columns: repeat(6, 80px);
    grid-template-rows: repeat(6, 80px);
  }

  .difficulty-selection button {
    font-size: 22px;
    padding: 18px 36px;
  }

  .controls button {
    font-size: 20px;
    padding: 14px 30px;
  }

  #restart {
    font-size: 24px;
    padding: 15px 32px;
  }
}

/* Fun Visual Effects for Bomb Found */
.bomb-found {
  animation: shake 0.5s ease-in-out;
}

@keyframes shake {
  0% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-10px);
  }
  50% {
    transform: translateX(10px);
  }
  75% {
    transform: translateX(-10px);
  }
  100% {
    transform: translateX(0);
  }
}

/* Freeze Timer Popup Notification */
.freeze-notification {
  position: fixed;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  background-color: #2196F3; /* Blue color */
  color: white;
  font-size: 16px;
  padding: 10px 20px;
  border-radius: 5px;
  z-index: 1000;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
  animation: fadeIn 0.5s, fadeOut 2s 2s forwards; /* Fade-in and fade-out effects */
}


