body {
  margin: 0;
  padding: 0;
  font-family: 'Pixelify Sans', cursive;
  transition: background-color 0.5s ease, background-image 0.5s ease, color 0.5s ease;
  opacity: 1;
}

html {
 scrollbar-gutter: stable overlay;
height: 100%;
}

/* Light Mode */
body.light {
  background-image: url('./images/day.png');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: fixed;
  color: #2a1244; /* Dark text for light background */
}

/* Dark Mode */
body.dark {
  background-image: url('./images/night.png');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: fixed;
  color: #f2eaff; /* Light text for dark background */
}

.container {
  text-align: center;
  padding: 2rem;
}

.title {
  font-size: 1.8rem;
  margin-bottom: 1rem;
}

.input-section input {
  font-family: inherit;
  font-size: 1rem;
  padding: 0.5rem;
  margin: 0.5rem;
  border-radius: 10px;
  border: none;
  width: 150px;
}

/* Ensure inputs have readable text in both themes */
body.light input {
  background-color: #fff;
  color: #000;
}

body.dark input {
  background-color: #333;
  color: #fff;
}

button {
  background-color: #ffb6f0;
  border: none;
  border-radius: 15px;
  padding: 0.7rem 1.2rem;
  font-family: inherit;
  font-size: 1rem;
  cursor: pointer;
  box-shadow: 0px 4px #e49cd4;
  margin: 1rem;
  color: #222;
}

/* Prompt Box styles for visibility */
.prompt-box {
  position: relative; 
  background: rgba(255, 255, 255, 0.6);
  border-radius: 20px;
  margin-top: 1rem;
  padding: 1rem;
  max-width: 400px;
  margin-left: auto;
  margin-right: auto;
}

/* Adapt prompt box background for dark mode */
body.dark .prompt-box {
  background: rgba(0, 0, 0, 0.6);
}

.prompt-text {
  font-size: 1.1rem;
  margin-bottom: 1rem;
  padding-top: 2.5rem;
  padding-left: 1.0rem;
  padding-right: 1.0rem;
}

.top-bar {
  display: flex;
  justify-content: space-between; /* hamburger left, mode toggle right */
  align-items: center;
  padding: 1rem;
  width: 100%;
  box-sizing: border-box;
}

/* Toggle Button */
#mode-toggle {
  width: 40px;
  height: 40px;
  font-size: 28px;
  border: none;
  background: none;
  color: inherit;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  box-shadow: none;
}

.nsfw-toggle {
  display: inline-block;
  margin-top: 1rem;
  font-size: 0.9rem;
}

/* Footer text */
footer {
  margin-top: 2rem;
  font-size: 0.9rem;
  opacity: 0.8;
}

body.fade {
  opacity: 0;
  animation: fadeIn 0.4s ease forwards;
}

@keyframes fadeIn {
  to {
    opacity: 1;
  }
}

/* Global button styles */
button {
  background-color: #f5f2ef;
  border: 2px solid #d5ccc4;
  border-radius: 0.6rem;
  padding: 0.6rem 1.2rem;
  font-family: 'Pixelify Sans', cursive;
  color: #333;
  cursor: pointer;
  transition: 
    transform 0.15s ease,
    box-shadow 0.2s ease,
    background-color 0.3s ease,
    color 0.2s ease;
}

/* Hover effect: gentle lift + glow */
button:hover {
  background: #e49cd4;
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0px 4px #e49cd4;
}

/* Click effect: soft press */
button:active {
  transform: scale(0.97);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

body {
  cursor: url("cursors/Normal\ Select.cur"), auto;
}

button:hover,
button:focus,
button:active,
#mode-toggle:hover,
#mode-toggle:focus,
#mode-toggle:active,
#menu-toggle:hover,
#menu-toggle:focus,
#menu-toggle:active,
.back-btn:hover,
.back-btn:focus,
.back-btn:active {
  cursor: url("cursors/Precision\ Select.cur"), pointer;
}

input,
textarea {
  cursor: url("cursors/Handwriting.cur"), text;
}

#fav-btn {
  position: absolute;
  top: 0.5rem;
  left: 0.7rem;
  background: none;
  box-shadow: none;
  border: none;
  font-size: 1.5rem;
  color: #aaa;
  cursor: pointer;
  transition: color 0.2s ease, transform 0.15s ease;
  z-index: 2;
  outline: none;
  text-decoration: none;
  line-height: 1;
  padding: 0;
}

#fav-btn:hover {
  color: #c94e7b;
  transform: scale(1.1);
}

.pink-heart {
  width: 20px;
  height: 20px;
  vertical-align: middle;
  /* This filter turns a white PNG to #c94e7b */
  filter: invert(36%) sepia(77%) saturate(749%) hue-rotate(-20deg) brightness(1.05) contrast(1.02);
  transition: filter 0.2s;
}
#fav-btn.favorited .pink-heart {
  /* Slightly darker for favorited state (optional) */
  filter: invert(36%) sepia(77%) saturate(749%) hue-rotate(-20deg) brightness(0.85) contrast(1.1);
}
#fav-btn:hover .pink-heart {
  filter: invert(36%) sepia(77%) saturate(749%) hue-rotate(-20deg) brightness(1.2) contrast(1.1);
}

.hamburger-menu button#menu-toggle {
  background: none;
  border: none;
  box-shadow: none;
  color: inherit;
  font-size: 2rem;
  padding: 0.2em 0.5em;
  cursor: pointer;
  outline: none;
  transition: color 0.2s;
}

.hamburger-menu button#menu-toggle:hover {
  color: #e49cd4;
  cursor: url("cursors/Precision\ Select.cur"), pointer;
}

.hamburger-menu {
  display: flex;
  align-items: center;
  position: relative;
}

#menu-links {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  width: max-content;
  min-width: 160px;
  flex-direction: column;
  background: rgba(255, 255, 255, 0.6);
  padding: 0.6rem;
  border-radius: 0.5rem;
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
  margin-top: 0.5rem;
  gap: 0.5rem;
  align-items: flex-start;
  text-align: left;
  z-index: 1001;
}

body.dark #menu-links {
  background: rgba(0, 0, 0, 0.6);
}

#menu-links button,
#menu-links a button {
  width: 130px;
  min-width: 0;
  text-align: left;
  display:block;
  box-sizing: border-box;
  font-family: 'Pixelify Sans', cursive;
  font-size: 0.95rem;
  background: rgba(255, 255, 255, 0.6);
  border: 2px solid #ccc;
  border-radius: 0.4rem;
  padding: 0.4rem 0.8rem;
  cursor: pointer;
  white-space: nowrap;
}

#favorites-section {
  margin-top: 1rem;
  padding: 1rem;
  background: rgba(255,255,255,0.85);
  border-radius: 1rem;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  font-family: 'Pixelify Sans', cursive;
}
#menu-links {
  display: none;
  flex-direction: column;
  background: rgba(255, 255, 255, 0.90);
  padding: 0.6rem;
  border-radius: 0.5rem;
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
  margin-top: 0.5rem;
  gap: 0.5rem;

  /* Fix alignment */
  align-items: flex-start;
  text-align: left;
}

body.dark #menu-links {
  background: rgba(30, 30, 30, 0.95);
  box-shadow: 0 4px 10px rgba(255,255,255,0.1);
}

/* Fix buttons inside the menu */
#menu-links button,
#menu-links a button { 
  text-align: left;
  font-family: 'Pixelify Sans', cursive;
  font-size: 0.95rem;
  background: none;
  border: 2px solid #ccc;
  border-radius: 0.4rem;
  padding: 0.4rem 0.8rem;
  cursor: url("cursors/Precision\ Select.cur"), pointer;
  color: inherit;
}

body.dark #menu-links button,
body.dark #menu-links a button {
  border-color: #777;
}

.app-section {
  transition: opacity 0.3s;
}

/* Small remove button for favorites */
.remove-fav {
  display: block;
  margin: 0.5rem 0 0.2rem 0;
  background: none;
  border: none;
  color: #c94e7b;
  font-size: 0.95rem;
  border-radius: 0.3em;
  width: auto;
  height: auto;
  line-height: 1.2;
  text-align: left;
  cursor: pointer;
  box-shadow: none;
  transition: color 0.2s, transform 0.15s;
  padding: 0 0.2em;
  z-index: 2;
}
.remove-fav:hover {
  color: #fff;
  background: #c94e7b;
  transform: scale(1.08);
}

/* Divider between favorites */
.fav-divider {
  border: none;
  border-top: 1px dashed #e49cd4;
  margin: 0.2rem 0 0.2rem 0;
  opacity: 0.7;
}

.back-btn {
  background: #f5f2ef;
  border: 2px solid #d5ccc4;
  border-radius: 0.6rem;
  padding: 0.5rem 1.2rem;
  font-family: 'Pixelify Sans', cursive;
  font-size: 1rem;
  color: #333;
  cursor: pointer;
  margin-right: 10px;
  transition: background 0.2s, color 0.2s, transform 0.15s;
}
.back-btn:hover {
  background: #e49cd4;
  color: #fff;
  transform: translateY(-2px);
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}