/* Reset & Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  font-family: "Segoe UI", sans-serif;
}

/* Layout */
.split-layout {
  display: flex;
  flex-direction: row;
  height: 100vh;
}

/* Left Side */
.left-side {
  width: 66%; /* instead of flex:1 */
  min-width: 500px; /* optional minimum */
  max-width: 80%; /* optional maximum */
  background: linear-gradient(135deg, #003865, #003865);
  color: white;
  display: flex;
  justify-content: center;
  resize: horizontal;
  overflow: auto;
}

.form-wrapper {
  width: 75%;
  max-width: 800px;
  text-align: center;
  padding: 0.5rem;
}

.form-wrapper h1 {
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

.form-wrapper p {
  margin-bottom: 2rem;
  font-size: 1.1rem;
}

.search-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.search-form input {
  padding: 0.75rem;
  border: none;
  border-radius: 0.5rem;
  font-size: 1rem;
}

.search-form button {
  padding: 0.75rem;
  background-color: #ffffff;
  color: #003865;
  font-weight: bold;
  font-size: 1rem;
  border: none;
  border-radius: 0.5rem;
  cursor: pointer;
  transition:
    background-color 0.3s,
    color 0.3s;
}

.search-form button:hover {
  background-color: #e6e6e6;
}

/* Right Side */
.right-side {
  flex: 1;
  background: #ffffff;
  overflow: auto;
}

/***** Custom CSS *******/

.download-btn {
  padding: 0.5rem;
  color: white;
  background-color: #003865;
  border-radius: 0.5rem;
  cursor: pointer;
}

.info-logo {
  width: 80px;
  height: 80px;
  margin-bottom: 1rem;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3); /* shadow */
  border-radius: 50%; /* optional: makes shadow more circular */
}

/* Style for inputs, textareas, and selects */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="date"],
textarea,
select {
  padding: 0.5rem !important;
  border: 2px solid #ccc !important;
  border-radius: 0.5rem !important;
  outline: none !important;
  transition: border-color 0.3s !important;
  width: 100% !important;
}

/* Focus effect */
input:focus,
textarea:focus,
select:focus {
  border-color: #003865;
}

.half-input {
  display: flex;
  justify-content: center;
  gap: 1rem;
  width: 100%;
}

.half-input input,
.half-input select,
.half-input button,
.half-input label {
  min-width: 0;
  width: 100%;
}

.topic-label {
  margin-right: auto;
  margin-top: 0.5rem;
  font-size: 1.25rem;
  text-transform: uppercase;
}

/***********Checkboxes***********/

input[type="checkbox"] {
  width: 1.5rem;
  height: 1.5rem;
  border: 1px solid #003865;
  border-radius: 0.4rem;
  appearance: none;
  -webkit-appearance: none;
  background-color: #fff;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  flex-shrink: 0; /* prevent checkbox from shrinking */
}

/* Checkbox when checked */
input[type="checkbox"]:checked {
  background-color: #003865;
  border-color: #003865;
}

/* Create checkmark inside */
input[type="checkbox"]::after {
  content: "";
  position: absolute;
  top: 0.25rem;
  left: 0.45rem;
  width: 0.25rem;
  height: 0.6rem;
  border: solid white;
  border-width: 0 0.2rem 0.2rem 0;
  transform: rotate(45deg);
  opacity: 0;
  transition: opacity 0.2s ease;
}

/* Show checkmark when checked */
input[type="checkbox"]:checked::after {
  opacity: 1;
}

/* Checkbox label wrapper */
.checkbox-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: none;
  color: #333;
  font-weight: 500;
  margin-top: 0.5rem;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.5rem; /* Space between checkbox and text */
  font-weight: 500;
  color: white;
}

/********** Table CSS *************/

.table-container {
  display: flex !important;
  flex-direction: column !important;
  justify-content: center !important;
  align-items: center !important;
  min-height: 80vh !important;
  padding: 2rem !important;
}

.styled-table {
  border-collapse: collapse !important;
  font-size: 1rem !important;
  width: 100% !important;
  max-width: 700px !important;
  min-width: 300px !important;
  border-radius: 12px !important;
  overflow: hidden !important;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15) !important;
  background-color: #fff !important;
}

.styled-table thead tr {
  background-color: #003865 !important;
  color: #ffffff !important;
  text-align: left !important;
}

.styled-table th,
.styled-table td {
  padding: 1rem 1.5rem !important;
}

.styled-table tbody tr {
  border-bottom: 1px solid #dddddd !important;
}

.styled-table tbody tr:nth-of-type(even) {
  background-color: #f3f3f3 !important;
}

.styled-table tbody tr:hover {
  background-color: #f1f9ff !important;
  cursor: pointer !important;
}

#dataTable_wrapper {
  width: 60% !important;
  max-width: 700px !important;
  min-width: 300px !important;
}

#search-limit-message {
  color: #cc0000;
  font-size: 1rem;
  font-weight: 600;
  max-width: 700px;
  width: 60%;
  margin-bottom: 1.25rem;
  line-height: 1.5;
}

/*********Help Icons*****************/

.help-icon {
  background: none;
  border: none;
  color: #003865;
  cursor: pointer;
  font-size: 0.9em;
  margin-left: 5px;
}
.help-icon:hover {
  color: #003865;
}

/***********Animations***************/
input:hover,
select:hover,
button:hover {
  transform: scale(1.05);
}

.fade-in {
  opacity: 0;
  animation: fadeIn 1s ease-in forwards;
}

@keyframes fadeIn {
  to {
    opacity: 1;
  }
}

/**********CSS Media Queries**********/

/* Stack vertically on smaller screens */
@media (max-width: 768px) {
  .split-layout {
    flex-direction: column; /* top-bottom layout */
    height: auto;
  }

  .left-side,
  .right-side {
    width: 100%;
    min-width: 100%;
    max-width: 100%;
    padding: 1rem;
  }
}

/* Modal overlay */
.loading-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 56, 101, 0.85); /* DNR dark blue */
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

/* Hide helper */
.loading-modal.hidden {
  display: none;
}

/* Modal box */
.loading-content {
  background: #ffffff;
  border-radius: 8px;
  padding: 30px 40px;
  text-align: center;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.25);
  min-width: 260px;
}

/* Spinner */
.spinner {
  width: 48px;
  height: 48px;
  margin: 0 auto 15px auto;
  border: 5px solid #cfd8e3;
  border-top-color: #0056b3; /* primary site blue */
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}

.loading-content p {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: #003865;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
