/* Global Reset and Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: Arial, sans-serif;
  margin: 0;
  padding: 0;
  background-color: #f8f9fa;
  color: #333;
}

/* Dark mode for body */
body.dark-mode {
  background-color: #343a40;
  color: #f8f9fa;
}

/* Header Navigation Styles */
.navbar {
  background-color: #343a40; /* Dark background */
  border-bottom: 2px solid #007bff;
}
.navbar-brand {
  display: flex;
  align-items: center;
  font-size: 1.5em;
  color: #f8f9fa;
}
.navbar-brand img {
  height: 40px;
  margin-right: 10px;
}
.navbar-nav .nav-link {
  color: #f8f9fa !important;
  font-size: 1em;
}
.navbar-nav .nav-link:hover {
  color: #adb5bd !important;
}
.dropdown-menu {
  background-color: #343a40;
  border: none;
}
.dropdown-menu .dropdown-item {
  color: #f8f9fa;
}
.dropdown-menu .dropdown-item:hover {
  background-color: #495057;
  color: #ffffff;
}
.popup {
  position: fixed;
  z-index: 10000; /* Ensure it's on top */
}

/* Modal Styles */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.5);
  display: none;
  z-index: 1000;
}
.modal-content {
  background: #fff;
  margin: 10% auto;
  padding: 20px;
  width: 50%;
  position: relative;
}
.close {
  position: absolute;
  right: 15px;
  top: 10px;
  font-size: 24px;
  cursor: pointer;
}

/* Containers for pages and forms */
.container,
.form-container {
  width: 90%;
  margin: 0 auto;
  max-width: 800px;
  background: #fff;
  padding: 15px;
  border: 1px solid #ddd;
  border-radius: 5px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* Logo and Header */
.logo {
  display: flex;
  align-items: center;
  margin-bottom: 20px;
  text-align: left;
}
.logo img {
  height: 50px;
  margin-right: 10px;
}
h1 {
  text-align: center;
  font-size: 22px;
  margin-top: 10px;
  color: #007bff;
}

/* Form Sections and Groups */
.form-section {
  margin-bottom: 20px;
}
.form-section h2 {
  font-size: 18px;
  margin-bottom: 10px;
  border-bottom: 1px solid #ddd;
  padding-bottom: 5px;
  color: #555;
}
.form-group {
  margin-bottom: 15px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
}
.form-group label {
  display: inline-block;
  width: 150px;
  font-weight: bold;
  color: #444;
}
input[type="text"],
input[type="datetime-local"],
input[type="number"],
input[type="date"],
select,
textarea {
  flex: 1;
  padding: 8px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 14px;
  box-sizing: border-box;
}
input[type="text"].small-input,
input[type="number"].small-input {
  width: 100px;
  padding: 4px;
  font-size: 14px;
  border: 1px solid #ccc;
  border-radius: 4px;
}

/* Textbook Style Textarea */
textarea.textbook-style {
  height: 120px;
  width: 100%;
  background-image: repeating-linear-gradient(
    to bottom,
    #f9f9f9 0px,
    #f9f9f9 23px,
    #ddd 24px,
    #f9f9f9 25px
  );
  background-size: 100% 25px;
  line-height: 25px;
  padding: 10px;
  font-size: 14px;
  border: 1px solid #ccc;
  resize: none;
}

/* Table Styling */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
}
table, th, td {
  border: 1px solid #ddd;
}
th {
  background: #333;
  color: #fff;
  padding: 10px;
  text-align: center;
}
td {
  padding: 8px;
  text-align: center;
}
td:first-child {
  text-align: left;
}

/* Checkbox Group for PPE */
.checkbox-group {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: space-evenly;
}
.checkbox-group img {
  width: 50px;
  height: auto;
}

/* Free-text Inputs */
.free-text {
  width: 95%;
  padding: 8px;
  border: 1px solid #ddd;
  border-radius: 4px;
  margin-top: 10px;
}

/* Buttons */
.submit-btn,
button {
  display: block;
  width: 100%;
  padding: 12px 20px;
  background-color: #007BFF;
  color: #fff;
  border: none;
  border-radius: 4px;
  font-size: 16px;
  cursor: pointer;
}
.submit-btn:hover,
button:hover {
  background-color: #0056b3;
}
.form-actions {
  text-align: center;
  margin-top: 20px;
}

/* Inline Currency Symbol */
.currency-symbol-inline {
  margin-right: 4px;
  font-size: 14px;
  color: #444;
}

/* Dynamic Containers and Work Boxes */
.dynamic-container {
  margin-top: 10px;
}
.work-box {
  border: 1px solid #ddd;
  border-radius: 5px;
  padding: 10px;
  margin-bottom: 10px;
  background: #f9f9f9;
  position: relative;
}
.work-box-inner {
  display: auto;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
}

/* Work Buttons Container */
.work-buttons {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 10px;
}

/* Button Styles for Dynamic Boxes */
.add-more-btn,
.delete-btn,
.add-btn {
  padding: 8px 12px;
  font-size: 14px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  max-width: 120px;
}
.add-more-btn {
  background-color: #007BFF;
  color: #fff;
}
.add-more-btn:hover {
  background-color: #0056b3;
}
.delete-btn {
  background-color: #FF4C4C;
  color: #fff;
}
.delete-btn:hover {
  background-color: #D94343;
}
.add-btn {
  background-color: #007BFF;
  color: #fff;
}

/* Responsive Design for Mobile Phones */
@media (max-width: 600px) {
  h1 {
    font-size: 1.3em;
  }
  .form-group label {
    width: 100%;
    margin-bottom: 5px;
  }
  input[type="text"].small-input,
  input[type="number"].small-input,

  button,
  .add-more-btn,
  .submit-btn {
    width: 100%;
  }
  .add-more-btn,
  .delete-btn,
  .add-btn {
    max-width: 100%;
  }
  .work-buttons {
    flex-direction: column;
    align-items: stretch;
  }
  th, td {
    padding: 8px;
  }
}

/* ----------------------------------------
   Compact, Modern Modal Styles for Management
------------------------------------------- */
.modal {
  display: none; /* Override previous display style via inline styles if necessary */
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.6);
}
.modal-content {
  background: #fff;
  width: 350px;
  border-radius: 8px;
  box-shadow: 0 5px 15px rgba(0,0,0,0.3);
  padding: 15px;
  font-family: Arial, sans-serif;
}
.close {
  position: absolute;
  right: 15px;
  top: 10px;
  font-size: 24px;
  cursor: pointer;
}

/* Modern Management Modal Styles */
.modern-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: none; /* Hidden by default; shown as flex via JS */
  align-items: center;
  justify-content: center;
  background-color: rgba(0,0,0,0.7);
  z-index: 1100;
  padding: 10px;
}
.modern-modal.active {
  display: flex;
}
.modern-modal-content {
  background: #fff;
  width: 90%;
  max-width: 400px;
  border-radius: 10px;
  box-shadow: 0 8px 16px rgba(0,0,0,0.3);
  overflow: hidden;
  animation: slideDown 0.3s ease-out;
  margin: auto;
}
@keyframes slideDown {
  from { transform: translateY(-20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
.modern-modal-header {
  background-color: #007bff;
  padding: 10px 15px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: nowrap;
}
.modern-modal-header h3 {
  color: #fff;
  font-size: 1em;
  margin: 0;
  white-space: nowrap;
}
.modern-modal-close {
  background: none;
  border: none;
  color: #fff;
  font-size: 0.8em;
  cursor: pointer;
  padding: 0;
}
.modern-modal-body {
  padding: 15px;
}
.modern-input-group {
  display: flex;
  gap: 10px;
  margin-bottom: 15px;
}
.modern-input-group input {
  flex: 1;
  padding: 8px;
  border: 1px solid #ddd;
  border-radius: 5px;
  font-size: 14px;
}
.modern-input-group button {
  padding: 8px 12px;
  background-color: #28a745;
  color: #fff;
  border: none;
  border-radius: 5px;
  font-size: 14px;
  cursor: pointer;
}
.modern-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.modern-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 5px;
  border-bottom: 1px solid #eee;
  font-size: 0.9em;
}
.modern-list li:last-child {
  border-bottom: none;
}
.modern-delete-btn {
  background: none;
  border: none;
  color: #dc3545;
  font-size: 0.7em;
  cursor: pointer;
  padding: 0 2px;
}

/* New styles for header menu (for dark theme navigation) */
.navbar {
  background-color: #343a40;
  border-bottom: 2px solid #007bff;
}
.navbar-brand {
  display: flex;
  align-items: center;
  font-size: 1.5em;
  color: #f8f9fa;
}
.navbar-brand img {
  height: 40px;
  margin-right: 10px;
}
.navbar-nav .nav-link {
  color: #f8f9fa !important;
}
.navbar-nav .nav-link:hover {
  color: #adb5bd !important;
}
.dropdown-menu {
  background-color: #343a40;
  border: none;
}
.dropdown-menu .dropdown-item {
  color: #f8f9fa;
}
.dropdown-menu .dropdown-item:hover {
  background-color: #495057;
  color: #ffffff;
}

/* Center header logo for mobile */
.logo {
  display: flex;
  justify-content: left;
  align-items: center;
  margin-bottom: 20px;
}

/* ----------------------------------------
   New Feature Styles
------------------------------------------- */

/* Profile Card Styles */
.profile-card {
  background-color: #fff;
  border-radius: 10px;
  padding: 20px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
  margin-bottom: 20px;
}
body.dark-mode .profile-card {
  background-color: #1e1e1e;
  color: #f8f9fa;
  box-shadow: 0 2px 5px rgba(255,255,255,0.1);
}

/* Card Header & Body */
.card {
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
  margin-bottom: 20px;
  border: none;
}
body.dark-mode .card {
  background: #1e1e1e;
  box-shadow: 0 2px 5px rgba(255,255,255,0.1);
}
.card-header {
  background-color: #007bff;
  color: #fff;
  border-top-left-radius: 10px;
  border-top-right-radius: 10px;
  padding: 15px;
  font-size: 1.25em;
}
body.dark-mode .card-header {
  background-color: #0056b3;
}
.card-body {
  padding: 15px;
}

/* 2FA QR Code & Secret Display */
.qr-code {
  max-width: 200px;
  display: block;
  margin: 0 auto;
}
.two-factor-secret {
  font-family: monospace;
  font-size: 0.9em;
  text-align: center;
  margin-top: 10px;
}

/* Theme Selector (if used as a form element) */
.theme-selector {
  max-width: 150px;
  margin: 10px 0;
}
