/* Recharge Button Control Styles */

.vv-recharge-control {
  position: fixed !important;
  top: 10px;
  right: 10px;
  margin: 0 !important;
  z-index: 1;
  transition: all 0.3s ease;
  border-radius: 16px !important;
  overflow: hidden;
}

/* Desktop and larger tablets - top right */
@media (min-width: 768px) {
  .vv-recharge-control {
    top: 10px;
    right: 10px;
  }
}

/* When search bar gets wider and would collide, move button below */
@media (max-width: 767px) {
  .vv-recharge-control {
    top: 80px; /* Below search bar (44px height + 10px margin + 26px gap) */
    right: 10px;
  }
}

/* Even smaller screens */
@media (max-width: 480px) {
  .vv-recharge-control {
    top: 80px;
    right: 10px;
  }
}

.vv-recharge-button {
  min-width: 60px;
  min-height: 60px;
  width: clamp(50px, 8vw, 70px); /* Responsive sizing */
  height: clamp(50px, 8vw, 70px);
  border: 2px solid #e0e0e0;
  background: white;
  color: #333;
  cursor: pointer;
  border-radius: 16px !important;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: all 0.2s ease;
  box-sizing: border-box;
  overflow: hidden;
}

/* Override any MapLibre button group styles */
.vv-recharge-control button {
  border-radius: 16px !important;
}

.vv-recharge-control button:first-child {
  border-radius: 16px !important;
}

.vv-recharge-control button:last-child {
  border-radius: 16px !important;
}

.vv-recharge-button svg {
  display: block;
  width: 60%;
  height: 60%;
  margin: auto;
  transition: transform 0.2s ease;
  flex-shrink: 0;
}

/* Desktop - bigger than search bar (46px) */
@media (min-width: 768px) {
  .vv-recharge-button {
    min-width: 52px;
    min-height: 52px;
    width: clamp(50px, 5vw, 64px);
    height: clamp(50px, 5vw, 64px);
  }
}

/* Large desktop - even bigger */
@media (min-width: 1200px) {
  .vv-recharge-button {
    min-width: 58px;
    min-height: 58px;
    width: clamp(54px, 4.5vw, 72px);
    height: clamp(54px, 4.5vw, 72px);
  }
}

/* Small mobile */
@media (max-width: 480px) {
  .vv-recharge-button {
    min-width: 54px;
    min-height: 54px;
    width: clamp(50px, 10vw, 60px);
    height: clamp(50px, 10vw, 60px);
  }
}

/* Active state when layer is visible (blue button with white icon) */
.vv-recharge-button.active {
  background: #2563EB;
  border-color: #2563EB;
  color: white;
}

.vv-recharge-button.active svg {
  transform: scale(1.05);
}

/* Hover effects - ONLY for devices that support hover (desktop) */
@media (hover: hover) and (pointer: fine) {
  /* Hover when NOT active (layer hidden) - icon turns blue */
  .vv-recharge-button:hover {
    background: white;
    border-color: #2563EB;
    color: #2563EB;
    transform: translateY(-1px);
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.15);
  }

  .vv-recharge-button:active {
    background: #f0f0f0;
    transform: translateY(0);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
  }

  /* Hover on active button - icon turns black, background turns white */
  .vv-recharge-button.active:hover {
    background: white;
    border-color: #2563EB;
    color: #333;
    transform: translateY(-1px);
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.15);
  }
}

/* Focus styles for accessibility */
.vv-recharge-button:focus {
  outline: 2px solid #2563EB;
  outline-offset: 2px;
}

.vv-recharge-button:focus:not(:focus-visible) {
  outline: none;
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
  .vv-recharge-button {
    background: #2a2a2a;
    border-color: #444;
    color: #f0f0f0;
  }
  
  .vv-recharge-button.active {
    background: #2563EB;
    border-color: #2563EB;
    color: white;
  }
}

/* Dark mode hover effects - ONLY for devices with hover support */
@media (prefers-color-scheme: dark) and (hover: hover) and (pointer: fine) {
  .vv-recharge-button:hover {
    background: #2a2a2a;
    border-color: #2563EB;
    color: #64b5f6; /* Lighter blue for dark mode */
  }
  
  .vv-recharge-button.active:hover {
    background: #2a2a2a;
    border-color: #2563EB;
    color: #f0f0f0; /* Light color instead of black for dark mode */
  }
}

/* High contrast mode */
@media (prefers-contrast: high) {
  .vv-recharge-button {
    border-width: 3px;
  }
}

