/* 1. Use a more-intuitive box-sizing model */
*,
*::before,
*::after {
  box-sizing: border-box;
}

/* 2. Remove default margin */
* {
  margin: 0;
}

/* 3. Enable keyword animations */
@media (prefers-reduced-motion: no-preference) {
  html {
    interpolate-size: allow-keywords;
  }
}

body {
  /* 4. Add accessible line-height */
  line-height: 1.5;
  /* 5. Improve text rendering */
  -webkit-font-smoothing: antialiased;
}

/* 6. Improve media defaults */
img,
picture,
video,
canvas,
svg {
  display: block;
  max-width: 100%;
}

/* 7. Inherit fonts for form controls */
input,
button,
textarea,
select {
  font: inherit;
}

/* 8. Avoid text overflows */
p,
h1,
h2,
h3,
h4,
h5,
h6 {
  overflow-wrap: break-word;
}

/* 9. Improve line wrapping */
p {
  text-wrap: pretty;
}
h1,
h2,
h3,
h4,
h5,
h6 {
  text-wrap: balance;
}

/*
  10. Create a root stacking context
*/
#root,
#__next {
  isolation: isolate;
}

body {
  font-family: "Montserrat", sans-serif;
  padding: 20px;
  background: #f2f2f2;
}

h1 {
  text-align: center;
  margin-bottom: 20px;
}

form,
#searchSortFilter {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
}

input,
select,
button {
  padding: 8px;
  font-size: 14px;
}

table {
  width: 100%;
  border-collapse: collapse;
  /* font-family: 'Montserrat', sans-serif; */
  font: inherit;
  background: white;
  text-align: center;
  vertical-align: middle;
}

th,
td {
  border: 1px solid #ccc;
  padding: 10px;
}

ul {
  margin: 0;
  padding-left: 16px;
  font-size: 13px;
  list-style: none;
}

button {
  font-family: "montserrat", sans-serif;
  background: #007bff;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

/* .theme-toggle-wrapper {
  display: flex;
  justify-content: center;
  margin-bottom: 20px;
} */

/* #themeToggle {
  display: none; /* hide default checkbox */
/*} */

/* .toggle-label {
  cursor: pointer;
  width: 60px;
  height: 30px;
  background: #ffd93b; /* sun color */
/* border-radius: 15px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-around;
  font-size: 18px;
  user-select: none;
  transition: background 0.3s ease;
  box-shadow: 0 0 5px rgba(0,0,0,0.2); */
/*} */

/* .toggle-label .icon {
  pointer-events: none;
  transition: opacity 0.3s ease;
} */

/* .toggle-label .moon {
  opacity: 0;
} */

/* #themeToggle:checked + .toggle-label {
  background: #2c3e50; /* moon color */
/* } */

/* #themeToggle:checked + .toggle-label .sun {
  opacity: 0;
} */
/* 
#themeToggle:checked + .toggle-label .moon {
  opacity: 1;
} */

/* body.dark {
  background-color: #121212;
  color: #f1f1f1;
} */
/* 
body.dark table {
  background-color: #1e1e1e;
  color: white;
} */

/* body.dark input,
body.dark select,
body.dark button {
  background-color: #333;
  color: white;
  border: 1px solid #555;
} */

/* body.dark th, body.dark td {
  border: 1px solid #444;
} */

.theme-dropdown-wrapper {
  position: relative;
  display: inline-block;
}

.theme-dropdown-btn {
  border: none;
  font-size: 1rem;
  cursor: pointer;
}

/* Default (Light theme) */
.theme-dropdown {
  position: absolute;
  top: 100%;
  left: 20px;
  background: white;
  color: black;
  border: 1px solid #ccc;
  border-radius: 5px;
  list-style: none;
  margin: 0;
  padding: 0.5rem 0;
  z-index: 10;
  width: 120px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.theme-dropdown li {
  padding: 0.5rem 1rem;
  cursor: pointer;
}

.theme-dropdown li:hover {
  background-color: #f0f0f0;
}

/* Dark theme support */
body.dark {
  background-color: #121212;
  color: white;
}

/* Override dropdown styles in dark mode */
body.dark .theme-dropdown {
  background: #2a2a2a;
  color: white;
  border: 1px solid #444;
  box-shadow: 0 2px 8px rgba(255, 255, 255, 0.1);
}

body.dark .theme-dropdown li:hover {
  background-color: #3a3a3a;
}

.hidden {
  display: none;
}
/* Default (Light mode) table styling */
table {
  width: 100%;
  border-collapse: collapse;
  background-color: white;
  color: black;
}

table th,
table td {
  padding: 0.75rem;
  border: 1px solid #ccc;
  text-align: center;
}

/* Dark mode table overrides */
body.dark table {
  background-color: #1e1e1e;
  color: white;
}

body.dark table th {
  background-color: #2c2c2c;
  border-color: #444;
}

body.dark table td {
  border-color: #444;
}

body.dark table tr:nth-child(even) {
  background-color: #2a2a2a;
}

body.dark table tr:hover {
  background-color: #333;
}

@media (max-width: 480px) {
  html {
    font-size: 14px;
  }

  body {
    padding: 0.5rem;
  }

  h1 {
    font-size: 1.5rem;
  }

  form,
  #searchSortFilter {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
  }

  input,
  select,
  button {
    width: 100%;
    font-size: 1rem;
  }

  table {
    font-size: 0.9rem;
  }

  th,
  td {
    padding: 0.4rem;
  }
}

/* Tablets (Portrait) */
@media (max-width: 768px) {
  html {
    font-size: 15px;
  }

  table {
    font-size: 0.95rem;
  }

  th,
  td {
    padding: 0.5rem;
  }
}

/* Laptops and Small Desktops */
@media (max-width: 1024px) {
  html {
    font-size: 16px;
  }

  table {
    font-size: 1rem;
  }

  th,
  td {
    padding: 0.6rem;
  }
}

/* Large Desktops and High-Resolution Screens */
@media (min-width: 1440px) {
  html {
    font-size: 18px;
  }

  table {
    font-size: 1.1rem;
  }

  th,
  td {
    padding: 0.8rem;
  }
}

/* Accessibility: Focus Styles */
input:focus,
select:focus,
button:focus {
  outline: 2px solid #007bff;
  outline-offset: 2px;
}
