head {
    background-color: #f5f7fa;
}

body {
    font-family: 'Roboto', sans-serif;
    background-color: #f5f7fa;
    color: #333;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    min-height: 100vh;
    margin: 0;
    padding: 20px;
}

.container {
    background: #ffffff;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    padding: 30px;
    max-width: 400px;
    width: 100%;
    text-align: center;
    margin-bottom: 20px;
}

h1 {
    margin-bottom: 25px;
    font-size: 24px;
    color: #007bff;
}

.grid-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-bottom: 20px;
}

.game-option {
    border: 1px solid #ddd;
    border-radius: 10px;
    padding: 10px;
    text-align: center;
    cursor: pointer;
    transition: transform 0.3s, border-color 0.3s;
}

.game-option img {
    width: 100%;
    border-radius: 8px;
    margin-bottom: 10px;
}

.game-option p {
    font-weight: 500;
    color: #555;
}

.game-option:hover, .game-option.selected {
    transform: scale(1.05);
    border-color: #007bff;
}

.form-group {
    margin-bottom: 20px;
    text-align: left;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #555;
}

.key-slider {
    display: flex;
    align-items: center;
    gap: 10px;
}

.key-slider input[type="range"] {
    -webkit-appearance: none;
    width: 100%;
    height: 8px;
    border-radius: 5px;
    background: #ddd;
    outline: none;
    transition: background 0.3s;
}

.key-slider input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #007bff;
    cursor: pointer;
    transition: background 0.3s;
}

.key-slider input[type="range"]:hover::-webkit-slider-thumb {
    background: #0056b3;
}

#keyValue {
    font-size: 18px;
    font-weight: bold;
    color: #007bff;
}

button {
    background-color: #007bff;
    color: white;
    border: none;
    padding: 12px 20px;
    font-size: 16px;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.3s;
    margin-top: 20px;
}

button:hover {
    background-color: #0056b3;
}

.hidden {
    display: none;
}

.progress-bar {
    background-color: #f5f7fa;
    border-radius: 8px;
    overflow: hidden;
    margin-top: 25px;
    height: 35px;
    position: relative;
}

.progress-bar div {
    height: 100%;
    background-color: #007bff;
    width: 0;
    transition: width 0.5s;
}

#progressText {
    margin-top: 15px;
    font-weight: 600;
}

.key-item {
    display: flex;
    align-items: center;
    margin-top: 15px;
}

.key-item input {
    flex: 1;
    padding: 12px;
    font-size: 16px;
    border: 1px solid #ccc;
    border-radius: 8px;
    margin-right: 12px;
}

.copyKeyBtn {
    background-color: #28a745;
    border: none;
    padding: 12px 20px;
    color: white;
    font-size: 16px;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.copyKeyBtn:hover {
    background-color: #218838;
}

footer {
    margin-top: 25px;
    background-color: #f5f7fa;
    font-size: 14px;
    color: #777;
}

#copyStatus {
    margin-top: 15px;
    color: green;
}

/* ... Your existing CSS ... */

.dark-mode { /* Add this class for dark mode */
  head { 
    background-color: #000000;
  }
    
  body { 
    font-family: 'Roboto', sans-serif; 
    background-color: #000000; /* AMOLED black */
    color: #f5f7fa; /* Light text for contrast */
    display: flex; 
    flex-direction: column;
    justify-content: flex-start; 
    align-items: center; 
    min-height: 100vh; 
    margin: 0; 
    padding: 20px;
  } 

  .container { 
    background: #111111; /* Darker gray background for container */
    border-radius: 10px; 
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1); 
    padding: 30px; 
    max-width: 400px; 
    width: 100%; 
    text-align: center; 
    margin-bottom: 20px;
  } 

  h1 { 
    margin-bottom: 25px; 
    font-size: 24px; 
    color: #007bff; /* Keep the blue color for h1 */
  } 

  .grid-container { 
    display: grid; 
    grid-template-columns: repeat(3, 1fr); 
    gap: 15px; 
    margin-bottom: 20px; 
  } 

  .game-option { 
    border: 1px solid #ddd; /* Light gray border for contrast */
    border-radius: 10px; 
    padding: 10px; 
    text-align: center; 
    cursor: pointer; 
    transition: transform 0.3s, border-color 0.3s; 
  } 

  .game-option img { 
    width: 100%; 
    border-radius: 8px; 
    margin-bottom: 10px; 
  } 

  .game-option p { 
    font-weight: 500; 
    color: #f5f7fa; /* Light text for contrast */
  } 

  .game-option:hover, .game-option.selected { 
    transform: scale(1.05); 
    border-color: #007bff; /* Keep the blue color for hover effect */
  } 

  .form-group { 
    margin-bottom: 20px; 
    text-align: left; 
  } 

  label { 
    display: block; 
    margin-bottom: 8px; 
    font-weight: 500; 
    color: #f5f7fa; /* Light text for contrast */
  } 

  .key-slider { 
    display: flex; 
    align-items: center; 
    gap: 10px; 
  } 

  .key-slider input[type="range"] { 
    -webkit-appearance: none; 
    width: 100%; 
    height: 8px; 
    border-radius: 5px; 
    background: #555; /* Dark gray for range slider */
    outline: none; 
    transition: background 0.3s; 
  } 

  .key-slider input[type="range"]::-webkit-slider-thumb { 
    -webkit-appearance: none; 
    appearance: none; 
    width: 20px; 
    height: 20px; 
    border-radius: 50%; 
    background: #007bff; /* Keep the blue color for the slider thumb */
    cursor: pointer; 
    transition: background 0.3s; 
  } 

  .key-slider input[type="range"]:hover::-webkit-slider-thumb { 
    background: #0056b3; 
  } 

  #keyValue { 
    font-size: 18px; 
    font-weight: bold; 
    color: #007bff; /* Keep the blue color for key value */
  } 

  button { 
    background-color: #007bff; /* Keep the blue color for buttons */
    color: white; 
    border: none; 
    padding: 12px 20px; 
    font-size: 16px; 
    border-radius: 8px; 
    cursor: pointer; 
    transition: background-color 0.3s; 
    margin-top: 20px; 
  } 

  button:hover { 
    background-color: #0056b3; 
  } 

  .hidden { 
    display: none; 
  } 

  .progress-bar { 
    background-color: #111111; /* Darker gray for progress bar background */
    border-radius: 8px; 
    overflow: hidden; 
    margin-top: 25px; 
    height: 35px; 
    position: relative; 
  } 

  .progress-bar div { 
    height: 100%; 
    background-color: #007bff; /* Keep the blue color for progress bar */
    width: 0; 
    transition: width 0.5s; 
  } 

  #progressText { 
    margin-top: 15px; 
    font-weight: 600; 
    color: #f5f7fa; /* Light text for contrast */
  } 

  .key-item { 
    display: flex; 
    align-items: center; 
    margin-top: 15px; 
  } 

  .key-item input { 
    flex: 1; 
    padding: 12px; 
    font-size: 16px; 
    background-color: #000000;
    border: 1px solid #555; /* Darker gray border for input field */
    border-radius: 8px; 
    margin-right: 12px; 
    color: #f5f7fa; /* Light text for contrast */
  } 

  .copyKeyBtn { 
    background-color: #28a745; 
    border: none; 
    padding: 12px 20px; 
    color: white; 
    font-size: 16px; 
    border-radius: 8px; 
    cursor: pointer; 
    transition: background-color 0.3s; 
  } 

  .copyKeyBtn:hover { 
    background-color: #218838; 
  } 

  footer { 
    margin-top: 25px; 
    background-color: #000000;
    font-size: 14px; 
    color: #f5f7fa; /* Light text for contrast */
  } 

  #copyStatus { 
    margin-top: 15px; 
    color: green; 
  }/* ... Your dark mode styles from above ... */
}

/* ... your existing styles ... */

/* Dark Mode Styles */
.dark-mode {
  --background-color: #000000; 
  --text-color: #f5f7fa; 
  --border-color: #555; /* Example: for borders */
  --accent-color: #007bff; /* Example: for accents */

  background-color: var(--background-color); /* Apply to entire page */
  color: var(--text-color);

  /* Apply to all elements that need contrast */
  h1, h2, h3, h4, h5, h6, 
  p, a, label, .game-option p,
  .key-item input, .footer {
    color: var(--text-color) !important;
  }

  /* Apply to all borders */
  * {
    border-color: var(--border-color) !important;
  }

  /* Apply to elements with specific color */
  .key-slider input[type="range"] {
    background: var(--border-color) !important;
  }

  /* ... other dark mode styles ... */
}

.light-mode {
  --background-color: #f5f7fa;
  --text-color: #333;
  --border-color: #ddd; /* Example: for borders */
  --accent-color: #007bff; /* Example: for accents */

  background-color: var(--background-color);
  color: var(--text-color);

  /* Apply to all elements that need contrast */
  h1, h2, h3, h4, h5, h6, 
  p, a, label, .game-option p,
  .key-item input, .footer {
    color: var(--text-color) !important;
  }

  /* Apply to all borders */
  * {
    border-color: var(--border-color) !important;
  }

  /* Apply to elements with specific color */
  .key-slider input[type="range"] {
    background: var(--border-color) !important;
  }

  /* ... other light mode styles ... */
}

.switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 34px;
}

/* Hide the default HTML checkbox */
.switch input { 
    opacity: 0;
    width: 0;
    height: 0;
}

/* Style the slider */
.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc; /* Example: gray background */
    border-radius: 34px; /* Rounded corners for slider */
    transition: .4s;
}

/* Style the slider when the checkbox is checked */
.switch input:checked + .slider {
    background-color: #2196F3; /* Example: blue background when checked */
}

/* Style the slider handle */
.slider:before {
    position: absolute;
    content: "";
    height: 26px;
    width: 26px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    border-radius: 50%; /* Round handle */
    transition: .4s;
}

/* Style the slider handle when the checkbox is checked */
.switch input:checked + .slider:before {
    transform: translateX(26px);
}

.popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.popup-content {
    background-color: white;
    padding: 20px;
    border-radius: 5px;
    text-align: center;
}

#closePopup {
    margin-top: 10px;
    padding: 5px 10px;
    cursor: pointer;
}
