:root {
  --bg: #0b0f1a;
  --text: #e0e6f0;
  --accent: #61dafb;
  --card-bg: #1c2537;
  --header-bg: linear-gradient(to right, #111c2b, #1a2e40);
  --modal-bg: #213045;
  --modal-text: #fff;
  /* Colors for achievement date and popup button text in dark mode */
  --date-color: yellow;
  --popup-button-text: white;
}
.light-theme {
  --bg: #f4f7fa;
  --text: #1a1a1a;
  --accent: #007acc;
  --card-bg: #ffffff;
  --header-bg: linear-gradient(to right, #e3eaf3, #cfd9e3);
  --modal-bg: #ffffff;
  --modal-text: #1a1a1a;
  /* Colors for light mode */
  --date-color: orange;
  --popup-button-text: var(--text);
}

/* Unified button styling for all buttons and clickable links */
button,
a.btn {
  padding: 0.5rem 1rem;
  background: var(--card-bg);
  color: var(--text);
  border: 1px solid var(--accent);
  border-radius: 6px;
  cursor: pointer;
  text-decoration: none;
  font-size: 1rem;
  min-width: 44px;
  min-height: 44px;
  display: inline-block;
  vertical-align: middle;
}
input[type="submit"] {
  padding: 0.5rem 1rem;
  background: var(--card-bg);
  color: var(--text);
  border: 1px solid var(--accent);
  border-radius: 6px;
  cursor: pointer;
  font-size: 1rem;
  min-width: 44px;
  min-height: 44px;
}
body {
  margin: 0;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: var(--bg);
  color: var(--text);
}
header {
  background: var(--header-bg);
  padding: 2rem;
  text-align: center;
  color: var(--accent);
  border-bottom: 2px solid #1e2b40;
}
header img {
  width: auto;
  height: 80px;
  margin-bottom: 1rem;
  object-fit: cover;
}
.sticky-banner {
  position: sticky;
  top: 0;
  width: 100%;
  background-color: #0d0d0d;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 2rem 0;
  z-index: 999;
  box-shadow: 0 2px 4px rgba(0,0,0,0.6);
}

.sticky-banner a {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: #fff;
  text-decoration: none;
  font-family: 'Oswald', sans-serif;
  font-size: 1rem;
}

.sticky-banner img {
  height: 50px;
  width: auto;
}
.container {
  padding: 2rem;
  margin: 0 10%;
}


























.theme-toggle-icon {
  all: unset;
  cursor: pointer;
  position: relative;
  width: 2.5rem;
  height: 5.5rem;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  -webkit-tap-highlight-color: transparent;
  outline: none;
}

.theme-toggle-icon svg {
  position: absolute;
  top: 0;
  left: 0;
  width: 5.5rem;
  height: 5.5rem;
  transition: opacity 0.3s ease, transform 0.3s ease;
  pointer-events: none;
}

/* Moon styles */
.icon-moon {
  filter: drop-shadow(0 0 4px #dcdcdc);
  transform: rotate(-8deg) scale(0.5);
  opacity: 0;
}

/* Sun styles */
.icon-sun {
  filter: drop-shadow(0 0 6px #ffdd55);
  transform: scale(0.5);
  opacity: 0;
}

/* Default active icon */
body:not(.light-theme) .icon-moon {
  opacity: 1;
  transform: rotate(-8deg) scale(1);
}
body.light-theme .icon-sun {
  opacity: 1;
  transform: scale(1);
}

/* Hover to reveal opposite icon */
body:not(.light-theme) .theme-toggle-icon:hover .icon-moon {
  opacity: 0;
  transform: rotate(-8deg) scale(0.5);
}
body:not(.light-theme) .theme-toggle-icon:hover .icon-sun {
  opacity: 1;
  transform: scale(1) rotate(0deg);
}

body.light-theme .theme-toggle-icon:hover .icon-sun {
  opacity: 0;
  transform: scale(0.5) rotate(-45deg);
}
body.light-theme .theme-toggle-icon:hover .icon-moon {
  opacity: 1;
  transform: rotate(0deg) scale(1);
}








































/* Fixed top buttons container (for theme toggle) */
#top-buttons {
  position: fixed;
  top: 0.8em;
  right: 0em;
  z-index: 1001;
}
@media (max-width:768px) {
  #top-buttons {
    right: 0;
  }
  
}
/* Section header style for aligning title with action buttons/links */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}
.section-header a.btn {
  align-self: center;
}
section {
  margin-bottom: 3rem;
  padding: 1.5rem;
  background: var(--card-bg);
  border-radius: 12px;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
}
h2 {
  color: var(--accent);
  margin: 0;
}
h3 {
  color: var(--accent);
  margin-bottom: 0.5rem;
  text-align: center;
}
ul {
  list-style: none;
  padding: 0;
}
li {
  margin: 0.5rem 0;
}
input[type="checkbox"] {
  transform: scale(1.5);
  margin-right: 0.5rem;
  cursor: pointer;
}
.requirements-list label {
  padding: 0.3rem 0.5rem;
  cursor: pointer;
}
input[type="text"],
input[type="number"] {
  margin-right: 0.5rem;
  padding: 0.3rem;
  font-size: 1rem;
  width: 100%;
  box-sizing: border-box;
}
.tip {
  font-size: 0.9rem;
  color: #9cb3ce;
  margin-top: 1rem;
  border-left: 4px solid var(--accent);
  padding-left: 1rem;
}
.section-image {
  width: 100%;
  height: auto;
  border-radius: 8px;
  margin-top: 1rem;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
  object-fit: cover;
}
.speech-bubble {
  position: relative;
  background: var(--card-bg);
  border-radius: 12px;
  padding: 1rem;
  margin-bottom: 2rem;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
  font-style: italic;
  text-align: center;
}
.speech-bubble::before {
  content: "";
  position: absolute;
  top: -4px;
  left: -4px;
  right: -4px;
  bottom: -4px;
  border-radius: inherit;
  z-index: -1;
}
.speech-bubble::after {
  content: "";
  position: absolute;
  bottom: -20px;
  left: 20px;
  border-width: 10px;
  border-style: solid;
  border-color: var(--card-bg) transparent transparent transparent;
}
/* Achievements Section */
#achievements {
  background: var(--card-bg);
  margin-bottom: 2rem;
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 0 12px rgba(0, 0, 0, 0.3);
}
.achievement-tier {
  margin-bottom: 1.5rem;
}
.achievement-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
.achievement {
  position: relative;
  background: rgba(0, 0, 0, 0.1);
  border-radius: 8px;
  padding: 0.5rem;
  text-align: center;
}
.achievement img {
  width: 45px;
  height: 45px;
  cursor: pointer;
  filter: grayscale(100%);
  transition: filter 0.3s;
}
.achievement.active img {
  filter: none;
}
.achievement .achievement-text {
  margin-top: 0.5rem;
  font-weight: bold;
  display: block;
}
.achievement .requirements-list {
  margin-top: 0.5rem;
  text-align: left;
}
.achievement .requirements-list label {
  font-size: 0.85rem;
  display: block;
  cursor: pointer;
}
.achievement .requirements-list input:checked + span {
  color: green;
}
.achievement time {
  display: block;
  font-size: 0.7rem;
  color: var(--date-color);
  margin-top: 0.3rem;
}
/* Modal styles */
.modal,
.clear-modal {
  display: none;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: var(--modal-bg);
  color: var(--modal-text);
  padding: 1.5rem 2rem;
  border-radius: 8px;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.7);
  z-index: 1000;
  text-align: center;
  max-width: 90%;
}
.modal button,
.clear-modal button {
  margin: 0.5rem;
  padding: 0.5rem 1rem;
  background: var(--card-bg);
  border: 1px solid var(--accent);
  border-radius: 6px;
  cursor: pointer;
  color: var(--popup-button-text);
}
/* Log Sections */
.log-section {
  margin-bottom: 3rem;
  padding: 1.5rem;
  background: var(--card-bg);
  border-radius: 12px;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
}
.log-section form {
  margin-bottom: 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.log-section ul {
  list-style: none;
  padding: 0;
}
.log-section li {
  background: rgba(0, 0, 0, 0.1);
  margin: 0.3rem 0;
  padding: 0.3rem 0.5rem;
  border-radius: 4px;
}
/* Expanded Base Building Log Section */
#baseBuilding .interactive {
  margin-top: 1rem;
  padding: 0.5rem;
  background: rgba(0, 0, 0, 0.15);
  border-radius: 8px;
}
#baseBuilding h3 {
  margin-bottom: 0.5rem;
  text-align: center;
}
/* Material Tracker enhancements */
#materialTracker input {
  width: 80px;
}
/* Material Calculator styling */
#materialCalculator {
  margin-top: 1rem;
  padding: 0.5rem;
  background: rgba(0, 0, 0, 0.15);
  border-radius: 8px;
}
#materialCalculator select,
#materialCalculator input {
  padding: 0.3rem;
  font-size: 1rem;
}
.resource-icon {
  position: relative;
  width: 45px;
  height: 45px;
  display: inline-block;
  margin: 5px;
}
.resource-icon img {
  width: 100%;
  height: 100%;
}
.resource-icon .amount {
  position: absolute;
  bottom: 0;
  right: 0;
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  font-size: 0.8rem;
  padding: 2px 4px;
  border-radius: 4px;
}
/* New Tab Navigation Styles */
.tab-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  background: var(--card-bg);
  border-bottom: 2px solid var(--accent);
  padding: 0.5rem;
  margin: 0;
}
.tab-nav .tab-btn {
  background: transparent;
  border: none;
  color: var(--text);
  font-size: 1rem;
  padding: 0.5rem 1rem;
  cursor: pointer;
  transition: background 0.3s;
}
.tab-nav .tab-btn:hover {
  background: var(--accent);
  color: var(--bg);
}
.tab-nav .tab-btn.active {
  background: var(--accent);
  color: var(--bg);
  border-radius: 6px;
}
.tab-content {
  display: none;
  padding: 1rem;
  background: var(--card-bg);
  border-radius: 12px;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
  margin-top: 1rem;
}
.tab-content.active {
  display: block;
}
/* FAQ interactive styles */
#faqContent p {
  margin: 0.5rem 0;
}

/* Responsive adjustments for mobile devices */
@media (max-width: 600px) {
  .container {
    padding: 1rem;
    max-width: 100%;
  }
  
  /* Stack tab buttons vertically if needed */
  .tab-nav {
    flex-direction: column;
    align-items: stretch;
  }
  
  .tab-nav .tab-btn {
    padding: 0.75rem;
    text-align: center;
    font-size: 1.1rem;
  }
  
  /* Ensure form inputs are full-width on mobile */
  input[type="text"],
  input[type="number"],
  select {
    width: 100%;
    margin-bottom: 0.5rem;
  }
  
  /* Adjust log sections and other fields to avoid overflow */
  .log-section form {
    flex-direction: column;
  }
}

/* Existing global styles... */

/* New Tab Navigation Styles */
.tab-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  background: var(--card-bg);
  border-bottom: 2px solid var(--accent);
  padding: 0.5rem;
  margin: 0;
  border-radius: 12px;
}
.tab-nav .tab-btn {
  background: transparent;
  border: none;
  color: var(--text);
  font-size: 1rem;
  padding: 0.5rem 1rem;
  cursor: pointer;
  transition: background 0.3s;
  margin: 0.2em;
}
.tab-nav .tab-btn:hover {
  background: var(--accent);
  color: var(--bg);
}
.tab-nav .tab-btn.active {
  background: var(--accent);
  color: var(--bg);
  border-radius: 6px;
}
.tab-content {
  display: none;
  padding: 1rem;
  background: var(--card-bg);
  border-radius: 12px;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
  margin-top: 1rem;
}
.tab-content.active {
  display: block;
}

/* Responsive adjustments for mobile devices */
@media (max-width: 768px) {
  .container {
    padding: 1rem;
    max-width: 100%;
    margin: 0 2%;
  }
  
  /* Stack tab buttons vertically if needed */
  .tab-nav {
    flex-direction: column;
    align-items: stretch;
  }
  
  .tab-nav .tab-btn {
    padding: 0.75rem;
    text-align: center;
    font-size: 1.1rem;
  }
  
  /* Ensure form inputs are full-width on mobile */
  input[type="text"],
  input[type="number"],
  select {
    width: 100%;
    margin-bottom: 0.5rem;
  }
  
  /* Adjust log sections and other fields to avoid overflow */
  .log-section form {
    flex-direction: column;
  }
  
  /* Force multi-column grids to a single column */
  .achievement-list {
    grid-template-columns: 1fr;
  }
  
  /* If there are other multi-column areas, adjust them here similarly */
}
