:root {
  --primary-color: #04a3e3; /* Green */
  --secondary-color: #fa339c; /* Yellow */
  --background-color: #edf0f8; /* Light gray */
  --button-color: #04a3e3; /* Button base color (same as primary) */
  --button-hover-color: #037db8; /* Darker shade of primary for hover */
  --button-text-color: #ffffff; /* White text for buttons */
  --logout-button-color: red;
  --logout-button-hover-color: darkred;
  --light-gray-border-color: lightgray;
}

body {
  background-color: var(--background-color);
  overflow-x: hidden; /* Prevent scrolling */
}

.container {
  padding: 16px 0px 16px 0px;
}

/* API Keys Container - Unified white background */
.api-keys-container {
  background-color: white;
  margin: 8px 16px 8px 16px;
  padding: 16px;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  border: 1px solid var(--light-gray-border-color);
}

/* API Key Input Styles */
.api-key-group {
  margin: 0 0 16px 0;
}

.api-key-group:last-child {
  margin-bottom: 0;
}

.api-key-group label {
  display: block;
  margin-bottom: 8px;
  color: #333;
  font-weight: 600;
  font-size: 14px;
}

.api-key-group input[type="password"] {
  width: 100%;
  padding: 12px 16px;
  font-size: 14px;
  border: 2px solid #e1e5e9;
  border-radius: 8px;
  box-sizing: border-box;
  transition: all 0.3s ease;
  background-color: #f8f9fa;
  color: #333;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.api-key-group input[type="password"]:focus {
  border-color: var(--primary-color);
  outline: none;
  background-color: white;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
  transform: translateY(-1px);
}

.api-key-group input[type="password"]:hover {
  border-color: #c1c7cd;
  background-color: white;
}

textarea {
  width: calc(100% - 32px); /* Subtract left and right margins */
  padding: 16px;
  margin: 8px 16px 8px 16px;
  font-size: 16px; /* Font size */
  box-sizing: border-box;
  max-width: 100%;
  resize: none;
  border-radius: 8px; /* Rounded corners for a modern look */
  border-color: var(--light-gray-border-color);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1); /* Subtle shadow for depth */
}

textarea:focus {
  border-color: var(--primary-color); /* Change border color on focus */
  outline: none; /* Remove default browser outline */
}

/* Style for the icon */
.logout-icon {
  margin-right: 8px; /* Space between icon and text */
}

button {
  width: calc(100% - 32px); /* Subtract left and right margins */
  padding: 12px; /* Slightly increased padding for better spacing */
  font-size: 16px; /* Font size */
  margin: 0px 16px 0px 16px;
  display: flex;
  justify-content: center;
  box-sizing: border-box; /* Ensures padding doesn't affect width */
  background-color: var(--primary-color); /* Primary color as background */
  color: var(--button-text-color); /* Text color (e.g., white) */
  border: none; /* Remove default borders */
  border-radius: 8px; /* Rounded corners for a modern look */
  cursor: pointer; /* Pointer cursor on hover */
  font-weight: 700; /* Bold text for emphasis */
  transition: all 0.3s ease; /* Smooth transition for hover effects */
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1); /* Subtle shadow for depth */
}

#loginButton {
  display: block;
}

p {
  margin-left: 24px;
}
/* Hover effect */
button:hover {
  background-color: var(--button-hover-color); /* Darker shade on hover */
  transform: translateY(-1px); /* Slight upward movement */
  box-shadow: 0 6px 8px rgba(0, 0, 0, 0.15); /* Increased shadow for hover */
}

/* Active state (when clicked) */
button:active {
  transform: translateY(0); /* Reset position */
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1); /* Return to normal shadow */
}

button span {
  font-size: 18px; /* Slightly larger chevron */
  transition: transform 0.3s ease; /* Smooth rotation effect */
}

.logoutForm {
  display: flex;
  width: 100%;
  justify-content: flex-end;
}

.logoutButton {
  border: solid 1px;
  border-color: var(--light-gray-border-color);
  color: var(--logout-button-color);
  background-color: var(--button-text-color);
  padding: 10px;
  cursor: pointer;
}

.logoutButton:hover {
  background-color: var(--logout-button-color); /* Darker shade on hover */
  color: var(--button-text-color);
}

#apiHeader,
#blobHeader,
#addressHeader {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: var(--button-text-color);
  color: var(--primary-color);
  margin-top: 16px;
  border: solid 1px;
  border-color: lightgray;
}

#apiHeader {
  margin-top: 0;
}

#addressInput {
  margin-top: 0;
}

/* Removed to fix button group consistency
#blobSubmit,
#addressSubmit {
  margin-bottom: 16px;
}
*/

.hidden {
  display: none;
}

#map {
  flex-grow: 1; /* Take up remaining space */
  height: calc(100vh - 200px); /* Subtract header and container heights */
  width: calc(100% - 32px); /* Match button width */
  max-width: 100%;
  margin: 20px 16px 0 16px; /* Match button margins */
  display: none;
  padding: 0;
}
/* Styles for the loading spinner */
.spinner-container {
  z-index: 1000; /* Ensure it appears on top */
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7); /* Semi-transparent background */
  justify-content: center;
  align-items: center;
}
.spinner {
  border: 8px solid #f3f3f3; /* Light gray background */
  border-top: 8px solid #3498db; /* Blue "spinning" part */
  border-radius: 50%;
  width: 60px;
  height: 60px;
  animation: spin 1s linear infinite; /* Spin animation */
}
@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

.error-message {
  color: var(--logout-button-color);
  margin-top: 10px;
}

/* Button group styling */
.button-group {
  display: flex;
  gap: 12px;
  margin: 0 16px 16px 16px;
}

.button-group button {
  flex: 1;
  margin: 0;
}

/* Clear button styling */
.clear-button {
  background-color: #6c757d !important;
  color: white !important;
}

.clear-button:hover {
  background-color: #5a6268 !important;
}

/* Disabled button styling */
button:disabled {
  background-color: #e9ecef !important;
  color: #6c757d !important;
  cursor: not-allowed !important;
  opacity: 0.6;
  transform: none !important;
  box-shadow: none !important;
}

button:disabled:hover {
  background-color: #e9ecef !important;
  color: #6c757d !important;
  transform: none !important;
  box-shadow: none !important;
}

/* Clear map button container */
#clearMapContainer {
  margin: 16px;
  text-align: center;
}

#clearMapButton {
  width: auto;
  padding: 8px 16px;
  margin: 0;
  background-color: #dc3545;
  color: white;
  font-size: 14px;
}

#clearMapButton:hover {
  background-color: #c82333;
}
