/* favoriteLocations.css - SD Auto Professional Styling */

/* Grid Container */
#locations-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 24px;
  padding: 24px 0;
}

/* Location Card */
.location-square {
  background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
  border: 2px solid rgba(0, 102, 204, 0.1);
  border-radius: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 15px;
  font-weight: 600;
  min-height: 160px;
  padding: 24px 16px;
  box-shadow: 
    0 4px 6px -1px rgba(0, 102, 204, 0.05),
    0 10px 15px -3px rgba(0, 102, 204, 0.08);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  color: #1e293b;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.location-square::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #0066cc, #06b6d4);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.location-square:hover {
  transform: translateY(-6px) scale(1.02);
  border-color: rgba(0, 102, 204, 0.2);
  box-shadow: 
    0 10px 15px -3px rgba(0, 102, 204, 0.1),
    0 20px 25px -5px rgba(0, 102, 204, 0.1),
    0 25px 50px -12px rgba(0, 102, 204, 0.15);
}

.location-square:hover::before {
  opacity: 1;
}

/* Location icon */
.location-square::after {
  content: '📍';
  font-size: 32px;
  margin-bottom: 12px;
  display: block;
  transition: transform 0.3s ease;
}

.location-square:hover::after {
  transform: scale(1.1);
}

/* Dark mode location card */
.dark .location-square {
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
  border-color: rgba(148, 163, 184, 0.1);
  color: #e2e8f0;
}

.dark .location-square:hover {
  border-color: rgba(96, 165, 250, 0.3);
  box-shadow: 
    0 10px 15px -3px rgba(96, 165, 250, 0.1),
    0 20px 25px -5px rgba(96, 165, 250, 0.1);
}

/* Popup Overlay */
.popup {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Popup Content */
.popup-content {
  background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
  border-radius: 24px;
  padding: 32px;
  width: 100%;
  max-width: 400px;
  text-align: center;
  position: relative;
  box-shadow: 
    0 25px 50px -12px rgba(0, 0, 0, 0.25),
    0 0 0 1px rgba(0, 102, 204, 0.08);
  color: #1e293b;
  animation: scaleIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes scaleIn {
  from { 
    opacity: 0; 
    transform: scale(0.95) translateY(10px); 
  }
  to { 
    opacity: 1; 
    transform: scale(1) translateY(0); 
  }
}

.dark .popup-content {
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
  color: #e2e8f0;
  box-shadow: 
    0 25px 50px -12px rgba(0, 0, 0, 0.5),
    0 0 0 1px rgba(148, 163, 184, 0.1);
}

.popup-content h2 {
  margin-bottom: 16px;
  font-size: 24px;
  font-weight: 700;
  background: linear-gradient(135deg, #0066cc 0%, #06b6d4 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.popup-content p {
  margin: 12px 0 24px;
  color: #64748b;
  font-size: 15px;
  line-height: 1.6;
}

.dark .popup-content p {
  color: #94a3b8;
}

/* Popup Input */
.popup-content input {
  width: 100%;
  padding: 14px 18px;
  margin: 8px 0;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  font-size: 15px;
  font-family: inherit;
  background-color: #f8fafc;
  color: #1e293b;
  transition: all 0.3s ease;
}

.popup-content input:focus {
  outline: none;
  border-color: #0066cc;
  background-color: #ffffff;
  box-shadow: 0 0 0 4px rgba(0, 102, 204, 0.1);
}

.dark .popup-content input {
  background-color: #0f172a;
  border-color: #334155;
  color: #e2e8f0;
}

.dark .popup-content input:focus {
  border-color: #60a5fa;
  background-color: #1e293b;
  box-shadow: 0 0 0 4px rgba(96, 165, 250, 0.15);
}

/* Close Button */
.popup-content .popup-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  background: #f1f5f9;
  border: none;
  border-radius: 10px;
  font-size: 18px;
  cursor: pointer;
  color: #64748b;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.popup-content .popup-close:hover {
  background: #e2e8f0;
  color: #1e293b;
}

.dark .popup-content .popup-close {
  background: #334155;
  color: #94a3b8;
}

.dark .popup-content .popup-close:hover {
  background: #475569;
  color: #e2e8f0;
}

/* Button Group */
.popup-content .button-group {
  display: flex;
  gap: 12px;
  margin-top: 24px;
}

/* Delete/Cancel Buttons */
.popup-content .popup-delete,
.popup-content .popup-cancel {
  flex: 1;
  padding: 14px 24px;
  background: #f1f5f9;
  color: #64748b;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  cursor: pointer;
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  transition: all 0.3s ease;
}

.popup-content .popup-delete:hover,
.popup-content .popup-cancel:hover {
  background: #e2e8f0;
  color: #1e293b;
  border-color: #cbd5e1;
}

.dark .popup-content .popup-delete,
.dark .popup-content .popup-cancel {
  background: #334155;
  border-color: #475569;
  color: #94a3b8;
}

.dark .popup-content .popup-delete:hover,
.dark .popup-content .popup-cancel:hover {
  background: #475569;
  color: #e2e8f0;
}

/* Submit/Edit Buttons */
.popup-content .popup-submit,
.popup-content .popup-edit {
  flex: 1;
  padding: 14px 24px;
  background: linear-gradient(135deg, #0066cc 0%, #0052a3 100%);
  color: white;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.popup-content .popup-submit::before,
.popup-content .popup-edit::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transition: left 0.5s ease;
}

.popup-content .popup-submit:hover,
.popup-content .popup-edit:hover {
  background: linear-gradient(135deg, #0052a3 0%, #004080 100%);
  transform: translateY(-2px);
  box-shadow: 0 10px 20px -5px rgba(0, 102, 204, 0.4);
}

.popup-content .popup-submit:hover::before,
.popup-content .popup-edit:hover::before {
  left: 100%;
}

/* Add New Location Button */
.new-location-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 32px auto 16px;
  padding: 16px 32px;
  font-size: 16px;
  font-weight: 600;
  font-family: inherit;
  color: white;
  background: linear-gradient(135deg, #0066cc 0%, #0052a3 100%);
  border: none;
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  box-shadow: 
    0 4px 6px -1px rgba(0, 102, 204, 0.2),
    0 10px 15px -3px rgba(0, 102, 204, 0.15);
}

.new-location-button::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transition: left 0.5s ease;
}

.new-location-button:hover {
  background: linear-gradient(135deg, #0052a3 0%, #004080 100%);
  transform: translateY(-3px);
  box-shadow: 
    0 10px 15px -3px rgba(0, 102, 204, 0.3),
    0 20px 25px -5px rgba(0, 102, 204, 0.2);
}

.new-location-button:hover::before {
  left: 100%;
}

.new-location-button:active {
  transform: translateY(-1px);
}

/* Responsive Design */
@media (max-width: 768px) {
  #locations-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 16px;
    padding: 16px 0;
  }

  .location-square {
    min-height: 140px;
    padding: 20px 12px;
    font-size: 14px;
  }

  .popup-content {
    padding: 24px;
    margin: 16px;
  }

  .popup-content h2 {
    font-size: 20px;
  }

  .popup-content .button-group {
    flex-direction: column;
  }

  .new-location-button {
    padding: 14px 28px;
    font-size: 15px;
  }
}