/* Reset */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --background: #111111;
  --surface: #1a1a1a;
  --primary: #22c55e;
  --primary-hover: #16a34a;
  --text-primary: #f0f0f0;
  --text-secondary: #a0a0a0;
  --border: #2a2a2a;
}

body {
  font-family: 'Inter', sans-serif;
  background-color: var(--background);
  color: var(--text-primary);
  padding: 1rem;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header */
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  padding: 0.5rem 0;
}

.logo {
  font-weight: 700;
  font-size: 1.5rem;
  color: var(--text-primary);
}

.logo span {
  color: var(--primary);
}

.info-btn {
  background-color: var(--surface);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  padding: 0.6rem 0.9rem;
  border-radius: 8px;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.info-btn:hover {
  background-color: var(--border);
  border-color: var(--primary);
}

/* Main layout */
main {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  max-width: 500px; /* Constrain width for better readability on larger screens */
  margin: 0 auto; /* Center main content */
  width: 100%; /* Ensure it takes full width on small screens */
}

/* Sections */
.generator-box,
.status-box {
  background: var(--surface);
  padding: 1.5rem;
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border);
}

.section-title {
  font-size: 1.3rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
  color: var(--text-primary);
  text-align: center;
}

/* Form Groups */
.form-group {
  margin-bottom: 1.2rem;
}

label {
  display: block;
  margin-bottom: 0.5rem;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-secondary);
}

select {
  width: 100%;
  padding: 0.8rem 1rem;
  border-radius: 8px;
  font-size: 1rem;
  background-color: var(--background);
  color: var(--text-primary);
  border: 1px solid var(--border);
  appearance: none; /* Remove default arrow */
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url('data:image/svg+xml;utf8,<svg fill="%23a0a0a0" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg"><path d="M7 10l5 5 5-5z"/><path d="M0 0h24v24H0z" fill="none"/></svg>'); /* Custom arrow */
  background-repeat: no-repeat;
  background-position: right 0.8rem center;
  background-size: 1.5em;
  cursor: pointer;
  transition: border-color 0.2s ease;
}

select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.2);
}

/* Button */
button#generateBtn {
  margin-top: 1.5rem;
  background-color: var(--primary);
  color: var(--background); /* Darker text for contrast on green */
  padding: 0.9rem 1.5rem;
  font-size: 1.1rem;
  font-weight: 600;
  width: 100%;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.1s ease;
}

button#generateBtn:hover {
  background-color: var(--primary-hover);
  transform: translateY(-2px);
}

button#generateBtn:active {
  transform: translateY(0);
}

/* Status box */
.status-box h2 {
  font-size: 1.3rem;
  margin-bottom: 1rem;
}

#statusText {
  font-size: 1rem;
  line-height: 1.5;
  margin-bottom: 1.5rem;
  color: var(--text-secondary);
  text-align: center;
}

#statusText strong {
  color: var(--text-primary);
}

#statusText .success-message { /* Using a class for consistency */
  color: var(--primary);
  font-weight: 500;
  display: block;
  margin-top: 0.5rem;
}

#downloadBtn {
  background-color: var(--primary);
  color: var(--background);
  padding: 0.9rem 1.5rem;
  text-align: center;
  display: block; /* Make it a block-level element */
  border-radius: 8px;
  text-decoration: none;
  font-size: 1.1rem;
  font-weight: 600;
  width: 100%;
  transition: background-color 0.2s ease, transform 0.1s ease;
}

#downloadBtn:hover {
  background-color: var(--primary-hover);
  transform: translateY(-2px);
}

#downloadBtn:active {
  transform: translateY(0);
}

.hidden {
  display: none !important; /* Use !important to ensure it overrides other styles */
}

/* Footer */
footer {
  text-align: center;
  margin-top: 2rem;
  padding-top: 1rem;
  color: var(--text-secondary);
  font-size: 0.85rem;
  border-top: 1px solid var(--border);
}

/* Modal Styles */
.modal {
  position: fixed; /* Stay in place */
  z-index: 100; /* Sit on top */
  left: 0;
  top: 0;
  width: 100%; /* Full width */
  height: 100%; /* Full height */
  overflow: auto; /* Enable scroll if needed */
  background-color: rgba(0,0,0,0.7); /* Black w/ opacity */
  display: flex; /* Use flexbox for centering */
  align-items: center; /* Center vertically */
  justify-content: center; /* Center horizontally */
  backdrop-filter: blur(5px); /* Optional: blur background */
}

.modal-content {
  background-color: var(--surface);
  margin: auto;
  padding: 2rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  width: 90%; /* Responsive width */
  max-width: 500px; /* Max width for larger screens */
  box-shadow: 0 5px 20px rgba(0,0,0,0.5);
  position: relative; /* For positioning the close button */
  animation: fadeInScale 0.3s ease-out; /* Simple animation */
}

.modal-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 1rem;
  text-align: center;
}

.modal-content p {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 0.8rem;
}

.modal-content ul {
  list-style: none; /* Remove default bullet */
  padding-left: 0;
  margin-bottom: 1rem;
}

.modal-content ul li {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
  padding-left: 1.5rem;
  position: relative;
}

.modal-content ul li::before {
  content: '👉'; /* Custom bullet point */
  position: absolute;
  left: 0;
  color: var(--primary);
  font-size: 0.8em;
  top: 0.2em;
}

.close-button {
  color: var(--text-secondary);
  font-size: 1.8rem;
  font-weight: bold;
  position: absolute;
  top: 1rem;
  right: 1.5rem;
  cursor: pointer;
  transition: color 0.2s ease;
}

.close-button:hover,
.close-button:focus {
  color: var(--primary);
  text-decoration: none;
}

/* Animation for modal */
@keyframes fadeInScale {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Responsive Adjustments */
@media (max-width: 600px) {
  body {
    padding: 0.8rem;
  }

  header {
    margin-bottom: 1.5rem;
  }

  .logo {
    font-size: 1.3rem;
  }

  .info-btn {
    padding: 0.5rem 0.8rem;
    font-size: 0.85rem;
  }

  main {
    gap: 1rem;
  }

  .generator-box,
  .status-box {
    padding: 1.2rem;
    border-radius: 10px;
  }

  .section-title {
    font-size: 1.2rem;
    margin-bottom: 1.2rem;
  }

  label {
    font-size: 0.9rem;
  }

  select,
  button#generateBtn,
  #downloadBtn {
    padding: 0.7rem 1rem;
    font-size: 1rem;
  }

  #statusText {
    font-size: 0.9rem;
    margin-bottom: 1rem;
  }

  footer {
    margin-top: 1.5rem;
  }

  .modal-content {
    padding: 1.5rem;
    width: 95%; /* Even wider on very small screens */
  }

  .modal-title {
    font-size: 1.3rem;
  }

  .modal-content p,
  .modal-content ul li {
    font-size: 0.85rem;
  }

  .close-button {
    font-size: 1.5rem;
    top: 0.8rem;
    right: 1rem;
  }
}