body {
  transition: background-color 0.3s, color 0.3s;
}

.app-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 8rem;
  font-weight: 800;
  text-decoration: underline;
}

.app-subtitle {
  font-size: 1.4rem;
  font-weight: 400;
  max-width: 600px;
  color: rgb(37, 37, 37);
  font-family: 'Montserrat', sans-serif;
  text-transform: uppercase;
}

body.bg-dark .app-subtitle {
  color: #f3f3f3;
}

@media (max-width: 576px) {
  .app-title {
    font-size: 17vw; /* Smaller on mobile */
  }

  .app-subtitle {
    font-size: .7rem; /* Smaller on mobile */
  }
}

@media (max-width: 400px) {
  .app-title {
    font-size: 16vw;
  }

  .app-subtitle {
    font-size: 3vw;
  }
}

/* theme switcher */
.theme-toggle {
  height: 56px; /* Match navbar height */
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0 !important;
}
.theme-toggle .form-check-input {
  margin-top: 0 !important;
  margin-bottom: 0 !important;
  align-self: center;
}
.theme-toggle .bi {
  margin-left: 0.6rem;
  font-size: 1.5rem;
  vertical-align: middle;
  line-height: 1;
  display: flex;
  align-items: center;
}

/* Override Bootstrap background + text colors if needed */
body.bg-dark {
  background-color: #121212 !important;
  color: #f8f9fa !important;
}

body.bg-light {
  background-color: #ffffff !important;
  color: #212529 !important;
}

h4, h5 {
  font-weight: 600;
  font-family: 'Montserrat', sans-serif;
}


/* collapsing add your game section */

#addGameForm {
  transition: max-height 0.3s ease, opacity 0.3s ease;
  overflow: hidden;
}

.collapsed #addGameForm {
  max-height: 0;
  opacity: 0;
  pointer-events: none;
  margin: 0;
  padding: 0;
}

.expanded #addGameForm {
  max-height: 1000px; /* large enough to fit form */
  opacity: 1;
  pointer-events: auto;
  margin-top: 1rem;
  margin-bottom: 1rem;
}

.add-game-toggle {
  display: flex;
  flex-direction: row;      /* Ensure icon and text are side by side */
  align-items: center;
  gap: 0.4em;
  font-size: 1rem;
  padding: 0.4em 1em;
  border-radius: 8px;
  border: none;
  cursor: pointer;
}

.toggle-icon-wrapper {
  display: flex;
  align-items: center;
}

.toggle-icon {
  font-size: 1em;
  color: #fff;
  transition: transform 0.3s cubic-bezier(.4,0,.2,1);
  vertical-align: middle;
}

.add-game-toggle.open .toggle-icon {
  transform: rotate(135deg);
}

@media (max-width: 576px) {
  .add-game-toggle {
    display: flex;
    flex-direction: row;
    align-items: center;
    font-size: 1rem;
    padding: 0.35rem 0.7rem;
    gap: 0.4em;
    width: fit-content;
    margin-left: auto;
    margin-right: 0;
    text-align: right;
  }
}

.add-game-toggle:hover {
  background-color: #0056b3; /* darker shade of primary */
}

body.bg-dark .add-game-toggle {
  background-color: #0d6efd;
  color: #fff;
}

body.bg-dark .add-game-toggle:hover {
  background-color: #084298;
}

/* Dark mode for forms, lists, and boxes */
body.bg-dark .form-control,
body.bg-dark .form-select,
body.bg-dark .list-group,
body.bg-dark .bg-white,
body.bg-dark .border,
body.bg-dark .modal-content {
  background-color: #23272b !important;
  color: #f8f9fa !important;
  border-color: #343a40 !important;
}

body.bg-dark .form-control::placeholder {
  color: #b0b3b8 !important;
  opacity: 1;
}

body.bg-dark .list-group-item {
  background-color: #23272b !important;
  color: #f8f9fa !important;
  border-color: #343a40 !important;
}

body.bg-dark .list-group-item-success {
  background-color: #29532a !important;
  color: #d4edda !important;
}

body.bg-dark .btn,
body.bg-dark .btn:active,
body.bg-dark .btn:focus {
  color: #f8f9fa !important;
}

body.bg-dark .border {
  border-color: #343a40 !important;
}

/* Picked Game result box */
body.bg-dark #pickedGame {
  background-color: #23272b !important;
  color: #f8f9fa !important;
  border-color: #343a40 !important;
}

/* Custom confirmation modal */
/* Modal overlay for both light and dark mode */
.custom-modal-bg {
  background: rgba(0,0,0,0.7) !important;
  color: #fff !important;
}

/* Modal content for both modes */
.custom-modal-content {
  background: #23272b !important;
  color: #fff !important;
  border-radius: 10px;
  border: 1px solid #343a40;
}

.btn-xs {
  padding: 0.15rem 0.6rem;
  font-size: 0.95rem;
  min-width: 0;
  min-height: 32px;
}
.d-flex.gap-2.mb-2 {
  justify-content: flex-start;
}

.game-cover-img {
  width: 100px;
  object-fit: cover;
  border-radius: 3px;
  margin-right: 8px;
  vertical-align: middle;
}


.section-container {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
  padding: 2rem 1.5rem;
  margin-bottom: 2rem;
  border: 1px solid #ececec;
}
body.bg-dark .section-container {
  background: #23272b;
  border-color: #333;
}


/* custom modal content */
.custom-modal-content .form-check {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  margin-bottom: 1em;
  text-align: left;
}

.custom-modal-content .form-check-input {
  margin: 0 0.5em 0 0;
  position: static;
}

/* achievement popup */

.achievement-popup {
  position: fixed;
  left: 50%;
  bottom: 2rem;
  transform: translateX(-50%) translateY(100px);
  background: linear-gradient(90deg, #5f4b8b 0%, #2e3192 100%);
  color: #fff;
  border-radius: 1.5rem;
  box-shadow: 0 4px 24px rgba(0,0,0,0.25);
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 2rem;
  font-family: 'Montserrat', sans-serif;
  font-size: 1.1rem;
  opacity: 0;
  pointer-events: none;
  z-index: 9999;
  transition: opacity 0.4s, transform 0.4s;
}
.achievement-popup.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}
.achievement-icon {
  width: 40px;
  height: 40px;
}
.achievement-text {
  font-size: 1rem;
  margin-top: 0.2rem;
}

@media (max-width: 576px) {
  .achievement-popup {
    padding: 0.7rem 1rem;
    font-size: 0.95rem;
    border-radius: 1rem;
    gap: 0.6rem;
    min-width: 300px;
    max-width: 95vw;
    width: auto;
    left: 50%;
    bottom: 1rem;
  }
  .achievement-icon {
    width: 28px;
    height: 28px;
  }
  .achievement-text {
    font-size: 0.95rem;
  }

  #gameList .list-group-item .d-flex,
  #finishedGameList .list-group-item .d-flex {
    flex-direction: row !important;
    align-items: flex-start !important;
  }
  #gameList .dropdown,
  #finishedGameList .dropdown {
    margin-left: auto !important;
    margin-right: 0 !important;
    order: 99;
  }
}
/* greeting banner */
.greeting-banner {
  background: linear-gradient(90deg, #5f4b8b 0%, #2e3192 100%);
  color: #f3f3ff;
  font-family: 'Montserrat', sans-serif;
  font-size: 1.1rem;
  font-weight: 600;
  border-radius: 10px;
  margin: 2rem auto 1.5rem 0;
  padding: 0.7rem 1.5rem;
  text-align: left;
  max-width: 420px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.10);
  opacity: 1;
  max-height: 80px;
  overflow: hidden;
  transition: opacity 0.5s, max-height 0.5s, margin 0.5s;
  white-space: normal;
  z-index: 10;
  position: relative;
}

.greeting-banner.fade-out {
  opacity: 0;
  max-height: 0;
  margin: 0;
  padding-top: 0;
  padding-bottom: 0;
}

@media (max-width: 768px) {
  .greeting-banner {
    margin: 1rem 0 1rem 0;
    max-width: 98vw;
    width: 100%;
    font-size: 1.05rem;
    text-align: center;
  }
}

.btn-gradient {
  background: linear-gradient(90deg, #5f4b8b 0%, #2e3192 100%);
  color: #f3f3ff !important;
  border: none;
  font-weight: 600;
  box-shadow: 0 2px 12px rgba(0,0,0,0.10);
  background-size: 200% 100%;
  background-position: left center;
  transition: background-position 0.4s cubic-bezier(.4,0,.2,1), color 0.3s, filter 0.3s;
}

.btn-gradient:hover, .btn-gradient:focus {
  background-position: right center;
  color: #fff !important;
  filter: brightness(1.08);
}


/* Dark mode for Bootstrap dropdown */
body.bg-dark .dropdown-menu {
  background-color: #23272b;
  color: #fff;
  border-color: #444;
}
body.bg-dark .dropdown-menu .dropdown-item {
  color: #fff;
}
body.bg-dark .dropdown-menu .dropdown-item:hover,
body.bg-dark .dropdown-menu .dropdown-item:focus {
  background-color: #343a40;
  color: #b3e6ff;
}
body.bg-dark .dropdown-menu .dropdown-item.text-danger {
  color: #ff6b6b;
}


/* Style for random gaming message to match achievements section */
#randomMessage {
  background: linear-gradient(90deg, #5f4b8b 0%, #2e3192 100%);
  color: #fff;
  border: 2px solid #4b50b8;
  border-radius: 10px;
  font-weight: 600;
  font-size: 1.05rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.10);
  padding: 0.7rem 1.2rem;
  margin-top: 0.5rem;
  margin-bottom: 0.5rem;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.5s ease, transform 0.5s cubic-bezier(.4,0,.2,1);
  pointer-events: none;
}
#randomMessage.show {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}


/* custom pop out modal */
.custom-modal-bg {
  position: fixed;
  top: 0; left: 0; width: 100vw; height: 100vh;
  background: rgba(24, 31, 27, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}
.custom-modal-content {
  background: linear-gradient(90deg, #5f4b8b 0%, #2e3192 100%);
  color: #fff;
  border-radius: 14px;
  padding: 2rem 1.2rem 1.2rem 1.2rem;
  min-width: 90vw;
  max-width: 350px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.18);
}
@media (min-width: 500px) {
  .custom-modal-content { min-width: 350px; }
}


/* Goals section dark mode styles */
body.bg-dark #goalsSection {
  background: #23272b;
  color: #f3f3f3;
}

body.bg-dark #goalsSection .card {
  background: #232533;
  color: #f3f3f3;
  border-color: #333;
}

body.bg-dark #goalsSection .progress {
  background: #181a23;
}

body.bg-dark #goalsSection .progress-bar {
  background: #2ecc71;
  color: #fff;
}