/* Basic header styling */
header {
    display: flex;
    justify-content: space-between;  /* Logo on left, slider on right */
    align-items: center;
    background-color: #f5f5f5;
    padding: 20px;
    border-bottom: 1px solid #ddd;
    margin-bottom: 20px;
}

/* Logo styling */
.logo img {
    height: 50px;   /* Adjust as needed */
    width: auto;
}

/* Slider container styling */
.slider-container {
    display: flex;
    align-items: center;
}

/* The toggle switch */
.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
    margin-right: 8px; /* Spacing between slider and label */
}

/* Hide default checkbox */
.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

/* The slider background */
.slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: #ccc;
    transition: 0.4s;
    border-radius: 34px;
}

/* The knob (circle) */
.slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 4px;
    bottom: 4px;
    background-color: #fff;
    transition: 0.4s;
    border-radius: 50%;
}

/* If checked, move the knob to the right and change background color */
input:checked + .slider {
    background-color: #2196F3;
}

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

/* Round the slider background */
.slider.round {
    border-radius: 34px;
}

/* Round the knob */
.slider.round:before {
    border-radius: 50%;
}

/* Label next to the slider */
.slider-label {
    font-size: 1rem;
}

.loading-icon {
    display: inline-block;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

.modal {
    display: none; /* Hidden by default */
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.4);
}

.modal-content {
    background-color: #fff;
    margin: 15% auto;
    padding: 20px;
    border: 1px solid #888;
    width: 50%;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    border-radius: 10px;
}

.close-button {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close-button:hover,
.close-button:focus {
    color: black;
    text-decoration: none;
}

/******************/

/* ----------------------------------
   GLOBAL / BODY / HEADER
------------------------------------- */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: Arial, sans-serif;
  background-color: #1a1a1a; /* Dark background */
  color: #ffffff;
  margin: 0;
  padding: 20px;
}

header {
  display: flex;
  justify-content: space-between;  /* Logo on left, settings on right */
  align-items: center;
  background-color: #2c2c2c;       /* Dark gray header */
  padding: 20px;
  border-bottom: 1px solid #444;
  margin-bottom: 20px;
}

.logo img {
  height: 50px;
  width: auto;
}

/* ----------------------------------
   DROPDOWN MENU
------------------------------------- */
.dropdown-container {
  position: relative; /* Necessary for absolute positioning of dropdown-content */
  display: inline-block;
}

.settings-btn {
  background-color: #333;
  color: #fff;
  padding: 8px 16px;
  text-decoration:none;
  cursor: pointer;
  border: none;
  border-radius: 4px;
  font-size: 0.9rem;
}

.settings-btn:hover {
  background-color: #444;
}

.dropdown-content {
  display: none; /* Hidden by default */
  position: absolute;
  right: 0;      /* Align the dropdown to the right edge of its container */
  background-color: #2c2c2c;
  min-width: 200px;
  box-shadow: 0 8px 16px rgba(0,0,0,0.2);
  border: 1px solid #444;
  z-index: 999;  /* Ensure it appears above other elements */
  padding: 8px 0;
}

.dropdown-item {
  display: flex;
  align-items: center;
  justify-content: space-between; /* So the label and slider are spaced out */
  padding: 8px 16px;
}

.dropdown-item:hover {
  background-color: #333;
}

.dropdown-container:hover .dropdown-content {
  display: block; /* Show dropdown on hover
                    (Alternatively, you can toggle with JS on click) */
}

/* Alternatively, if you prefer toggling on click,
   remove the :hover line above and handle display in JS. */

/* ----------------------------------
   SLIDER SWITCH (Auto-process)
------------------------------------- */
.switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 24px;
  margin-left: 8px; /* Some spacing from the label */
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: #555;
  transition: 0.4s;
  border-radius: 34px;
}

.slider:before {
  content: "";
  position: absolute;
  height: 16px;
  width: 16px;
  left: 4px;
  bottom: 4px;
  background-color: #fff;
  transition: 0.4s;
  border-radius: 50%;
}

input:checked + .slider {
  background-color: #2196F3; /* Light blue accent */
}

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

.slider.round {
  border-radius: 34px;
}

.slider.round:before {
  border-radius: 50%;
}

.slider-label {
  font-size: 0.9rem;
}

/* ----------------------------------
   TABLE
------------------------------------- */
main {
  padding: 0 20px;
}

table {
  width: 100%;
  border-collapse: collapse;
  background-color: #2a2a2a;
  margin-bottom: 20px;
}

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

th {
  background-color: #333;
  color: #fff;
}

tr:nth-child(even) {
  background-color: #242424;
}

tbody tr:hover {
  background-color: #333;
}

button.process-btn,
button.result-btn {
  background-color: #2196F3;
  color: #fff;
  border: none;
  padding: 6px 12px;
  cursor: pointer;
  font-size: 0.9rem;
  border-radius: 4px;
}

button.process-btn:hover,
button.result-btn:hover {
  background-color: #40a9ff;
}

/* ----------------------------------
   MODALS
------------------------------------- */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.4);
}

.modal-content {
  background-color: #2c2c2c;
  margin: 10% auto;
  padding: 20px;
  border: 1px solid #444;
  width: 50%;
  max-width: 600px;
  border-radius: 10px;
  color: #fff;
  position: relative;
}

.close-button,
.close-reporting-button {
  color: #aaa;
  float: right;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
  margin-left: 10px;
}

.close-button:hover,
.close-button:focus,
.close-reporting-button:hover,
.close-reporting-button:focus {
  color: #fff;
  text-decoration: none;
}

.copy-btn {
  background-color: #2196F3;
  color: #fff;
  border: none;
  padding: 0.5rem 1rem;
  cursor: pointer;
  border-radius: 4px;
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.copy-btn:hover {
  background-color: #40a9ff;
}

/* Reporting Settings Modal Fields */
.modal-field {
  display: flex;
  flex-direction: column;
  margin-bottom: 1rem;
}

.modal-field label {
  margin-bottom: 0.5rem;
}

.modal-field input {
  padding: 6px;
  border: 1px solid #555;
  border-radius: 4px;
  background-color: #444;
  color: #fff;
}

th:hover {
    background-color:#2196f3
}

.flashes { list-style: none; padding: 0; margin: 1em 0; }
.flashes li { padding: 10px; margin-bottom: 10px; border-radius: 4px; }
.flashes .error { background-color: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }
.flashes .info { background-color: #d1ecf1; color: #0c5460; border: 1px solid #bee5eb; }
button { padding: 10px 15px; cursor: pointer; }