/* Base (Light Mode) */
body {
  font-family: sans-serif;
  background-color: #f7f7f7;
  margin: 0;
  padding: 2rem;
  color: #333;
  transition: background-color 0.3s ease, color 0.3s ease;
}

.container {
  max-width: 800px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
}

form {
  background: #fff;
  padding: 2rem;
  width: 100%;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

h2 {
  margin-bottom: 1rem;
}

.form-group {
  margin-bottom: 1.25rem;
}

label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
}

input[type="text"],
input[type="date"],
textarea {
  width: 100%;
  padding: 0.5rem;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 1rem;
  background-color: #fff;
  color: #000;
}

textarea {
  resize: vertical;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1rem;
  table-layout: fixed; /* This ensures equal column widths */
}

table th,
table td {
  padding: 0.5rem;
  border: 1px solid #ddd;
  text-align: left;
  overflow: hidden; /* Prevent content from overflowing */
}

/* Specific styling for inputs inside table cells */
table td input[type="text"] {
  width: 100%;
  padding: 0.4rem;
  box-sizing: border-box;
  margin: 0;
  font-size: 0.9rem; /* Slightly smaller text for table inputs */
}

fieldset {
  border: none;
  padding: 0;
  margin: 0 0 2rem 0;
}

legend {
  font-size: 1.2rem;
  font-weight: bold;
  margin-bottom: 1rem;
}

input[type="radio"] {
  margin-right: 0.5rem;
}

button {
  background-color: #0077cc;
  color: white;
  padding: 0.6rem 1.2rem;
  border: none;
  border-radius: 4px;
  font-size: 1rem;
  cursor: pointer;
  margin-top: 1rem;
}

button:hover {
  background-color: #005fa3;
}

/* Dark Mode Overrides */
body.dark {
  background-color: #1e1e1e;
  color: #e0e0e0;
}

body.dark form {
  background: #2a2a2a;
  box-shadow: 0 2px 10px rgba(255,255,255,0.05);
}

body.dark input,
body.dark textarea {
  background-color: #333;
  color: #eee;
  border: 1px solid #555;
}

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

body.dark button {
  background-color: #444cc9;
}

body.dark button:hover {
  background-color: #332caa;
}

.flex-row {
  display: flex;
  align-items: center;
  gap: 1rem;  
}

.flex-row > label {
  min-width: 240px;
  margin-bottom: 0; /* override default spacing */
}

.radio-options {
  display: flex;
  gap: 1.5rem;
}

.radio-options label {
  font-weight: normal;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.form-row {
  display: flex;
  gap: 2rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.form-row .form-group {
  flex: 1;
  min-width: 250px;
}

/* Theme Toggle Button */
.header-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  width: 100%;
}

#theme-toggle {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #f0f0f0;
  padding: 0;
  margin: 0;
}

#theme-toggle img {
  width: 20px;
  height: 20px;
}

/* Show/hide appropriate icon based on theme */
.light-mode-icon {
  display: block;
}

.dark-mode-icon {
  display: none;
}

body.dark .light-mode-icon {
  display: none;
}

body.dark .dark-mode-icon {
  display: block;
}

body.dark #theme-toggle {
  background-color: #444;
}

#theme-toggle:hover {
  background-color: #e0e0e0;
}

body.dark #theme-toggle:hover {
  background-color: #555;
}

/* Logo styling */
.logo-container {
  display: flex;
  justify-content: center;
  margin-bottom: 1.5rem;
  width: 100%;
}

.logo {
  max-width: 200px;
  height: auto;
  transition: filter 0.3s ease;
}

/* Dark mode adjustment for logo */
body.dark .logo {
  /* Apply a filter to make the logo work in dark mode */
  filter: brightness(0.9) contrast(1.1);
}

/* Header and intro text */
.header-controls h1 {
  font-size: 1.5rem;
  margin: 0;
  flex: 1;
  padding-right: 15px;
}

.intro-text {
  margin-bottom: 2rem;
  text-align: center;
  width: 100%;
}

.intro-text p {
  color: #555;
  line-height: 1.6;
  max-width: 800px;
  margin: 0 auto;
}

body.dark .intro-text p {
  color: #aaa;
}