/* Default styles for light mode */
body {
  background-color: #f2f2f2;
  color: #333;
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 1.7em; /* Increased for better readability */
}

/* Improve readability on larger screens */
@media (min-width: 750px) {
  body {
    font-size: 1.75em; /* Even more readable on desktop */
  }
  .container {
    max-width: 1000px; /* Slightly wider than default 960px, but still centered and old-school */
  }
  p {
    font-size: 1.05em; /* Bump up paragraph text slightly */
    line-height: 1.75; /* Better line spacing for readability */
  }
}

/* Styles for dark mode */
body.dark-mode {
  background-color: #333;
  color: #f2f2f2;
}

/* Toggle switch styles */
.switch {
  position: relative;
  display: inline-block;
  width: 36px;
  height: 20px;
}

.switch input {
  display: none;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  transition: 0.4s;
}

.slider:before {
  position: absolute;
  content: "";
  height: 14px;
  width: 14px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.4s;
}

input:checked + .slider {
  background-color: #2196F3;
}

input:checked + .slider:before {
  transform: translateX(16px);
}

/* Flexbox layout for sidebar and content */
.dashboard-container {
  display: flex; /* Use flexbox for layout */
  margin-top: 2%;
  height: calc(100vh - 100px); /* Full height minus header and footer */
}

.sidebar {
  width: 250px; /* Fixed width for sidebar */
  padding: 20px;
  box-shadow: 0px 0 3px rgba(0, 0, 0, 0.1);
  /*background-color: #f8f8f8; /* Light background color */
  overflow-y: auto; /* Scrollable sidebar */
}

body.dark-mode .sidebar.dark-mode {
  background-color: #444; /* Dark background color for sidebar */
}
.sidebar.dark-mode {
  background-color: #444; /* Dark background color for sidebar */
}

.content {
  flex: 1; /* Take up remaining space */
  padding: 20px;
  overflow-y: auto; /* Scrollable content */
}

/* Sidebar link styles */
.sidebar h5 {
  font-size: 20px;
  font-weight: bold;
  margin-bottom: 20px;
}

.sidebar ul {
  list-style-type: none;
  padding-left: 0;
}

.sidebar ul li {
  margin-bottom: 15px;
}

.sidebar ul li a {
  text-decoration: none;
  font-size: 16px;
  color: #333; /* Dark text color */
  display: block;
  padding: 10px;
  border-radius: 5px;
  transition: background-color 0.3s;
}

body.dark-mode .sidebar ul li a {
  color: #f2f2f2; /* Light text color for dark mode */
}

.sidebar ul li a:hover {
  background-color: #e0e0e0; /* Light hover background */
}

body.dark-mode .sidebar ul li a:hover {
  background-color: #555; /* Dark hover background for dark mode */
}

/* Mobile responsiveness */
@media (max-width: 768px) {
  .dashboard-container {
    flex-direction: column; /* Stack sidebar and content vertically */
  }

  .sidebar {
    width: 100%; /* Full width on small screens */
    height: auto;
    padding: 10px;
  }

  .content {
    margin-left: 0;
  }
}

.error {
  color: red;
  font-weight: bold;
  margin-bottom: 15px;
  border: 1px solid red;
  padding: 10px;
  border-radius: 5px;
  background-color: #ffe6e6; /* Light red background */
}

body.dark-mode .error {
  background-color: #660000; /* Dark red background for dark mode */
  color: #f2f2f2; /* Light text color for dark mode */
  border-color: #ff6666; /* Light red border for dark mode */
}

.success {
  color: green;
  font-weight: bold;
  margin-bottom: 15px;
  border: 1px solid green;
  padding: 10px;
  border-radius: 5px;
  background-color: #e6ffe6; /* Light green background */
}

body.dark-mode .success {
  background-color: #006600; /* Dark green background for dark mode */
  color: #f2f2f2; /* Light text color for dark mode */
  border-color: #66ff66; /* Light green border for dark mode */
}

.ad-spot-details {
  width: 100%;
  margin-top: 10px;
}

.ad-spot-details td {
  padding: 5px 10px;
}

.ad-spot-details tr {
  border-bottom: 1px solid #ccc;
}

body.dark-mode .ad-spot-details tr {
  border-bottom: 1px solid #555; /* Dark border for dark mode */
}

.ad-spot-details td a {
  color: #007bff;
  text-decoration: none;
}

.ad-spot-details td a:hover {
  text-decoration: underline;
}

/* Additional styles for login and role management pages */
.container {
  margin-top: 2%;
}

.header .title a {
  text-decoration: none;
  color: inherit;
}

.header .user-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.header .user-info p {
  margin: 0;
}

.header .user-info .button {
  margin-left: 10px;
}

.row {
  display: block;
}

.row .columns {
  flex: 1;
  min-width: 150px;
  margin-bottom: 10px;
}

.capabilities-container {
  display: flex;
  flex-wrap: wrap;
  gap: 20px; /* Space between checkboxes */
}

.capability-column {
  flex: 1 1 calc(33% - 20px); /* Three columns */
  min-width: 200px; /* Minimum width for each column */
}

label {
  display: block; /* Ensure labels take up full width */
  margin: 5px 0; /* Space between checkboxes */
}

/* Header nav alignment */
.header-nav {
  align-items: center;
}
.header-nav .columns,
.header-nav .column,
.header-nav .one.columns,
.header-nav .two.columns {
  display: block;
  align-items: initial;
}
.header-nav .switch {
  display: inline-block;
  vertical-align: middle;
}
.header-nav .switch .slider { margin-top: 0; }

/* Header bar layout: logo left, toggle right */
.site-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.site-header-bar .title { margin: 0; }
.mode-toggle { display: flex; align-items: center; }

/* Footer tweaks */
.site-footer {
  text-align: center;
  font-size: 1rem;
}
.site-footer p {
  margin: 6px 0; /* tighter spacing */
}

/* Footer links inline list */
.site-footer .footer-links ul {
  list-style: none;
  padding: 0;
  margin: 4px 0 8px;
}
.site-footer .footer-links li {
  display: inline;
  margin: 0 8px;
}
.site-footer .footer-links a {
  text-decoration: none;
}
.site-footer .footer-links a:hover {
  text-decoration: underline;
}

.table-scroll { width:100%; overflow-x:auto; -webkit-overflow-scrolling:touch; }
.table-scroll table { min-width:760px; }
@media (max-width:900px){ .hide-md{ display:none;} }
@media (max-width:700px){ .hide-sm{ display:none;} }

/* Global form controls: do not stretch checkboxes/radios */
input[type="checkbox"],
input[type="radio"]{
  width:auto;
}

/* Shared utilities (so non-dashboard pages can use the same UI patterns) */
.option-row{
  display:flex;
  align-items:flex-start;
  gap:10px;
  margin:8px 0;
}
.option-row input[type="radio"],
.option-row input[type="checkbox"]{
  margin-top:2px;
  flex:0 0 auto;
}
.option-row .option-body{ min-width:0; }
.option-row .option-title{ font-weight:600; line-height:1.2; }
.option-row .option-help{ margin-top:4px; font-size:0.85rem; color:#555; line-height:1.25; }

.tag{
  display:inline-block;
  margin-left:6px;
  padding:2px 6px;
  font-size:0.7rem;
  border:1px solid #bbb;
  color:#666;
  background:#f2f2f2;
  vertical-align:middle;
  border-radius:10px;
}

body.dark-mode .option-row .option-help{ color:#c7cdd6; }
body.dark-mode .tag{ background:#3a404b; border-color:#4a5260; color:#c7cdd6; }

.remember-me-row{
  display:flex;
  align-items:center;
  gap:8px;
}

.remember-me-row label{
  display:inline-block;
  margin:0;
}

.remember-me-row input[type="checkbox"]{
  margin:0;
}

fieldset{
  border:1px solid #cfd7e3;
  border-radius:8px;
  padding:12px;
  margin:12px 0;
}
legend{ padding:0 6px; font-weight:700; }
body.dark-mode fieldset{ border-color:#3a404b; }

/* Broader dark-mode coverage for shared/public pages */
body.dark-mode .container,
body.dark-mode .site-footer {
  color: #e6edf5;
}

body.dark-mode a {
  color: #8fc7ff;
}

body.dark-mode .site-footer .footer-links a {
  color: #c7d6e8;
}

body.dark-mode input:not([type="checkbox"]):not([type="radio"]),
body.dark-mode select,
body.dark-mode textarea {
  background-color: #1f232a;
  color: #e6edf5;
  border-color: #3a4452;
}

body.dark-mode input::placeholder,
body.dark-mode textarea::placeholder {
  color: #9fb0c2;
}

body.dark-mode input:focus,
body.dark-mode select:focus,
body.dark-mode textarea:focus {
  border-color: #5da9f6;
}

body.dark-mode details {
  background: #232a33;
  border-color: #3a4452;
}

body.dark-mode details[open] {
  background: #262f39;
}

body.dark-mode summary {
  color: #e6edf5;
}

body.dark-mode table {
  background: #232a33;
  color: #e6edf5;
}

body.dark-mode th,
body.dark-mode td {
  border-color: #3a4452;
}

body.dark-mode table tr:nth-child(even) {
  background: #27303a;
}

body.dark-mode table tr:hover {
  background: #2d3641;
}

body.dark-mode .table-scroll {
  background: #20262f;
  border-radius: 6px;
}

body.dark-mode .button {
  background-color: #2e7bd1;
  color: #fff;
  border-color: #2e7bd1;
}

body.dark-mode .button.button-primary {
  background-color: #1f6ec2;
  border-color: #1f6ec2;
}

body.dark-mode .button.button-secondary {
  background-color: #38404a;
  border-color: #4b5563;
}

body.dark-mode .chip {
  color: #e6edf5;
  border-color: #4a5260;
}
