/* index.css */

/* Base Styles */
html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow: hidden; /* Previene barras de desplazamiento no deseadas en el cuerpo */
  font-family: sans-serif;
}

/* Employees Container */
#empleados-container {
  position: fixed; /* Asegura que se superponsa */
  top: 60px;
  left: 0; /* Ocupa todo el ancho cuando está activo */
  right: 0;
  bottom: 0;
  background-color: #fff;
  z-index: 10000;
  padding: 20px;
  box-sizing: border-box;
  overflow-y: auto;
  text-align: center;
  display: none; /* Oculto por defecto */
}

/* Floating Capsule Top Bar */
#top-bar {
    position: fixed;
    top: 15px;
    left: 50%;
    transform: translateX(-50%);
    width: auto;
    height: 48px;
    background-color: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-radius: 24px;
    display: none; /* Initially hidden, JS shows it */
    align-items: center;
    justify-content: center;
    gap: 20px;
    padding: 0 25px;
    z-index: 10003;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

#parcel-info-display {
    color: #1E3529; /* Dark color for readability */
    font-weight: bold;
}

#reset-view-button {
  background-color: transparent;
  color: #1E3529;
  border: 1px solid #1E3529;
  border-radius: 20px;
  padding: 6px 15px;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.3s ease;
  flex-shrink: 0;
}
#reset-view-button:hover {
    background-color: rgba(30, 53, 41, 0.1);
}


/* Left Sidebar Banner */
#left-banner {
  position: fixed;
  top: 0;
  left: 0;
  width: 75px;
  height: 100%;
  background-color: #1E3529; /* Updated color */
  box-shadow: 2px 0 5px rgba(0,0,0,0.1);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 10px;
  transition: width 0.3s ease;
}

#left-banner:hover {
  width: 275px;
}

#left-banner .logo-container {
  background-color: #ffffff;
  border-radius: 50%;
  padding: 5px;
  margin-top: 5px;
  margin-bottom: 15px;
  width: 45px;
  height: 45px;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-shrink: 0;
  transition: all 0.3s ease;
}
#left-banner .logo-container img {
  height: 30px;
  width: auto;
  transition: all 0.3s ease;
}

#left-banner:hover .logo-container {
  width: 50px;
  height: 50px;
}

#left-banner:hover .logo-container img {
  height: 40px;
}


/* Sidebar Buttons */
#left-banner button,
#left-banner .widget-button {
  background-color: transparent;
  border: none;
  border-radius: 8px;
  box-shadow: none;
  cursor: pointer;
  color: #ffffff;
  width: 100%;
  height: 48px;
  display: flex;
  justify-content: flex-start; /* Changed for smooth transition */
  align-items: center;
  margin-top: 10px;
  padding: 0 25px; /* Center icon in 75px collapsed view */
  transition: all 0.3s ease;
  flex-shrink: 0;
  box-sizing: border-box;
}

#left-banner button svg,
#left-banner .widget-button svg {
  flex-shrink: 0;
}

#left-banner:hover button,
#left-banner:hover .widget-button {
    padding: 0 12px; /* Adjust padding for expanded view */
}

#left-banner button:hover,
#left-banner .widget-button:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: #a7c957; /* Highlight color */
}

#left-banner button:disabled {
    background-color: #e9ecef;
    border-color: #adb5bd;
    color: #6c757d;
    cursor: not-allowed;
    box-shadow: none;
}

.button-text {
  color: white;
  font-size: 16px;
  font-weight: 500;
  opacity: 0;
  white-space: nowrap;
  pointer-events: none;
  /* Fix: Collapse the text element when sidebar is not hovered */
  margin-left: 0;
  max-width: 0;
  overflow: hidden;
  transition: opacity 0.2s ease, max-width 0.2s ease, margin-left 0.2s ease;
}

#left-banner:hover .button-text {
  opacity: 1;
  /* Fix: Expand the text element on hover */
  max-width: 150px;
  margin-left: 16px;
}

/* Map Container */
#map {
  position: absolute;
  top: 0;
  left: 75px;
  right: 0;
  bottom: 0;
  z-index: 1;
  transition: left 0.3s ease;
}

/* Base styles for floating banners */
#fields-banner,
#notes-banner,
#layers-banner,
#visit-history-banner {
    position: fixed;
    top: 80px;
    right: 15px;
    width: 350px;
    max-width: 90%;
    height: calc(100% - 95px);
    background-color: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 10002;
    padding: 20px;
    overflow-y: auto;
    border-radius: 15px;
    transition: transform 0.3s ease, opacity 0.3s ease;
    display: none;
    box-sizing: border-box;
}


#activity-form-banner {
    position: fixed;
    top: 80px;
    right: 15px;
    width: 450px;
    max-width: 90%;
    height: calc(100% - 95px);
    background-color: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 10004;
    border-radius: 15px;
    display: none;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.activity-form-wrapper {
  display: flex;
  flex-direction: column;
  height: 100%;
}

#note-form-banner {
    position: fixed;
    top: auto;
    bottom: 20px;
    height: auto;
    max-height: 80vh;
    left: 95px;
    right: auto;
    width: 350px;
    border-radius: 15px;
    border: 1px solid #ddd;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    transform: translateX(0);
    transition: transform 0.3s ease, left 0.3s ease, right 0.3s ease;
    z-index: 10002;
    padding: 20px;
    background: white;
    display: none;
    /* FIX: Layout handled by child elements now */
    display: none;
    flex-direction: column;
}

#note-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex-grow: 1;
    min-height: 0;
}

#note-details {
    flex-grow: 1;
    min-height: 0;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding-right: 8px; /* For scrollbar */
}

body:has(#left-banner:hover) #note-form-banner {
    left: 295px;
}

#report-form-banner {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 350px;
    max-width: 90%;
    background-color: white;
    border: 1px solid #ccc;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    z-index: 10005;
    display: none;
}

#report-form-banner span#close-report-banner {
    position: absolute;
    top: 5px;
    right: 10px;
    cursor: pointer;
    font-weight: bold;
    font-size: 18px;
    color: #555;
}

body:has(#left-banner:hover) #fieldInfoCard {
  left: 295px !important;
}

#mobile-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 56px;
  background-color: #1E3529; /* Updated background color */
  box-shadow: 0 -2px 5px rgba(0,0,0,0.1);
  justify-content: space-around;
  align-items: center;
  z-index: 10005;
}

.mobile-nav-button {
  background: transparent;
  border: none;
  color: #ffffff;
  cursor: pointer;
  flex: 1;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: color 0.2s ease;
}

.mobile-nav-button.active {
    color: #a7c957; /* Accent color for active button */
}

.mobile-nav-button:hover {
  color: #a7c957;
}

.notes-list {
  margin-top: 15px;
}

.add-note-button {
  position: absolute;
  bottom: 10px;
  right: 10px;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background-color: #4CAF50;
  color: white;
  font-size: 30px;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 8px rgba(0,0,0,0.2);
  display: flex;
  justify-content: center;
  align-items: center;
}

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

#field-list {
  list-style: none;
  color: #007bff;
  padding: 0;
  margin-top: 15px;
  max-height: calc(100vh - 150px);
  overflow-y: auto;
}

#layers-list .layer-item {
  background-color: #f9f9f9;
  border: 1px solid #ddd;
  border-radius: 5px;
  padding: 10px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.layer-item:hover {
  background-color: #e9e9e9;
}

#layers-list .layer-item.active {
    background-color: #e0f7fa;
    border-color: #00bcd4;
    font-weight: bold;
}

.legend {
  background: white;
  padding: 10px;
  border-radius: 8px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.2);
  line-height: 1.5em;
  font-size: 14px;
  z-index: 1000;
  transition: right 0.3s ease;
}

.legend h4 {
  margin-top: 0;
  margin-bottom: 10px;
  text-align: center;
}

.legend-scale .legend-item {
  display: flex;
  align-items: center;
  margin-bottom: 5px;
}

.legend-scale i {
  width: 20px;
  height: 20px;
  margin-right: 8px;
  border: 1px solid #ccc;
}

.year-group, .month-group {
    margin-bottom: 5px;
    border-radius: 5px;
    overflow: hidden;
}

.year-header, .month-header {
    background-color: #f0f0f0;
    padding: 8px 10px;
    cursor: pointer;
    font-weight: bold;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #e0e0e0;
}

.year-header .toggle-arrow, .month-header .toggle-arrow {
    transition: transform 0.2s ease-in-out;
}

.year-group.expanded > .year-header .toggle-arrow,
.month-group.expanded > .month-header .toggle-arrow {
    transform: rotate(90deg);
}

.year-content, .month-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}

.year-group.expanded > .year-content,
.month-group.expanded > .month-content {
    max-height: 3000px;
}

#activity-form-banner .activity-date-inputs {
    display: flex;
    gap: 5px;
    margin-bottom: 10px;
}

#activity-form-banner .activity-date-inputs input {
    width: 33%;
    padding: 5px;
}

#activity-form-banner .activity-form-group select {
    width: 100%;
    padding: 5px;
    font-size: 16px;
}

#activity-form-banner .activity-extra-fields {
    margin-top: 10px;
}

#activity-form-banner .dosis-group,
#activity-form-banner .siembra-inputs,
#activity-form-banner .recoleccion-inputs,
#activity-form-banner .riego-inputs {
    display: flex;
    gap: 10px;
    justify-content: space-between;
    margin-top: 5px;
}

#activity-form-banner .dosis-group .dosis-title {
    text-align: center;
    font-weight: 600;
    margin-bottom: 5px;
}

#activity-form-banner .dosis-inputs select,
#activity-form-banner .dosis-inputs input,
#activity-form-banner .siembra-inputs input,
#activity-form-banner .siembra-inputs select,
#activity-form-banner .recoleccion-inputs input,
#activity-form-banner .recoleccion-inputs select {
    width: 50%;
    padding: 5px;
}

#activity-form-banner .siembra-inputs input { width: 60%; }
#activity-form-banner .siembra-inputs select { width: 40%; }
#activity-form-banner .recoleccion-inputs input { width: 60%; }
#activity-form-banner .recoleccion-inputs select { width: 40%; }
#activity-form-banner .riego-inputs input { width: 60%; }
#activity-form-banner .riego-inputs select { width: 40%; }

#activity-form-banner .activity-buttons {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-top: 15px;
}

#activity-form-banner .activity-buttons button {
    flex: 1;
    padding: 10px 15px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    border: none;
    transition: background-color 0.2s ease;
}

#activity-form-banner #save-activity {
    background-color: #007bff;
    color: white;
}
#activity-form-banner #save-activity:hover {
    background-color: #0056b3;
}

#activity-form-banner #cancel-activity {
    background-color: #dc3545;
    color: white;
}
#activity-form-banner #cancel-activity:hover {
    background-color: #c82333;
}

/* Visit Tracker Styles */
#visit-tracker-container {
  display: block; /* Always visible */
  position: fixed;
  top: 80px;
  right: 15px;
  z-index: 10003;
}

#visit-tracker-btn {
  width: 48px;
  height: 48px;
  background-color: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-radius: 50%;
  border: none;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
}
#visit-tracker-btn.active {
  background-color: #a7c957; /* Accent color */
  color: white;
}

#visit-tracker-menu {
  display: none;
  position: absolute;
  top: 55px;
  right: 0;
  background-color: white;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  width: 200px;
  overflow: hidden;
}

#visit-tracker-menu button {
  display: block;
  width: 100%;
  padding: 12px 15px;
  border: none;
  background-color: transparent;
  text-align: left;
  cursor: pointer;
}
#visit-tracker-menu button:hover {
  background-color: #f0f0f0;
}
#visit-history-banner h3 {
  margin-top: 0;
}
/* FIX: Style only buttons that are NOT the close button */
#visit-history-banner button:not(.close-banner-btn) {
  width: 100%;
  padding: 10px;
  margin-bottom: 10px;
  border-radius: 8px;
  border: 1px solid #173c2d;
  background-color: #173c2d;
  color: white;
  cursor: pointer;
}
#visit-history-list .visit-item {
  padding: 10px;
  border-bottom: 1px solid #eee;
  cursor: pointer;
}
#visit-history-list .visit-item:hover {
  background-color: #f9f9f9;
}


@media (max-width: 768px) {
  #left-banner {
    display: none !important;
  }
  #top-bar {
    /* Adjust for mobile if needed, e.g., width */
    width: 95%;
  }
  #mobile-nav {
    display: flex;
  }
  #map {
    top: 0 !important;
    left: 0 !important;
    bottom: 56px !important;
    right: 0 !important;
  }
  #fields-banner,
  #notes-banner,
  #layers-banner,
  #note-form-banner,
  #fieldInfoCard,
  #activity-form-banner,
  #visit-history-banner {
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    border-radius: 0 !important;
    box-shadow: 0 -2px 5px rgba(0,0,0,0.1);
  }
  #fields-banner, #notes-banner, #layers-banner, #activity-form-banner {
    top: 0;
    height: calc(100% - 56px);
    bottom: 56px;
  }
  #visit-history-banner {
    top: 80px;
    height: auto;
    bottom: 56px;
  }
  #note-form-banner {
    top: auto !important;
    bottom: 56px !important;
    max-height: 50vh !important;
    border-top-left-radius: 15px !important;
    border-top-right-radius: 15px !important;
    border-bottom-left-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
  }
  #fieldInfoCard {
    bottom: 56px !important;
    left: 10px !important;
    right: 10px !important;
    width: auto !important;
    border-radius: 15px 15px 0 0 !important;
  }
   #use-current-location-btn {
    display: block !important;
  }
}

#use-current-location-btn {
  display: none;
}

#allNotesHistoryModal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10006;
}

#allNotesHistoryModal .modal-content {
  background-color: #fff;
  padding: 20px;
  border-radius: 10px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
  position: relative;
  max-width: 900px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
}

#allNotesTable th, #allNotesTable td {
  padding: 10px;
  border: 1px solid #ddd;
  text-align: left;
}

#allNotesTable th {
  background-color: #e0e0e0;
  font-weight: bold;
}

#allNotesTable tbody tr:nth-child(even) {
  background-color: #f9f9f9;
}

#allNotesTable tbody tr:hover {
  background-color: #f1f1f1;
}

#allNotesHistoryModal .close {
  position: absolute;
  top: 10px;
  right: 20px;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
  color: #aaa;
}

#allNotesHistoryModal .close:hover,
#allNotesHistoryModal .close:focus {
  color: #333;
  text-decoration: none;
}

.field-button {
  display: block;
  width: 100%;
  padding: 10px 15px;
  margin-bottom: 8px;
  background-color: #f0f0f0;
  color: #283593;
  border: 1px solid #ccc;
  border-radius: 8px;
  text-align: left;
  font-size: 16px;
  cursor: pointer;
  transition: background-color 0.2s, border-color 0.2s;
}

.field-button:hover {
  background-color: #e0e0e0;
  border-color: #283593;
}

#field-list {
  padding: 0;
  margin: 0;
  list-style: none;
}

/* Profile Dropdown Menu */
.profile-container {
    margin-top: auto; /* Pushes this to the bottom */
    position: relative; /* Anchor for the absolute dropdown */
    width: 100%;
    margin-bottom: 10px;
}

.dropdown-menu {
  display: none;
  position: absolute;
  bottom: 0;
  left: 100%;
  margin-left: 5px;
  background-color: white;
  min-width: 180px;
  box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
  z-index: 10004;
  border-radius: 8px;
  overflow: hidden;
}

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

.dropdown-menu a {
  color: #333;
  padding: 12px 16px;
  text-decoration: none;
  display: block;
  font-size: 14px;
  text-align: left;
}

.dropdown-menu a:hover {
  background-color: #f1f1f1;
}

/* Estilos para Modales de Ciclo */
.modal {
    display: none;
    position: fixed;
    z-index: 10005;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.6);
    justify-content: center;
    align-items: center;
}
.modal-content {
    background-color: #fefefe;
    margin: auto;
    padding: 20px;
    border: 1px solid #888;
    width: 80%;
    max-width: 450px;
    border-radius: 10px;
    position: relative;
}
.modal-content .close {
    color: #aaa;
    position: absolute;
    top: 10px;
    right: 20px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}
.modal-content form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}
.modal-content label {
    font-weight: 600;
}
.modal-content input[type="text"],
.modal-content input[type="date"],
.modal-content input[type="number"],
.modal-content select {
    width: 100%;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 5px;
}
 .modal-content button {
    padding: 10px;
    border-radius: 5px;
    border: none;
    color: white;
    cursor: pointer;
    font-size: 16px;
 }
 .modal-content button[type="submit"] {
    background-color: #173c2d;
 }
 .modal-content .modal-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
 }
 .modal-content .modal-buttons .btn-yes {
    background-color: #28a745;
 }
  .modal-content .modal-buttons .btn-no {
    background-color: #dc3545;
 }
 .modal-content .modal-buttons .btn-submit {
    background-color: var(--ds-green-dark, #173c2d);
    color: white;
    transition: background-color 0.2s, opacity 0.2s;
 }
 .modal-content .modal-buttons .btn-submit:hover:not(:disabled) {
    opacity: 0.9;
 }
 .modal-content .modal-buttons .btn-submit:disabled {
    background-color: #999;
    opacity: 0.7;
    cursor: not-allowed;
 }

.btn-submit .spinner {
    display: none; /* Hidden by default */
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin-top: -10px; /* Half of height */
    margin-left: -10px; /* Half of width */
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
.btn-submit.loading .spinner {
    display: block;
}
.btn-submit.loading .btn-text {
    visibility: hidden;
}

/* Auth Loader Styles */
#auth-loader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: #f4f6f8;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 20000;
  font-family: 'Open Sans', sans-serif;
  color: #283593;
}

#auth-loader .spinner {
  border: 4px solid rgba(0, 0, 0, 0.1);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border-left-color: #283593;
  animation: spin 1s ease infinite;
  margin-bottom: 10px;
}

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

/* Hide app container by default */
#app-container {
  display: none;
  height: 100%; /* Ensure it takes up full height when visible */
}

/* Fix for the surface input and total button layout in the sowing modal */
#siembra-cycle-modal .modal-content #input-cycle-siembra-superficie {
    width: auto; /* Override the generic width: 100% */
    flex-grow: 1; /* Allow it to take up available space */
}

#use-total-area-siembra-btn {
  background-color: #173c2d; /* azul Bootstrap */
  color: #fff;               /* texto en blanco visible */
  border: 1px solid #173c2d;
  border-radius: 5px;
  padding: 5px 10px;
  cursor: pointer;
}

/* ===================================================================
   UNIFIED BANNER & CARD STYLES
   - Banners for Fields, Notes, Layers, Activities
   - Consistent form elements and cards
   =================================================================== */
:root {
  --ds-green-dark: #173c2d;
  --ds-green-accent: #a7c957;
  --ds-surface: rgba(255,255,255,0.96);
  --ds-border: #e5e7eb;
  --ds-text: #1E3529;
  --ds-item: #f8faf9;
  --ds-item-hover: #eef4ef;
  --ds-item-active: #e6f7ed;
}

/* Base Banners (Fields, Notes, Layers, Activities) */
#fields-banner, #notes-banner, #layers-banner, #activity-form-banner, #visit-history-banner {
  background: var(--ds-surface);
  border: 1px solid var(--ds-border);
  border-radius: 16px;
  box-shadow: 0 8px 22px rgba(0,0,0,0.12);
  padding: 18px 16px 20px;
  color: var(--ds-text);
  backdrop-filter: saturate(1.1) blur(3px);
}

/* Specific Banner Padding */
#fields-banner, #activity-form-banner { padding: 22px 18px 24px; }
#note-form-banner {
    background: var(--ds-surface) !important;
    border: 1px solid var(--ds-border) !important;
    border-radius: 16px !important;
    box-shadow: 0 8px 22px rgba(0,0,0,0.12) !important;
    padding: 18px 16px 20px !important;
    color: var(--ds-text) !important;
}

/* Banner Titles */
#fields-banner h3, #notes-banner h3, #layers-banner h3, #activity-form-banner h3, #activity-form-banner h2, #note-form-banner h3, #visit-history-banner h3 {
  margin: 0 0 12px;
  font-weight: 800;
  font-size: 20px;
  line-height: 1.2;
  color: var(--ds-green-dark);
  padding-bottom: 8px;
  border-bottom: 2px solid var(--ds-green-accent);
}
#fields-banner h3, #activity-form-banner h3, #activity-form-banner h2 { font-size: 22px; }

/* Unified Form Inputs (Search, Select, Textarea) */
#fields-banner input, #notes-banner input, #layers-banner input,
#notes-banner select, #layers-banner select,
#activity-form-banner select, #activity-form-banner input, #activity-form-banner textarea,
#note-form-banner select, #note-form-banner input, #note-form-banner textarea {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid #cfd8dc;
  border-radius: 12px;
  background: #fff;
  font: inherit;
  outline: none;
  transition: box-shadow .15s ease, border-color .15s ease;
}

#fields-banner input::placeholder, #notes-banner input::placeholder, #layers-banner input::placeholder {
  color: #8aa0a6;
  opacity: 1;
}

#fields-banner input:focus, #notes-banner input:focus, #layers-banner input:focus,
#notes-banner select:focus, #layers-banner select:focus,
#activity-form-banner select:focus, #activity-form-banner input:focus, #activity-form-banner textarea:focus,
#note-form-banner select:focus, #note-form-banner input:focus, #note-form-banner textarea:focus {
  border-color: var(--ds-green-accent);
  box-shadow: 0 0 0 3px rgba(167,201,87,0.28);
}

/* Note Filters Specific */
#notes-banner #notes-filters { display: flex; gap: 8px; flex-wrap: wrap; margin: 6px 0 10px; }
#notes-banner #notes-filters select { flex: 1 1 32%; min-width: 140px; }

/* List Items (Fields, Notes, Layers) */
#fields-banner .field-button,
#notes-banner .note-card,
#layers-banner .layer-item,
#visit-history-banner .visit-item {
  display: block; width: 100%;
  background: var(--ds-item);
  color: var(--ds-text);
  border: 1px solid #e1e8e8;
  border-radius: 12px;
  padding: 10px 14px; margin: 10px 0;
  text-align: left; cursor: pointer;
  transition: background-color .15s ease, border-color .15s ease, box-shadow .15s ease;
}

#fields-banner .field-button:hover,
#notes-banner .note-card:hover,
#layers-banner .layer-item:hover,
#visit-history-banner .visit-item:hover {
  background: var(--ds-item-hover);
  border-color: var(--ds-green-accent);
}

#fields-banner .field-button.active, #fields-banner .field-button:focus,
#notes-banner .note-card.active,
#layers-banner .layer-item.active {
  background: var(--ds-item-active);
  border-color: var(--ds-green-accent);
  box-shadow: inset 4px 0 0 var(--ds-green-dark);
  outline: none;
}

/* Note Card Specifics */
#notes-banner .note-card .note-header {
  font-weight: 700;
  margin-bottom: 6px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
#notes-banner .note-card .note-meta { color:#6b7b7f; font-size: 12px; }
#notes-banner .note-card img { border-radius: 10px; display:block; max-width:100%; }
#notes-banner .note-card .note-content {
  font-size: 0.9em;
  color: #555;
  white-space: pre-wrap;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* Note Photo Toggle Styles */
.note-photo-controls .toggle-photo-btn {
    background-color: #eef4ef;
    border: 1px solid #cfd8dc;
    color: var(--ds-text);
    padding: 4px 10px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 12px;
    transition: background-color .15s ease;
    display: inline-block;
}
.note-photo-controls .toggle-photo-btn:hover {
    background-color: #e1e8e8;
}
.photo-wrapper {
    position: relative;
    margin-top: 8px;
}
.photo-wrapper .close-photo-btn {
    position: absolute;
    top: 4px;
    right: 4px;
    background: rgba(0,0,0,0.5);
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    font-size: 18px;
    line-height: 24px;
    text-align: center;
    cursor: pointer;
    font-weight: bold;
    transition: background .15s ease;
}
.photo-wrapper .close-photo-btn:hover {
    background: rgba(0,0,0,0.8);
}

/* FIX: New, robust styles for Note Form buttons and Select2 */
.note-action-buttons {
    display: flex;
    gap: 12px;
}
.note-action-buttons button {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 12px;
    border: 1px solid #cfd8dc;
    border-radius: 12px;
    background: #f8faf9;
    cursor: pointer;
    transition: background-color .15s ease;
    font-size: 14px;
}
.note-action-buttons button:hover {
    background: #eef4ef;
}
.note-buttons {
    display: flex;
    gap: 12px;
    margin-top: auto;
    padding-top: 12px;
    flex-shrink: 0;
}
.note-buttons button {
    flex: 1;
    padding: 12px;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity .15s ease, background-color .15s ease;
    border: none;
    font-size: 16px;
}
.note-buttons button:hover {
    opacity: 0.9;
}
#save-note {
    background-color: #007bff;
    color: white;
}
#cancel-note {
    background-color: #dc3545;
    color: white;
}

/* FIX: Correct styles for Select2 dropdowns */
#note-form .select2-container--default .select2-selection--single {
    width: 100%;
    height: auto;
    padding: 11px 12px;
    border: 1px solid #cfd8dc;
    border-radius: 12px;
    background: #fff;
    outline: none;
    box-sizing: border-box;
}
#note-form .select2-container--default .select2-selection--single .select2-selection__rendered {
    color: var(--ds-text);
    line-height: normal;
    padding-left: 0;
}
#note-form .select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 100%;
    top: 0;
    right: 5px;
    display: flex;
    align-items: center;
}
#note-form .select2-container--default.select2-container--open .select2-selection--single {
    border-color: var(--ds-green-accent);
    box-shadow: 0 0 0 3px rgba(167,201,87,0.28);
}
.select2-dropdown {
    border: 1px solid #cfd8dc;
    border-radius: 12px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}
.select2-search--dropdown .select2-search__field {
     padding: 8px;
     border-radius: 8px;
     border: 1px solid #cfd8dc;
}

.close-banner-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: transparent;
    border: none;
    font-size: 28px;
    font-weight: 300;
    color: #999;
    cursor: pointer;
    line-height: 1;
    padding: 4px;
    transition: color 0.2s;
}
.close-banner-btn:hover {
    color: #333;
}

/* Styles for new visit tracking features */
#recenter-map-btn {
  display: none;
  position: fixed;
  bottom: 80px;
  right: 20px;
  z-index: 10003;
  width: 48px;
  height: 48px;
  background-color: rgba(255, 255, 255, 0.9);
  border: none;
  border-radius: 50%;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  justify-content: center;
  align-items: center;
  cursor: pointer;
}

@keyframes pulse {
  0% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(0, 123, 255, 0.7);
  }
  70% {
    transform: scale(1);
    box-shadow: 0 0 0 15px rgba(0, 123, 255, 0);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(0, 123, 255, 0);
  }
}

.current-location-marker-icon {
  width: 24px;
  height: 24px;
  background-color: #007bff;
  border-radius: 50%;
  border: 2px solid white;
  box-shadow: 0 2px 5px rgba(0,0,0,0.3);
  animation: pulse 2s infinite;
}

#add-similar-parcels-btn {
    display: none; /* Hidden by default, shown by JS */
    width: 100%;
    margin-top: 10px;
    padding: 8px 12px;
    background-color: #eef2f7;
    border: 1px solid #d1d9e2;
    border-radius: 8px;
    color: #334155;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    text-align: center;
    transition: background-color 0.2s ease;
}

#add-similar-parcels-btn:hover {
    background-color: #e2e8f0;
}