/* /css/style.css */
@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700&display=swap');

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Roboto', Arial, sans-serif;
  background-color: #f4f6f9;
  margin: 0;
  color: #333;
  transition: background-color 0.3s, color 0.3s;
}

a {
  color: #3498db;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* Dark Mode General Styles */
body.dark-mode {
  background-color: #1e2a38;
  color: #d3d3d3;
}


.dark-mode a:hover {
  color: #99ccff;
}

/* Containers */
.monthly-overview-container,
.crew-dashboard,
.admin-section,
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
  background-color: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  transition: background-color 0.3s;
}

.dark-mode .monthly-overview-container,
.dark-mode .crew-dashboard,
.dark-mode .admin-section,
.dark-mode .container {
  background-color: #2c3e50;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

.container {
  display: flex;
  gap: 20px;
}

.left-section,
.right-section {
  background-color: #fff;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  transition: background-color 0.3s;
}

.dark-mode .left-section,
.dark-mode .right-section {
  background-color: #34495e;
}

.left-section {
  flex: 2;
}

.right-section {
  flex: 1;
  border-left: 1px solid #ccc;
}

.dark-mode .right-section {
  border-left: 1px solid #555;
}

/* Header Navigation */
.main-nav {
  background-color: #fff;
  padding: 10px 20px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  position: sticky;
  top: 0;
  z-index: 1000;
  max-width: 1200px;
  margin: 0 auto;
  transition: background-color 0.3s;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.dark-mode .main-nav {
  background-color: #2c3e50;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

.nav-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex; /* Default: show as flex row */
  justify-content: flex-start;
  align-items: center;
}

.nav-item {
  margin-right: 20px;
}

.nav-link {
  text-decoration: none;
  color: #3498db;
  font-weight: 500;
  padding: 8px 12px;
  border-radius: 4px;
  transition: background-color 0.3s, color 0.3s;
  white-space: nowrap;
}

.dark-mode .nav-link {
  color: #66b3ff;
}

.nav-link:hover {
  background-color: #3498db;
  color: #fff;
}

.dark-mode .nav-link:hover {
  background-color: #4682b4;
}

.nav-logout {
  color: #e74c3c;
}

.dark-mode .nav-logout {
  color: #ff6666;
}

.nav-logout:hover {
  background-color: #e74c3c;
  color: #fff;
}

.dark-mode .nav-logout:hover {
  background-color: #cc3333;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-info {
  padding: 8px 12px;
  color: #2c3e50;
  font-weight: 500;
}

.dark-mode .user-info {
  color: #d3d3d3;
}

.user-info a {
  color: #2c3e50;
  text-decoration: none;
}

.dark-mode .user-info a {
  color: #d3d3d3;
}

.user-info a:hover {
  text-decoration: underline;
}

.hamburger {
  display: none; /* Default: hide hamburger */
  font-size: 24px;
  color: #3498db;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  transition: color 0.3s;
}

.dark-mode .hamburger {
  color: #66b3ff;
}

/* Dark Mode Toggle Button */
.dark-mode-btn {
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  padding: 8px;
  color: #3498db;
  transition: color 0.3s;
}

.dark-mode .dark-mode-btn {
  color: #ffd700; /* Yellow sun for light mode */
}

/* Titles */
.overview-title,
.dashboard-title,
.admin-title,
.crew-shift-title {
  font-size: 24px;
  margin-bottom: 28px;
  color: #2c3e50;
  text-align: left;
  transition: color 0.3s;
  font-weight: 500;
}

.dark-mode .overview-title,
.dark-mode .dashboard-title,
.dark-mode .admin-title,
.dark-mode .crew-shift-title {
  color: #ecf0f1;
}

h3 {
  font-size: 20px;
  color: #2c3e50;
  margin-bottom: 15px;
  transition: color 0.3s;
  font-weight: 500;
}

.dark-mode h3 {
  color: #ecf0f1;
}

h4 {
  font-size: 18px;
  color: #34495e;
  margin-bottom: 10px;
  transition: color 0.3s;
  font-weight: 500;
}

.dark-mode h4 {
  color: #bdc3c7;
}

.logout-link {
  float: right;
  font-size: 14px;
  text-decoration: none;
  color: #e74c3c;
  font-weight: bold;
}

.dark-mode .logout-link {
  color: #ff6666;
}

.logout-link:hover {
  text-decoration: underline;
}

/* Form Styles */
.overview-form,
.worklog-form,
.edit-worklog-form,
.boat-form,
.user-form,
.toggle-form {
  display: flex;
  flex-direction: column;
  gap: 15px;
  margin-bottom: 20px;
  padding: 15px;
  background: #eef;
  border-radius: 4px;
  transition: background-color 0.3s;
}

.dark-mode .overview-form,
.dark-mode .worklog-form,
.dark-mode .edit-worklog-form,
.dark-mode .boat-form,
.dark-mode .user-form,
.dark-mode .toggle-form {
  background: #34495e;
}

.form-group {
  display: flex;
  flex-direction: column;
  margin-bottom: 15px;
}

.overview-form label,
.worklog-form label,
.edit-worklog-form label,
.boat-form label,
.user-form label,
.toggle-form label {
  font-weight: 500;
  display: block;
  margin-top: 10px;
  margin-bottom: 5px;
  transition: color 0.3s;
}

.dark-mode .overview-form label,
.dark-mode .worklog-form label,
.dark-mode .edit-worklog-form label,
.dark-mode .boat-form label,
.dark-mode .user-form label,
.dark-mode .toggle-form label {
  color: #d3d3d3;
}

.boat-select,
.month-input,
.worklog-form input[type="datetime-local"],
.edit-worklog-form input[type="datetime-local"],
.toggle-form input[type="text"],
.toggle-form input[type="date"],
.toggle-form input[type="password"],
.toggle-form select,
.toggle-form input[type="color"],
.login-container input[type="text"],
.login-container input[type="password"] {
  padding: 8px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
  width: 100%;
  box-sizing: border-box;
  background-color: #fff;
  color: #333;
  transition: background-color 0.3s, color 0.3s, border-color 0.3s;
}

.dark-mode .boat-select,
.dark-mode .month-input,
.dark-mode .worklog-form input[type="datetime-local"],
.dark-mode .edit-worklog-form input[type="datetime-local"],
.dark-mode .toggle-form input[type="text"],
.dark-mode .toggle-form input[type="date"],
.dark-mode .toggle-form input[type="password"],
.dark-mode .toggle-form select,
.dark-mode .toggle-form input[type="color"],
.dark-mode .login-container input[type="text"],
.dark-mode .login-container input[type="password"] {
  background-color: #2c3e50;
  color: #d3d3d3;
  border-color: #555;
}

.toggle-form textarea,
.description-textarea {
  padding: 8px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
  width: 100%;
  resize: vertical;
  min-height: 80px;
  background-color: #fff;
  color: #333;
}

.dark-mode .toggle-form textarea,
.dark-mode .description-textarea {
  background-color: #3a4e63;
  color: #d3d3d3;
  border-color: #555;
  margin-top: 24px;
}

.csv-link {
  display: inline-block;
  margin-top: 5px;
  color: #3498db;
  font-size: 12px;
}

.dark-mode .csv-link {
  color: #66b3ff;
}

.generate-btn,
.save-button,
.toggle-button,
.shift-button,
.form-buttons button[type="submit"] {
  padding: 8px 16px;
  background-color: #3498db;
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 500;
  width: 170px;
  text-align: center;
  transition: background-color 0.3s;
}

.dark-mode .generate-btn,
.dark-mode .save-button,
.dark-mode .toggle-button,
.dark-mode .shift-button,
.dark-mode .form-buttons button[type="submit"] {
  background-color: #4682b4;
  color: white;
}

.generate-btn:hover,
.save-button:hover,
.toggle-button:hover,
.form-buttons button[type="submit"]:hover {
  background-color: #2980b9;
}

.dark-mode .generate-btn:hover,
.dark-mode .save-button:hover,
.dark-mode .toggle-button:hover,
.dark-mode .form-buttons button[type="submit"]:hover {
  background-color: #5a9bd4;
}

.shift-button {
  padding: 16px 15px;
  align-self: center;
}

.shift-button:hover {
  background-color: #45a049;
}

.start-shift {
  background-color: #5cb85c;
}

.dark-mode .start-shift {
  background-color: #4a904a;
}

.start-shift:hover {
  background-color: #449d44;
}

.dark-mode .start-shift:hover {
  background-color: #5cb85c;
}

.stop-shift {
  background-color: #e74c3c;
}

.dark-mode .stop-shift {
  background-color: #b3392e;
}

.stop-shift:hover {
  background-color: #c0392b;
}

.dark-mode .stop-shift:hover {
  background-color: #e74c3c;
}

.form-buttons {
  margin-top: 15px;
  display: flex;
  gap: 10px;
}

.form-buttons button[type="button"],
.cancel-button {
  padding: 8px 16px;
  background-color: #e74c3c;
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 500;
  width: 150px;
  transition: background-color 0.3s;
}

.dark-mode .form-buttons button[type="button"],
.dark-mode .cancel-button {
  background-color: #b3392e;
}

.form-buttons button[type="button"]:hover,
.cancel-button:hover {
  background-color: #c0392b;
}

.dark-mode .form-buttons button[type="button"]:hover,
.dark-mode .cancel-button:hover {
  background-color: #e74c3c;
}

#add-boat-form,
#add-user-form {
  display: none;
}

/* Buttons */
.remove-link {
  padding: 6px 12px;
  color: #e74c3c;
  text-decoration: none;
  font-weight: bold;
  display: inline-block;
}

.dark-mode .remove-link {
  color: #ff6666;
}

.remove-link:hover {
  text-decoration: underline;
}

.edit-button, .delete-button {
  padding: 6px;
  background-color: #3498db;
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-weight: bold;
  font-size: 16px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.3s;
}

.dark-mode .edit-button {
  background-color: #4682b4;
}

.edit-button:hover {
  background-color: #2980b9;
}

.dark-mode .edit-button:hover {
  background-color: #5a9bd4;
}

.edit-button:disabled {
  background-color: #ccc;
  color: #666;
  cursor: not-allowed;
}

.dark-mode .edit-button:disabled {
  background-color: #555;
  color: #999;
}

.add-button {
  padding: 6px;
  background-color: #5cb85c;
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-weight: bold;
  font-size: 16px;
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.3s;
}

.dark-mode .add-button {
  background-color: #4a904a;
}

.add-button:hover {
  background-color: #449d44;
}

.dark-mode .add-button:hover {
  background-color: #5cb85c;
}

.action-cell .edit-button,
.action-cell .add-button {
  margin-right: 5px;
}

/* Dashboard/Admin Specific Styles */
.log-hours-section,
.daily-summary-section,
.boat-section,
.user-section,
.clock-in-section {
  margin-bottom: 30px;
}

.log-hours-section {
  text-align: center;
}

.vessel-selection,
.groups-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.shift-status,
.start-time-display {
  margin: 10px 0;
  font-size: 14px;
  color: #555;
  text-align: center;
  transition: color 0.3s;
}

.dark-mode .shift-status,
.dark-mode .start-time-display {
  color: #bdc3c7;
}

.timer-display {
  margin: 10px 0;
  font-size: 30px;
  font-weight: bold;
  color: #333;
  text-align: center;
  transition: color 0.3s;
}

.dark-mode .timer-display {
  color: #d3d3d3;
}

.boat-list,
.user-list {
  margin-top: 20px;
}

.group-checkbox {
  margin-right: 10px;
  display: inline-block;
}

.groups-section h4 {
  margin-bottom: 10px;
}

.color-box {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 1px solid #999;
  vertical-align: middle;
}

.dark-mode .color-box {
  border-color: #ccc;
}

/* Table Styles */
.overview-header {
  text-align: center;
  font-size: 20px;
  margin: 20px 0;
  color: #2c3e50;
  transition: color 0.3s;
}

.dark-mode .overview-header {
  color: #ecf0f1;
}

.worklog-table,
.admin-table,
.crew-table {
  border-collapse: collapse;
  width: 100%;
  font-size: 14px;
  background-color: #fff;
  transition: background-color 0.3s;
}

.dark-mode .overview-table,
.dark-mode .worklog-table,
.dark-mode .admin-table,
.dark-mode .crew-table {
  background-color: #2c3e50;
}

.overview-table th,
.overview-table td,
.worklog-table th,
.worklog-table td,
.admin-table th,
.admin-table td,
.crew-table th,
.crew-table td {
  border: 1px solid #ddd;
  text-align: left;
  padding: 8px;
  /* word-wrap: break-word; */
  transition: border-color 0.3s;
}

.dark-mode .overview-table th,
.dark-mode .overview-table td,
.dark-mode .worklog-table th,
.dark-mode .worklog-table td,
.dark-mode .admin-table th,
.dark-mode .admin-table td,
.dark-mode .crew-table th,
.dark-mode .crew-table td {
  border-color: #555;
}

.overview-table th,
.worklog-table th,
.admin-table th,
.crew-table th {
  background-color: #ecf0f1;
  font-weight: 500;
  color: #2c3e50;
}

.dark-mode .overview-table th,
.dark-mode .worklog-table th,
.dark-mode .admin-table th,
.dark-mode .crew-table th {
  background-color: #34495e;
  color: #ecf0f1;
}

.hour-working {
  background-color: #fff;
}

.dark-mode .hour-working {
  background-color: #2c3e50;
}

.hour-resting {
  background-color: #f2f8f3;
}

.dark-mode .hour-resting {
  background-color: #3a4e63;
}

.infraction {
  background-color: #fff;
  font-weight: bold;
}

.overview-table .hour-box.worked {
  background-color: inherit;
}

.overview-table .hour-box.multi-vessel {
  background-color: #ccc;
}

.dark-mode .overview-table .hour-box.multi-vessel {
  background-color: #666;
}

.overview-table .rest-col,
.overview-table {
  text-align: center;
}

.action-cell {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 5px;
  padding: 8px;
  position: relative;
}

.action-cell .remove-link {
  color: #e74c3c;
  text-decoration: none;
  font-weight: bold;
}

.dark-mode .action-cell .remove-link {
  color: #ff6666;
}

.action-cell .remove-link:hover {
  text-decoration: underline;
}

.action-cell .separator {
  color: #555;
}

.dark-mode .action-cell .separator {
  color: #bdc3c7;
}

/* Worklog Entry */
.worklog-entry {
  position: relative;
  border: 1px solid #ddd;
  padding: 15px;
  margin-bottom: 15px;
  background-color: #fafafa;
  border-radius: 4px;
  transition: background-color 0.3s, border-color 0.3s;
}

.dark-mode .worklog-entry {
  background-color: #34495e;
  border-color: #555;
}

/* Crew Shift Section */
.crew-shift-container {
  background-color: #fff;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  transition: background-color 0.3s;
}

.dark-mode .crew-shift-container {
  background-color: #34495e;
}

.vessel-header {
  font-size: 16px;
  color: #3498db;
  margin-top: 15px;
  margin-bottom: 10px;
  font-weight: 600;
  transition: color 0.3s;
}

.dark-mode .vessel-header {
  color: #66b3ff;
}

.crew-table .low-rest {
  color: #e74c3c;
  font-weight: bold;
}

.dark-mode .crew-table .low-rest {
  color: #ff6666;
}

.crew-table tbody tr:hover {
  background-color: #f5f5f5;
}

.dark-mode .crew-table tbody tr:hover {
  background-color: #3a4e63;
}

.crew-name {
  cursor: pointer;
  text-decoration: underline;
}

/* Modal Styles */
.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: #fefefe;
  margin: 15% auto;
  padding: 20px;
  border: 1px solid #888;
  width: 80%;
  max-width: 600px;
  border-radius: 8px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  transition: background-color 0.3s, color 0.3s;
}

.dark-mode .modal-content {
  background-color: #34495e;
  color: #d3d3d3;
  border-color: #555;
}

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

.dark-mode .modal-close {
  color: #ccc;
}

.modal-close:hover,
.modal-close:focus {
  color: #000;
}

.dark-mode .modal-close:hover,
.dark-mode .modal-close:focus {
  color: #fff;
}

.modal-content h3 {
  font-size: 20px;
  color: #2c3e50;
  margin-bottom: 20px;
  transition: color 0.3s;
}

.dark-mode .modal-content h3 {
  color: #ecf0f1;
}

.modal .edit-row {
  background-color: #fafafa;
}

.dark-mode .modal .edit-row {
  background-color: #3a4e63;
}

/* Spinner */
#spinner {
  display: none;
  margin-top: 20px;
  text-align: center;
}

.spinner {
  border: 4px solid #f3f3f3;
  border-top: 4px solid #3498db;
  border-radius: 50%;
  width: 30px;
  height: 30px;
  animation: spin 1s linear infinite;
  margin: 20px auto;
}

.dark-mode .spinner {
  border: 4px solid #465c71;
  border-top: 4px solid #66b3ff;
}

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

/* Select2 Styles */
.select2-container {
  width: 100% !important;
}

/* Ensure native select elements (boat-select) have dark mode styles */
.dark-mode .boat-select {
  background-color: #2c3e50; /* Match other input fields in dark mode */
  color: #fff !important; /* White text with !important */
  border-color: #555; /* Consistent border color */
}

/* Ensure options in native select elements are styled for dark mode */
.dark-mode .boat-select option {
  background-color: #2c3e50; /* Dark background for dropdown options */
  color: #fff !important; /* White text with !important */
}

/* Select2 container styles */
.select2-container--default .select2-selection--single,
.select2-container--default .select2-selection--multiple {
  background-color: #fff; /* Light mode background */
  border: 1px solid #ddd;
  border-radius: 4px;
  color: #333; /* Dark text for light mode */
  line-height: normal !important; /* Override Select2's 28px */
}

/* Dark mode for Select2 container */
.dark-mode .select2-container--default .select2-selection--single,
.dark-mode .select2-container--default .select2-selection--multiple {
  background-color: #2c3e50; /* Match input fields */
  border-color: #555;
  color: #fff !important; /* White text with !important */
  line-height: normal !important; /* Override Select2's 28px */
}

/* Selected item text */
.select2-container--default .select2-selection__rendered {
  color: #333; /* Dark text for light mode */
  padding: 8px;
  line-height: normal !important; /* Override Select2's 28px */
}

/* Dark mode for selected item text */
.dark-mode .select2-container--default .select2-selection__rendered {
  color: #fff !important; /* White text with !important */
  line-height: normal !important; /* Override Select2's 28px */
}

/* Placeholder text */
.select2-container--default .select2-selection__placeholder {
  color: #666; /* Gray placeholder in light mode */
}

/* Dark mode placeholder */
.dark-mode .select2-container--default .select2-selection__placeholder {
  color: #ccc !important; /* Light gray placeholder with !important */
}

/* Dropdown background */
.select2-container--default .select2-dropdown {
  background-color: #fff; /* Light mode dropdown */
  border: 1px solid #ddd;
}

/* Dark mode dropdown background */
.dark-mode .select2-container--default .select2-dropdown {
  background-color: #2c3e50; /* Dark dropdown background */
  border-color: #555;
}

/* Dropdown options */
.select2-container--default .select2-results__option {
  background-color: #fff; /* Light mode option background */
  color: #333; /* Dark text for light mode */
  line-height: normal !important; /* Override Select2's 28px */
}

/* Dark mode dropdown options */
.dark-mode .select2-container--default .select2-results__option {
  background-color: #2c3e50; /* Option background */
  color: #fff !important; /* White text with !important */
  line-height: normal !important; /* Override Select2's 28px */
}

/* Highlighted option */
.select2-container--default .select2-results__option--highlighted {
  background-color: #5897fb; /* Select2 default highlight color */
  color: #fff !important; /* White text with !important */
  line-height: normal !important; /* Override Select2's 28px */
}

/* Dark mode highlighted option */
.dark-mode .select2-container--default .select2-results__option--highlighted {
  background-color: #4682b4; /* Slightly lighter blue for dark mode */
  color: #fff !important; /* White text with !important */
  line-height: normal !important; /* Override Select2's 28px */
}

/* Selected option in multiple select */
.select2-container--default .select2-selection__choice {
  background-color: #e0e0e0; /* Light mode selected choice */
  color: #333;
  border-color: #ccc;
  line-height: normal !important; /* Override Select2's 28px */
}

/* Dark mode selected option in multiple select */
.dark-mode .select2-container--default .select2-selection__choice {
  background-color: #34495e; /* Slightly lighter for selected items */
  color: #fff !important; /* White text with !important */
  border-color: #555;
  line-height: normal !important; /* Override Select2's 28px */
}

/* Clear button */
.select2-container--default .select2-selection__clear {
  color: #999; /* Light mode clear button */
}

/* Dark mode clear button */
.dark-mode .select2-container--default .select2-selection__clear {
  color: #ccc !important; /* Light color for the 'x' with !important */
}

/* Arrow in Select2 single select */
.select2-container--default .select2-selection__arrow b {
  border-color: #888 transparent transparent transparent; /* Light mode arrow */
}

/* Dark mode arrow */
.dark-mode .select2-container--default .select2-selection__arrow b {
  border-color: #ccc transparent transparent transparent; /* Light gray arrow in dark mode */
}

/* Search field inside Select2 multiple select */
.select2-container--default .select2-search__field {
  background-color: #fff; /* Light mode search field */
  color: #333;
  line-height: normal !important; /* Override Select2's 28px */
}

/* Dark mode search field */
.dark-mode .select2-container--default .select2-search__field {
  background-color: #2c3e50; /* Match input background */
  color: #fff !important; /* White text with !important */
  border-color: #555;
  line-height: normal !important; /* Override Select2's 28px */
}

/* Legend Styles */
.legend {
  margin-top: 20px;
  text-align: center;
  font-size: 14px;
  color: #555;
  transition: color 0.3s;
}

.dark-mode .legend {
  color: #bdc3c7;
}

.legend strong {
  font-size: 16px;
  color: #2c3e50;
  transition: color 0.3s;
}

.dark-mode .legend strong {
  color: #ecf0f1;
}

.dark-mode .login-container {
  background-color: #2c3e50;
}

.login-container .dashboard-title {
  text-align: center;
  margin-bottom: 20px;
  color: #2c3e50;
  transition: color 0.3s;
}

.dark-mode .login-container .dashboard-title {
  color: #ecf0f1;
}

.login-container .shift-button {
  width: 150px;
  padding: 10px 15px;
  background-color: #5cb85c;
}

/* About Page Styles */
.about-section {
  margin: 20px 0;
  padding: 15px;
  background: #eef;
  border-radius: 4px;
  transition: background-color 0.3s;
}

.dark-mode .about-section {
  background: #34495e;
}

.about-section h2 {
  font-size: 20px;
  color: #2c3e50;
  margin-bottom: 10px;
  transition: color 0.3s;
}

.dark-mode .about-section h2 {
  color: #ecf0f1;
}

.about-section p {
  font-size: 14px;
  line-height: 1.6;
  color: #333;
  margin-bottom: 15px;
  transition: color 0.3s;
}

.dark-mode .about-section p {
  color: #d3d3d3;
}

.about-section ul {
  list-style-type: disc;
  padding-left: 20px;
  margin-bottom: 15px;
}

.about-section li {
  font-size: 14px;
  line-height: 1.6;
  color: #333;
  margin-bottom: 8px;
  transition: color 0.3s;
}

.dark-mode .about-section li {
  color: #d3d3d3;
}

.about-section li strong {
  color: #2c3e50;
  transition: color 0.3s;
}

.dark-mode .about-section li strong {
  color: #ecf0f1;
}

/* Report Summary Enhancements */
.report-summary {
  background-color: #eef;
  border-radius: 4px;
  padding: 10px;
  margin-bottom: 40px;
  border: 1px solid #ddd;
  transition: background-color 0.3s, border-color 0.3s;
}

.dark-mode .report-summary {
  background-color: #34495e;
  border-color: #555;
}

.report-summary h3 {
  font-size: 22px;
  margin-bottom: 15px;
  color: #2c3e50;
  transition: color 0.3s;
}

.dark-mode .report-summary h3 {
  color: #ecf0f1;
}

.summary-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.summary-list li {
  font-size: 16px;
  margin-bottom: 10px;
  color: #333;
  transition: color 0.3s;
}

.dark-mode .summary-list li {
  color: #d3d3d3;
}

.summary-list li strong {
  color: #2c3e50;
  transition: color 0.3s;
}

.dark-mode .summary-list li strong {
  color: #ecf0f1;
}

/* Crew Overview Enhancements */
.crew-overview {
  background-color: #fafafa;
  border-radius: 4px;
  margin-bottom: 40px;
  margin-top: 20px;
  padding: 10px;
  /* border: 1px solid #ddd; 
  transition: background-color 0.3s, border-color 0.3s; */
}

.dark-mode .crew-overview {
  background-color: #34495e;
  border-color: #555;
}

.crew-overview h4 {
  font-size: 20px;
  margin-bottom: 15px;
  color: #2c3e50;
  transition: color 0.3s;
}

.dark-mode .crew-overview h4 {
  color: #ecf0f1;
}

.crew-details {
  list-style: none;
  padding: 0;
  margin: 0 0 20px 0;
}

.crew-details li {
  font-size: 14px;
  margin-bottom: 10px;
  color: #333;
  transition: color 0.3s;
}

.dark-mode .crew-details li {
  color: #d3d3d3;
}

.crew-details li strong {
  color: #2c3e50;
  display: inline-block;
  margin-bottom: 5px;
  transition: color 0.3s;
}

.dark-mode .crew-details li strong {
  color: #ecf0f1;
}

.vessel-list {
  list-style: none;
  padding: 0;
  margin: 0 0 0 20px;
  margin-top: 5px;
  margin-bottom: 15px;
}

.vessel-list li {
  font-size: 14px;
  margin-bottom: 8px;
  color: #555;
  transition: color 0.3s;
}

.dark-mode .vessel-list li {
  color: #bdc3c7;
}

.vessel-color {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 1px solid #999;
  vertical-align: middle;
  margin-right: 8px;
}

.dark-mode .vessel-color {
  border-color: #ccc;
}

/* Error Message */
.error-message {
  color: #e74c3c;
  font-weight: bold;
  margin: 10px 0;
}

.dark-mode .error-message {
  color: #ff6666;
}

/* Footer */
footer {
  text-align: center;
  padding: 20px;
  background-color: #fff;
  box-shadow: 0 -2px 5px rgba(0, 0, 0, 0.1);
  position: relative;
  bottom: 0;
  width: 100%;
  max-width: 1200px;
  margin: 20px auto 0;
  border-radius: 8px;
  transition: background-color 0.3s;
}

.dark-mode footer {
  background-color: #2c3e50;
  box-shadow: 0 -2px 5px rgba(0, 0, 0, 0.3);
}

footer p {
  color: #7f8c8d;
  font-size: 14px;
  transition: color 0.3s;
}

.dark-mode footer p {
  color: #bdc3c7;
}

/* Responsive Design */

/* --- NEW MEDIA QUERY FOR NAVIGATION BREAKPOINT --- */
@media (max-width: 1024px) {
  .main-nav {
    flex-wrap: wrap; /* Allow items to wrap */
  }

  .hamburger {
    display: block; /* Show hamburger below 1024px */
  }

  .nav-list {
    display: none; /* Hide nav list below 1024px by default */
    flex-direction: column; /* Stack items vertically */
    width: 100%;
    position: absolute;
    top: 50px; /* Adjust based on your header height */
    left: 0;
    white-space: nowrap;
    background-color: #fff;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    z-index: 999;
    transition: background-color 0.3s;
  }

  .dark-mode .nav-list {
    background-color: #2c3e50;
  }

  .nav-list.active {
    display: flex; /* Show nav list when active */
  }

  .nav-item {
    margin: 0; /* Remove horizontal margin */
    width: 100%;
    text-align: center;
  }

  .nav-link {
    display: block; /* Make links block level for full width */
    padding: 15px;
    border-bottom: 1px solid #ddd;
  }

  .dark-mode .nav-link {
    border-bottom: 1px solid #555;
  }

  .nav-right {
    order: 2; /* Push nav-right below nav-list when wrapped */
  }

  .dark-mode-btn {
    order: 3; /* Push dark mode button below nav-list when wrapped */
  }
}
/* --- END NEW MEDIA QUERY --- */


/* Existing Media Query for smaller screens (768px and below) */
@media (max-width: 768px) {
  body {
    padding: 10px;
  }

  }
  /* Causing issues with the table layout in Dashboard.php
  .worklog-table tbody td:nth-child(4),
    th:nth-child(4) {
    display: none;
  }
  */
  .monthly-overview-container,
  .crew-dashboard,
  .admin-section,
  .container {
    padding: 10px;
  }

  .container {
    flex-direction: column;
  }

  .left-section,
  .right-section {
    flex: none;
    width: 100%;
    padding: 0;
    border-left: none;
  }

  .right-section {
    margin-top: 20px;
  }

  .overview-title,
  .dashboard-title,
  .admin-title,
  .crew-shift-title {
    font-size: 20px;
  }

  .overview-form,
  .worklog-form,
  .edit-worklog-form,
  .boat-form,
  .user-form,
  .toggle-form {
    flex-direction: column;
    align-items: stretch;
    padding: 10px;
  }

  .boat-select,
  .month-input,
  .worklog-form input[type="datetime-local"],
  .edit-worklog-form input[type="datetime-local"],
  .toggle-form input[type="text"],
  .toggle-form input[type="date"],
  .toggle-form input[type="password"],
  .toggle-form select {
    font-size: 16px;
  }

  .generate-btn,
  .save-button,
  .toggle-button,
  .shift-button,
  .form-buttons button {
    padding: 20px;
  }

  .shift-button {
    align-self: center;
  }

  .worklog-table,
  .admin-table,
  .crew-table {
    font-size: 12px;
  }

  .overview-table th,
  .overview-table td,
  .worklog-table th,
  .worklog-table td,
  .admin-table th,
  .admin-table td,
  .crew-table th,
  .crew-table td {
    padding: 6px;
  }


  .action-cell {
    flex-direction: row;
    justify-content: flex-start;
    gap: 5px;
  }

  .group-checkbox {
    display: block;
    margin-bottom: 10px;
  }

  .login-container {
    max-width: 420px;
    margin: 20px auto;
    padding: 15px;
  }

  .login-container .shift-button {
    width: 100%;
  }

  .about-section {
    padding: 10px;
  }

  .about-section h2 {
    font-size: 18px;
  }

  .about-section p,
  .about-section li {
    font-size: 13px;
  }

  .modal-content {
    width: 90%;
    margin: 20% auto;
    padding: 15px;
  }

  .modal-content h3 {
    font-size: 18px;
  }

  .select2-container .select2-selection--single,
  .select2-container .select2-selection--multiple {
    font-size: 16px;
  }

  /* Keep these user-info/dark-mode-btn adjustments at 768px */
  .user-info {
    padding: 8px;
    font-size: 14px;
  }

  .dark-mode-btn {
    padding: 8px;
  }

  .log-hours-section {
    text-align: center;
  }

  .shift-status,
  .start-time-display,
  .timer-display {
    text-align: center;
  }

  .username-column {
    display: none; /* Hide username on mobile */
  }
  
@media (min-width: 1025px) {
  .page-title { display: none; }
}

@media (min-width: 769px) {
  .day-row {
    cursor: pointer;
  }

  .day-row:hover {
    background-color: #f5f5f5;
  }

  .dark-mode .day-row:hover {
    background-color: #3a4e63;
  }

  .day-link {
    display: inline;
  }
}

.changelog h3 {
  margin-top: 20px;
  font-size: 1.2em;
  color: #333;
  transition: color 0.3s;
}

.dark-mode .changelog h3 {
  color: #ecf0f1;
}

.changelog ul {
  margin: 5px 0 15px 20px;
  padding-left: 0;
  list-style-type: disc;
}

.changelog li {
  margin-bottom: 5px;
}

.changelog code {
  background-color: #f5f5f5;
  padding: 2px 4px;
  border-radius: 3px;
  transition: background-color 0.3s;
}

.dark-mode .changelog code {
  background-color: #465c71;
}

/* Vessel Select Field */
.boat-select {
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 20px;
  width: 100%;
  box-sizing: border-box;
  background-color: #fff;
  color: #333;
  transition: background-color 0.3s, color 0.3s, border-color 0.3s;
}

.boat-select option {
  font-size: 20px;
}

.dark-mode .boat-select {
  background-color: #2c3e50;
  color: #fff !important; /* White text with !important */
  border-color: #555;
}

.dark-mode .boat-select option {
  background-color: #2c3e50;
  color: #fff !important; /* White text with !important */
}

/* Shift Status with Vessel Name */
.shift-status {
  margin: 10px 0;
  font-size: 14px;
  color: #555;
  text-align: center;
  transition: color 0.3s;
}

.shift-status-vessel {
  font-size: 18px;
}

.shift-status-vessel .vessel-name {
  font-size: 16px;
  font-weight: bold;
  color: #2c3e50;
  transition: color 0.3s;
}

.dark-mode .shift-status {
  color: #bdc3c7;
}

.dark-mode .shift-status-vessel .vessel-name {
  color: #ecf0f1;
}

.forgot-password {
  margin-top: 10px;
  text-align: center;
}

.forgot-password a {
  color: #007bff; /* Blue link color, adjust as needed */
  text-decoration: none;
}

.forgot-password a:hover {
  text-decoration: underline;
}

.action-cell a .fa-trash {
  color: #ff5e00;
}

.action-cell a:hover .fa-trash {
  color: #cc0000;
}

.action-cell a .fa-pen {
  color: #0077ff;
}

.action-cell a:hover .fa-pen {
  color: #0000cc;
}

/* Action Icon */
.action-icon {
  color: #5cb85c; /* Matches .start-shift color */
  font-size: 16px;
  text-decoration: none;
  padding: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: color 0.3s;
}

.action-icon:hover {
  color: #449d44; /* Matches .start-shift:hover */
}

.dark-mode .action-icon {
  color: #4a904a; /* Matches .dark-mode .start-shift */
}

.dark-mode .action-icon:hover {
  color: #5cb85c; /* Matches .dark-mode .start-shift:hover */
}

/* Edit Email Form */
.edit-email-form {
  display: none;
  margin: 0;
}

.edit-email-form input[type="email"] {
  font-size: 14px;
  height: 30px;
}

/* Expired Link Styles */
.expired-link {
  color: #e74c3c; /* Matches .error-message */
  font-weight: bold;
  position: relative;
}

.dark-mode .expired-link {
  color: #ff6666; /* Matches .dark-mode .error-message */
}

.expired-icon {
  color: #e74c3c;
  margin-left: 5px;
  font-size: 14px;
  vertical-align: middle;
}

.dark-mode .expired-icon {
  color: #ff6666;
}

.user-dropdown {
  position: relative;
}

.user-info {
  display: flex;
  align-items: center;
  cursor: pointer;
}

.user-name {
  margin-right: 5px;
  white-space: nowrap;
}

.dropdown-menu {
  display: none;
  position: absolute;
  right: 0;
  top: 100%;
  background-color: #444;
  list-style: none;
  padding: 10px;
  margin: 0;
  border-radius: 4px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  min-width: 100%;
  box-sizing: border-box;
}

.dropdown-menu.active {
  display: block;
}

.dropdown-email {
  color: #ccc;
  font-size: 14px;
}

.dropdown-separator {
  border: 0;
  border-top: 1px solid #666;
  margin: 5px 0;
}

.dropdown-link {
  color: #fff;
  text-decoration: none;
  display: block;
  padding: 5px 0;
}

.dropdown-link:hover {
  text-decoration: underline;
}

/* Styles from dashboard.php */
.toggle-view {
  font-size: 0.8em;
  text-decoration: none;
  margin-left: 5px;
}

.error-message {
  color: red;
  margin-bottom: 10px;
}

.shift-status {
  margin-bottom: 15px;
}

.timer-display {
  margin-bottom: 20px;
}

.shift-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

.shift-button {
  margin-bottom: 30px;
}

.description-textarea {
  width: 100%;
  margin-top: 5px;
}

.worklog-entry {
  position: relative;
  margin-bottom: 15px;
}

.worklog-details {
  width: 100%;
}

.edit-worklog-form {
  width: 100%;
}

.edit-worklog-form label,
.edit-worklog-form input,
.edit-worklog-form textarea {
  display: block;
  width: 100%;
  margin-bottom: 5px;
}

.delete-button {
  top: 0;
  right: 0;
  color: red;
  border: none;
  background: none;
  cursor: pointer;
  font-size: 16px;
}

/* Styles from monthly_overview.php */
.hour-box.worked {
  background-color: #e0e0e0; /* Default worked color if no vessel-specific color */
}


.infraction {
  background-color: #d14f4f;
  color: #fff;
}

.severe-infraction {
  background-color: #d14f4f; /* Bright red */
  color: #ffffff; /* White text for contrast */
}

.multi-vessel {
  background-image: linear-gradient(45deg, #e0e0e0 25%, #b0b0b0 25%, #b0b0b0 50%, #e0e0e0 50%, #e0e0e0 75%, #b0b0b0 75%);
}

.scroll-link {
  color: #007bff;
  text-decoration: none;
  font-size: 14px;
}

.scroll-link:hover {
  text-decoration: underline;
}


.bookmark-list li {
  margin: 5px 0;
}

.password-container {
  position: relative;
  width: 100%;
}
.password-container input[type="password"],
.password-container input[type="text"] {
  width: 100%;
  padding-right: 40px; /* Space for the eye icon */
  box-sizing: border-box;
}
.toggle-password {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  cursor: pointer;
  color: #888;
}
.toggle-password:hover {
  color: #000;
}

/* --- CORRECTED TOOLTIP STYLES --- */
.tooltip-container {
  position: relative;
  display: inline-block;
  cursor: help;
  border-bottom: 1px dotted var(--text-color-secondary);
}

.tooltip-container .tooltip-text {
  visibility: hidden;
  width: 220px;
  background-color: #333;
  color: #fff;
  text-align: center;
  border-radius: 6px;
  padding: 8px;
  position: absolute;
  z-index: 1050; /* High z-index to appear over nav */
  top: 100%; /* Position below the element */
  left: 50%;
  margin-left: -110px; /* Center the tooltip */
  margin-top: 8px; /* Add space between element and tooltip */
  opacity: 0;
  transition: opacity 0.3s, visibility 0.3s;
  font-size: 0.9rem;
  font-weight: normal;
}

.tooltip-container .tooltip-text::after {
  content: "";
  position: absolute;
  bottom: 100%; /* Position arrow at the top of the tooltip */
  left: 50%;
  margin-left: -5px;
  border-width: 5px;
  border-style: solid;
  border-color: transparent transparent #333 transparent; /* Point arrow upwards */
}

.tooltip-container:hover .tooltip-text,
.tooltip-container:focus .tooltip-text {
  visibility: visible;
  opacity: 1;
}

body.dark-mode .tooltip-container .tooltip-text {
  background-color: #f0f0f0;
  color: #333;
}

body.dark-mode .tooltip-container .tooltip-text::after {
  border-bottom-color: #f0f0f0; /* Match dark mode tooltip background */
}