/*Write your custom css in this file.*/

/* Base styles for all devices */
/* Map container */
#map {
  height: 85vh;
  width: 100%;
}

/* Distance display */
.total-distance {
  position: absolute;
  top: 10px;
  right: 55px;
  z-index: 5;
  background: white;
  padding: 12px 12px;
  border-radius: 6px;
  font-weight: bold;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

/* Circular menu */
#circle-menu {
  position: absolute;
  z-index: 999;
  transition: opacity 0.2s ease, transform 0.2s ease;
  opacity: 0;
  pointer-events: none;
}
#circle-menu.active {
  opacity: 1;
  pointer-events: auto;
  transform: scale(1);
}

.circle-menu .menu-items {
  list-style: none;
  padding: 0;
  margin: 0;
  width: 100%;
  height: 100%;
  position: relative;
}

.circle-menu .menu-item {
  position: absolute;
  top: 0;
  left: 0;
  transform: translate(0, 0);
  opacity: 0;
  transition: transform 0.4s ease, opacity 0.4s ease;
}

.circle-menu.active .menu-item:nth-child(1) {
  transform: translate(60px, 0);
  opacity: 1;
  transition-delay: 0.05s;
}

.circle-menu.active .menu-item:nth-child(2) {
  transform: translate(42px, 42px);
  opacity: 1;
  transition-delay: 0.1s;
}

.circle-menu.active .menu-item:nth-child(3) {
  transform: translate(0, 60px);
  opacity: 1;
  transition-delay: 0.15s;
}

.menu-button {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: white;
  border: none;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s ease;
}

.menu-button:hover {
  background: #8a3cc8;
  transform: scale(1.1);
}

/* Cable Info Panel */
#cable-info-panel {
  display: none;			
  position: absolute;
  top: 60px;
  right: 20px;
  background: #fff;
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  width: 300px;
  font-family: 'Segoe UI', sans-serif;
  z-index: 1000;
}

#cable-info-panel h3 {
  margin-bottom: 12px;
  font-size: 18px;
}

#cable-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

#cable-form input {
  padding: 8px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 14px;
}

#cable-form input[readonly] {
  background-color: #f9f9f9;
  cursor: not-allowed;
}

.form-actions {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 10px;
}

.form-actions button {
  flex: 1;
  padding: 8px;
  border: none;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
}

.form-actions button[type="submit"] {
  background: #28a745;
  color: #fff;
}

.form-actions .cancel-btn {
  background: #dc3545;
  color: #fff;
}
	
#cable_color {
  width: 100%;
  height: 40px;
  padding: 3px;
  border: 1px solid #ccc;
  border-radius: 6px;
  cursor: pointer;
}

#cable-info-panel textarea {
  width: 100%;
  padding: 8px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 14px;
  min-height: 60px;
  resize: vertical;
  margin-bottom: 10px;
  font-family: 'Segoe UI', sans-serif;
}	

/* Mini popup */
#cable-mini-popup.uisp-popup {
  position: absolute;
  bottom: 25px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  background: #fff;
  border: 1px solid #ccc;
  border-radius: 6px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
  font-size: 13px;
  font-family: 'Segoe UI', sans-serif;
  display: none;
  padding: 12px 16px;
  max-width: 95%;
  white-space: nowrap;
  overflow: hidden;
}

.uisp-popup-inner {
  display: flex;
  gap: 12px;
}

.uisp-popup-inner span {
  color: #333;
}

/* Evenly spaced fan shape */
.circle-menu.active .menu-item:nth-child(1) {
  transform: translate(-74px, -30px); /* ~60° up */
  opacity: 1;
  transition-delay: 0.05s;
}

.circle-menu.active .menu-item:nth-child(2) {
  transform: translate(-19px, -41px); /* ~30° up */
  opacity: 1;
  transition-delay: 0.1s;
}

.circle-menu.active .menu-item:nth-child(3) {
  transform: translate(35px, -25px); /* 0° right */
  opacity: 1;
  transition-delay: 0.15s;
}	
	
.splitter-circle-menu {
  position: absolute;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  transform: scale(0);
  transition: transform 0.3s ease;
}

.splitter-circle-menu.active {
  transform: scale(1);
}

.splitter-circle-menu .menu-items {
  position: absolute;
  list-style: none;
  padding: 15px;
  margin: 0;
}

.splitter-circle-menu .menu-item {
  position: absolute;
  transition: all 0.3s ease;
}

.splitter-circle-menu.active .menu-item:nth-child(1) {
  top: -50px;
  left: 50%;
  transform: translateX(-50%);
}

.splitter-circle-menu.active .menu-item:nth-child(2) {
  top: 50%;
  left: -50px;
  transform: translateY(-50%);
}

.splitter-circle-menu.active .menu-item:nth-child(3) {
  top: 50%;
  left: 150%;
  transform: translateY(-50%);
}	


.splitter-popup-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.4);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

.splitter-popup {
  background: #fff;
  padding: 20px;
  border-radius: 8px;
  width: 360px;
  max-width: 90%;
  box-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.popup-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.popup-close {
  cursor: pointer;
  font-size: 24px;
}

.form-group, .form-row {
  margin-bottom: 12px;
}

.form-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* Splitter Modal Styles */
#splitterModal {
  background-color: rgba(0, 0, 0, 0.5);
}

#splitterModal .modal-dialog {
  max-width: 320px;
}

#splitterModal .modal-content {
  background-color: #2b2d31;
  border-radius: 8px;
  color: white;
  border: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

#splitterModal .modal-header {
  border-bottom: 1px solid #444;
  padding: 12px 15px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

#splitterModal .modal-title {
  margin: 0;
  font-size: 1.1em;
  font-weight: 500;
}

#splitterModal .close {
  color: #ccc;
  background: none;
  border: none;
  font-size: 1.4em;
  padding: 0 0 4px 8px;
  transition: color 0.2s;
}

#splitterModal .close:hover {
  color: white;
}

#splitterModal #splitter-form {
  padding: 15px;
}

/* Form Group Styles */
#splitterModal .form-group {
  margin-bottom: 12px;
  position: relative;
}

/* Input and Select Styles */
#splitterModal .form-control {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #444;
  border-radius: 4px;
  background-color: #3a3d40;
  color: white;
  font-size: 0.95em;
  transition: border-color 0.2s;
}

#splitterModal .form-control:focus {
  outline: none;
  border-color: #007bff;
}

/* Select Dropdown Styles */
#splitterModal select.form-control {
  appearance: none;
  padding-right: 30px;
}

#splitterModal .select-arrow {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: #888;
  pointer-events: none;
}

/* Coordinates Input Group */
#splitterModal .coordinates-group {
  display: flex;
}

#splitterModal #splitter_coordinates {
  flex: 1;
  border-radius: 4px 0 0 4px;
}

#splitterModal #get-current-location {
  padding: 0 12px;
  border: 1px solid #444;
  border-left: none;
  border-radius: 0 4px 4px 0;
  background-color: #3a3d40;
  color: #ccc;
  cursor: pointer;
  transition: all 0.2s;
}

#splitterModal #get-current-location:hover {
  background-color: #444;
  color: white;
}

/* Button Styles */
#splitterModal .form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 10px;
}

#splitterModal .btn {
  padding: 6px 12px;
  border: none;
  border-radius: 4px;
  font-size: 0.9em;
  cursor: pointer;
  transition: background-color 0.2s;
}

#splitterModal .btn-cancel {
  background-color: #4a4d50;
  color: white;
}

#splitterModal .btn-cancel:hover {
  background-color: #5d6064;
}

#splitterModal .btn-submit {
  background-color: #007bff;
  color: white;
}

#splitterModal .btn-submit:hover {
  background-color: #0069d9;
}

/* Placeholder Text */
#splitterModal ::placeholder {
  color: #888;
  opacity: 1;
}

/* Map Control Buttons */
.gmap-control-button {
  margin: 10px;
  padding: 8px 16px;
  background-color: #4285F4;
  color: white;
  border: none;
  border-radius: 4px;
  font-family: 'Roboto', Arial, sans-serif;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
  transition: background-color 0.3s, box-shadow 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.gmap-control-button:hover {
  background-color: #3367D6;
  box-shadow: 0 3px 8px rgba(0,0,0,0.4);
}

.gmap-control-button:active {
  background-color: #2A56C6;
}

.gmap-control-button i {
  font-size: 16px;
}

/* Search Form  */
#search_bar {
  font-family: 'Inter', sans-serif;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  background-color: #f0f2f5; /* Light gray background */
}

/* Custom styles for the menu bar - now on right side */
.map-menu-bar {
  position: absolute;
  top: 10px;
  left: 10px; /* Changed from right: 10px */
  background: white;
  padding: 5px;
  border-radius: 12px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: row;
  gap: 8px;
  z-index: 1000;
}
    
.map-menu-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  cursor: pointer;
  color: #6b7280;
  transition: all 0.2s;
  position: relative;
}
    
.map-menu-btn:hover {
  background: #f3f4f6;
  color: #4b5563;
}
    
.map-menu-btn.person {
  color: #facc15;
}
    
.map-menu-btn.active {
  background: #e5e7eb;
}
    
/* Layers dropdown menu */
.layers-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  background: white;
  border-radius: 8px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  padding: 8px;
  width: 150px;
  display: none;
  z-index: 1001;
}
    
.layers-dropdown.show {
  display: block;
}
    
.layer-option {
  padding: 8px;
  cursor: pointer;
  border-radius: 4px;
  display: flex;
  align-items: center;
  gap: 8px;
}
    
.layer-option:hover {
  background: #f3f4f6;
}
    
.layer-option.active {
  background: #e5e7eb;
  font-weight: 500;
}

/* Mobile Responsive Styles */
@media (max-width: 768px) {
  /* Adjust map height for mobile */
  #map {
    height: 82vh;
  }
  
  /* Make distance display more compact */
  .total-distance {
    padding: 8px 10px;
    font-size: 14px;
    right: 55px;
    top: 87px;
  }
  
  /* Adjust circular menu for mobile */
  .menu-button {
    width: 36px;
    height: 36px;
  }
  
  /* Make cable info panel full width on mobile */
  #cable-info-panel {
    width: calc(100% - 40px);
    right: 10px;
    left: 20px;
    top: auto;
    bottom: 75px;
    max-height: 80vh;
    overflow-y: auto;
  }
  
  /* Adjust mini popup for mobile */
  #cable-mini-popup.uisp-popup {
    max-width: 90%;
    white-space: normal;
    padding: 10px;
    bottom: 75px;
  }
  
  /* Adjust splitter popup for mobile */
  .splitter-popup {
    width: calc(100% - 40px);
    padding: 15px;
  }
  
  /* Stack form actions on mobile */
  .form-actions {
    flex-direction: column;
  }
  
  .form-actions button {
    width: 100%;
  }
  
  /* Adjust menu bar for mobile */
  .map-menu-bar {
    top: auto;
    bottom: 75px;
    left: 50%;
    transform: translateX(-50%);
    flex-wrap: wrap;
    justify-content: center;
    max-width: 90%;
  }
  
  /* Adjust layers dropdown for mobile */
  .layers-dropdown {
    top: auto;
    bottom: 245%;
    right: auto;
    left: 50%;
    transform: translateX(-50%);
    width: 130px;
  }
  
  /* Adjust circular menu positions for mobile */
  .circle-menu.active .menu-item:nth-child(1) {
    transform: translate(-60px, -20px);
  }
  
  .circle-menu.active .menu-item:nth-child(2) {
    transform: translate(-15px, -35px);
  }
  
  .circle-menu.active .menu-item:nth-child(3) {
    transform: translate(30px, -15px);
  }
  
  /* Make modal full width on very small screens */
  @media (max-width: 400px) {
    #splitterModal .modal-dialog {
      width: 95%;
      margin: 10px auto;
    }
  }
}

/* Tablet Responsive Styles */
@media (min-width: 769px) and (max-width: 1024px) {
  /* Adjust cable info panel width */
  #cable-info-panel {
    width: 280px;
  }
  
  /* Adjust menu button sizes */
  .menu-button {
    width: 38px;
    height: 38px;
  }
  
  /* Adjust circular menu positions */
  .circle-menu.active .menu-item:nth-child(1) {
    transform: translate(-65px, -25px);
  }
  
  .circle-menu.active .menu-item:nth-child(2) {
    transform: translate(-20px, -40px);
  }
  
  .circle-menu.active .menu-item:nth-child(3) {
    transform: translate(32px, -20px);
  }
}