/* 
File: styles.css
Description: Stylesheet for Minesweeper game including grid, popup, audio, and draggable images.
Inputs: N/A (applied globally to HTML elements)
Outputs: Visual styles for game layout, grid buttons, popup overlays, audio settings, status indicators
External Sources: 
    - Google Fonts imported: https://fonts.googleapis.com/css2?family=Kode+Mono:wght@400..700&family=Libertinus+Keyboard&family=Nunito+Sans:ital,opsz,wght@0,6..12,200..1000;1,6..12,200..1000&display=swap
Author: Reem Fatima, Pashia Vang, Alejandro Sandoval, Liam Aga, Jorge Trujillo, Aiden Barnard
Creation Date: 2025-09-08
*/

/* Import Google Fonts for custom typography */
@import url('https://fonts.googleapis.com/css2?family=Kode+Mono:wght@400..700&family=Libertinus+Keyboard&family=Nunito+Sans:ital,opsz,wght@0,6..12,200..1000;1,6..12,200..1000&display=swap');


/* ---------------- Global Styles ---------------- */
* {
    font-family: "Kode Mono", monospace;
    font-size: 20px;
}

/* ---------------- Popup Overlay ---------------- */
/* Dark background behind popup, hidden by default */
#popupOverlay {
    background-color: white;
    position: fixed; /* stays fixed relative to viewpoint */
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5); /* semi-transparent dark overlay */
    display: none; /* hidden by default */
    z-index: 999;
  }

/* Popup text elements inherit background color */
#popupContainer h2, 
#popupContainer p {
    background-color: white;
}
  
  /* Popup box */
  #popupContainer {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%); /* Center horizontally and vertically */
    background: white;
    padding: 20px;
    border-radius: 10px; /* Rounded corners */
    box-shadow: 0 0 15px rgba(0,0,0,0.3);
    display: none; /* hidden by default */
    z-index: 1000;
  }
  
  /* Popup button styling */
  #closePopup {
    margin-top: 10px;
    padding: 8px 16px;
    background: #007BFF; /* blue button */
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
  }
  
  /* Hover effect for button */
  #closePopup:hover {
    background: #0056b3; /* darker blue on hover */
  }
  
/* ---------------- Body and Layout ---------------- */
body {
  font-family: Arial, sans-serif;
  margin: 0;
  height: 100vh;
  width: 100vw;
  display: flex;
  justify-content: center;   /* center horizontally */
  align-items: center;       /* center vertically */
  flex-direction: column;    /* stack elements */
  overflow: auto;
  text-align: center;
  background: #f8f8f8; 
}

/* Wrapper for main content */
.content {
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* ---------------- Minesweeper Grid ---------------- */
/* Grid layout for game tiles */
.minesweeper-grid {
    display: grid;
    grid-template-columns: repeat(8, 58px); /* 8 columns, fixed width */
    grid-template-rows: repeat(8, 58px); /* 8 rows, fixed height */
    justify-content: center; /* center horizontally */
}

/* Individual grid buttons */
.grid-btn {
    width: 56px;
    height: 56px;
    font-size: 25px;
    font-weight: bold;
    border: 2px solid black;
    background-color: white;
    cursor: pointer;
}

/* Disabled grid buttons (after being revealed) */
.grid-btn:disabled {
    cursor: default;
}

/* ---------------- Flag Counter ---------------- */
.flag-counter-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px; /* spacing between flag icon and input */
}

.flag-counter-container input {
    width: 50px;
    padding: 5px;
    font-size: 18px;
    text-align: center;
    border: none;
    font-weight: bold;
}

.flag-counter-container p {
    font-size: 30px;
    color: red; /* flag symbol in red */
}

/* ---------------- Audio Settings ---------------- */
.audio-settings {
    margin-top: 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.audio-settings h3 {
    margin: 0;
    font-size: 24px;
}

.audio-settings select {
    padding: 4px 8px;
    border-radius: 6px;
    border: 1px solid #ccc;
}

/* ---------------- Background Images ---------------- */
.background-images {
  position: fixed; /* cover whole screen */
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none; /* let clicks pass through by default */
}

/* Individual draggable images */
.draggable {
  position: absolute;
  cursor: grab;
  pointer-events: auto; /* allow dragging on images */
}

/* ---------------- Status Indicator ---------------- */
.status-indicator {
  margin-top: 20px;
  font-size: 22px;
  font-weight: bold;
  text-align: center;
}

/* Color changes based on game status */
.status-indicator.playing {
  color: black;
}

.status-indicator.won {
  color: green;
}

.status-indicator.lost {
  color: red;
}
