/* Basic styles and typography */
html {
  font-size: 16px;
}

body {
  font-family: 'Roboto', sans-serif;
  margin: 0;
  padding: 0;
}

header {
  background-color: black;
  color: white;
  padding: 10px 20px;
  box-sizing: border-box;
  width: 100%;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1000;
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo-container {
  flex: 1;
}

.logo {
  height: 50px; /* Adjust as necessary */
}

.top-nav {
  flex: 2;
}

.top-nav ul {
  list-style-type: none;
  display: flex;
  justify-content: space-around;
  margin: 0;
  padding: 0;
}

.top-nav ul li {
  margin: 0 10px;
}

.top-nav ul li a {
  color: white;
  text-decoration: none;
}

.container {
  display: flex;
  flex-direction: column; /* Adjust for mobile */
  min-height: 100vh; /* Change height to min-height */
  padding-top: 60px; /* Adjust for fixed header */
}

.content {
  padding: 10px;
  flex-grow: 1;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
}

table {
  border-collapse: collapse;
  width: 100%;
}

table th,
table td {
  border: 1px solid #ccc;
  text-align: left;
  padding: 10px;
}

table th {
  background-color: #f2f2f2;
}

.inputs-container {
  background-color: white;
  padding: 20px; /* Reduce padding on mobile */
  margin-bottom: 15px;
  width: 100%; /* Full width on mobile */
  box-sizing: border-box;
  border-radius: 10px;
}

.buttons-container {
  display: flex;
  flex-direction: column; /* Stack buttons on mobile */
  gap: 10px;
  width: 100%; /* Full width on mobile */
  padding-top: 15px;
}

.buttons-container button {
  background-color: #007BFF;
  color: #ffffff;
  border: none;
  padding: 15px;
  margin-bottom: 5px;
  cursor: pointer;
  width: 100%; /* Full width on mobile */
}

.buttons-container button:hover {
  background-color: #0056B3;
}

.rounded-container {
  background-color: white;
  padding: 10px;
  width: 100%; /* Full width on mobile */
  border-radius: 10px;
}

.table-wrapper {
  width: 100%;
  overflow-x: auto; /* Allow horizontal scrolling on mobile */
  -webkit-overflow-scrolling: touch; /* Smooth scrolling for touch devices */
}

#whatIfCalculator {
  background-color: white;
  padding: 10px;
  margin-top: 15px;
  box-sizing: border-box;
  border-radius: 10px;
  width: 100%; /* Full width on mobile */
}

#whatIfCalculator form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

#whatIfCalculator input {
  padding: 10px;
  margin-bottom: 10px;
}

#calculateWhatIfLose,
#calculatePandemicRate,
#calculateInflationRate {
  background-color: #007BFF;
  color: #ffffff;
  border: none;
  padding: 10px;
  cursor: pointer;
}

#calculateWhatIfLose:hover,
#calculatePandemicRate:hover,
#calculateInflationRate:hover {
  background-color: #0056B3;
}

#whatIfResults {
  margin-top: 15px;
}

.ad-container {
  background-color: #f9f9f9;
  padding: 20px;
  text-align: center;
}

.ad-container h2 {
  margin: 0;
  padding-bottom: 10px;
}

.ad-container a {
  color: #333;
  text-decoration: none;
}

.ad-container img {
  max-width: 200px;
  height: auto;
}

.sponsors {
  display: flex;
  flex-direction: column; /* Stack sponsors on mobile */
  align-items: center;
}

.sponsors a {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
  color: inherit;
}

.sponsor-logo {
  max-width: 100%;
  height: 50px; /* Adjust height */
  object-fit: contain;
}

/* Media queries for larger screens */
@media screen and (min-width: 768px) {
  .container {
    flex-direction: row; /* Side-by-side layout for larger screens */
  }

 .buttons-container {
    flex-direction: row; /* Row layout for buttons on larger screens */
    flex-wrap: wrap;
    gap: 10px; /* Ensure there's enough gap between buttons */
    max-width: 100%; /* Ensure full width is utilized */
  }

 .buttons-container button {
    width: auto; /* Auto width on larger screens */
  }

  .sponsors {
    flex-direction: row; /* Row layout for sponsors on larger screens */
    justify-content: center;
  }
}

/* Media queries for smaller screens */
@media screen and (max-width: 767px) {
  .logo {
    max-width: 150px; /* Adjust logo size on mobile */
    margin: 0 auto 10px auto; /* Center the logo on mobile with reduced margin */
  }
}

/* Define color variables */
:root {
  --background-color: #ffffff;
  --text-color: #000000;
  --icon-path: 'sunlight-icon.png';
}

/* Define default and dark mode colors */
body {
  --background-color: #ffffff; /* Light mode background */
  --text-color: #000000;       /* Light mode text */
  --icon-path: 'sunlight-icon.png'; /* Light mode icon */
  background-color: var(--background-color);
  color: var(--text-color);
  transition: background-color 0.3s, color 0.3s;
}

body.dark-mode {
  --background-color: #000000; /* Dark mode background */
  --text-color: #e59c9c;       /* Dark mode text */
  --icon-path: 'moonlight-icon.png'; /* Dark mode icon */
}

/* Update icon for dark mode toggle */
#darkModeIcon {
  content: url(var(--icon-path));
  transition: content 0.3s;
}

#calculator {
  position: relative;
}

#darkModeToggle {
  position: absolute;
  top: 20px;
  right: 20px;
  background-color: transparent;
  border: none;
  cursor: pointer;
}

#darkModeToggle i {
  font-size: 24px;  
  color: #f39c12;  
}

/* Define dark mode styles for specific elements and classes */
body.dark-mode a {
  color: lightblue;
}

body.dark-mode h2, body.dark-mode h3, body.dark-mode h4 {
  color: lightcoral;
}

body.dark-mode input,
body.dark-mode button,
body.dark-mode select,
body.dark-mode label {
    color: var(--text-color);
}

body.dark-mode table th,
body.dark-mode table td {
    border: 1px solid var(--text-color);
}

/* Specific class adjustments */
body.dark-mode .your-specific-class {
    color: var(--text-color);
}

body.dark-mode #calculator,
body.dark-mode #whatIfCalculator,
body.dark-mode .ad-container {
  background-color: #333333;  /* Desired shade of gray */
  color: #e59c9c;  /* White text for contrast against the gray background */
}

body.dark-mode .inputs-container {
  background-color: #333333;  /* Desired shade of gray */
  color: #e59c9c;  /* White text for contrast against the gray background */
}
