/* Import modern font */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
  /* Modern color palette */
  --primary-color: #E6B022;
  /* More vibrant golden yellow */
  --primary-hover: #C5961B;
  --primary-light: rgba(230, 176, 34, 0.1);
  --secondary-color: #6366f1;
  --success-color: #10b981;
  --danger-color: #ef4444;
  --warning-color: #f59e0b;

  /* Neutral colors */
  --bg-primary: #ffffff;
  --bg-secondary: #f9fafb;
  --bg-tertiary: #f3f4f6;
  --text-primary: #111827;
  --text-secondary: #6b7280;
  --text-tertiary: #9ca3af;
  --border-color: #e5e7eb;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);

  /* Spacing */
  --spacing-xs: 0.25rem;
  --spacing-sm: 0.5rem;
  --spacing-md: 1rem;
  --spacing-lg: 1.5rem;
  --spacing-xl: 1.5rem;
  --spacing-2xl: 2rem;

  /* Border radius */
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;

  /* Transitions */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 200ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 300ms cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
  position: relative;
}

/* Fixed background for better mobile support */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  background: url('assets/images/bg.jpg') no-repeat center center;
  background-size: cover;
}

/* Prevent date input overflow on mobile */
input[type="datetime-local"] {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  -webkit-appearance: none;
  appearance: none;
  display: block;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: var(--spacing-lg);
}

/* Header */
.header {
  text-align: center;
  margin-bottom: var(--spacing-2xl);
  padding: var(--spacing-xl) 0;
}

.header-logo {
  max-width: 300px;
  height: auto;
  margin-bottom: var(--spacing-lg);
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.header h1 {
  color: white;
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: var(--spacing-sm);
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.header h2 {
  color: white;
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: var(--spacing-sm);
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.header p {
  color: rgba(255, 255, 255, 0.9);
  font-size: 1.125rem;
  font-weight: 300;
}

/* Main content area */
.content {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--spacing-xl);
  margin-bottom: var(--spacing-xl);
}

@media (min-width: 768px) {
  .content {
    grid-template-columns: 400px 1fr;
  }
}

/* Card styling */
.card {
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-radius: var(--radius-xl);
  padding: var(--spacing-xl);
  box-shadow:
    0 10px 15px -3px rgba(0, 0, 0, 0.05),
    0 4px 6px -2px rgba(0, 0, 0, 0.02),
    0 20px 25px -5px rgba(0, 0, 0, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.4);
  transition: transform var(--transition-base), box-shadow var(--transition-base), background var(--transition-base);
}

.card:hover {
  transform: translateY(-4px);
  background: rgba(255, 255, 255, 0.82);
  box-shadow:
    0 20px 25px -5px rgba(0, 0, 0, 0.1),
    0 10px 10px -5px rgba(0, 0, 0, 0.04),
    0 30px 40px -10px rgba(0, 0, 0, 0.1);
}

.card h2 {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: var(--spacing-lg);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
}

.card h2::before {
  content: '';
  display: inline-block;
  width: 4px;
  height: 24px;
  background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
  border-radius: 2px;
}

/* Form styling */
.form-group {
  margin-bottom: var(--spacing-lg);
  position: relative;
}

.address-autocomplete {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: white;
  border-radius: var(--radius-md);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  max-height: 300px;
  overflow-y: auto;
  z-index: 1000;
}

.autocomplete-item {
  padding: 12px 16px;
  cursor: pointer;
  border-bottom: 1px solid var(--border-color);
  transition: background var(--transition-base);
  color: var(--text-primary);
}

.autocomplete-item:last-child {
  border-bottom: none;
}

.autocomplete-item:hover {
  background: var(--bg-tertiary);
}


.form-group label {
  display: block;
  margin-bottom: var(--spacing-sm);
  font-weight: 500;
  color: var(--text-primary);
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.025em;
}

.form-control {
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--bg-primary);
  color: var(--text-primary);
  transition: all var(--transition-base);
  font-family: inherit;
}

.form-control:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-control:hover:not(:focus) {
  border-color: var(--text-tertiary);
}

/* Strength selector */
.strength-selector {
  display: flex;
  align-items: flex-end;
  gap: var(--spacing-sm);
  height: 140px;
  padding: var(--spacing-lg);
  background: rgba(0, 0, 0, 0.03);
  border-radius: var(--radius-lg);
  margin-top: var(--spacing-sm);
  position: relative;
}

.strength-bar {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  cursor: pointer;
  height: 100%;
  position: relative;
}

.strength-bar::after {
  content: attr(data-label);
  position: absolute;
  top: -25px;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-secondary);
  opacity: 0;
  transition: all var(--transition-base);
  transform: translateY(5px);
  white-space: nowrap;
  pointer-events: none;
}

/* Show label for selected bar by default */
.strength-bar.selected::after {
  opacity: 1;
  transform: translateY(0);
}

/* When hovering the container, hide the selected label */
.strength-selector:hover .strength-bar.selected::after {
  opacity: 0;
  transform: translateY(5px);
}

/* Show the label for the specific bar being hovered */
.strength-bar:hover::after {
  opacity: 1 !important;
  transform: translateY(0) !important;
  color: var(--primary-hover);
}


.strength-bar-box {
  width: 100%;
  background: var(--border-color);
  border-radius: 6px;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05);
}

.strength-bar:hover .strength-bar-box {
  transform: scaleX(1.1);
}

/* Specific heights */
.strength-bar[data-value="1"] .strength-bar-box {
  height: 20%;
}

.strength-bar[data-value="2"] .strength-bar-box {
  height: 40%;
}

.strength-bar[data-value="3"] .strength-bar-box {
  height: 60%;
}

.strength-bar[data-value="4"] .strength-bar-box {
  height: 80%;
}

.strength-bar[data-value="5"] .strength-bar-box {
  height: 100%;
}

/* Active states with gradients */
.strength-bar.active[data-value="1"] .strength-bar-box {
  background: linear-gradient(to top, #10b981, #34d399);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.strength-bar.active[data-value="2"] .strength-bar-box {
  background: linear-gradient(to top, #84cc16, #a3e635);
  box-shadow: 0 4px 12px rgba(132, 204, 22, 0.3);
}

.strength-bar.active[data-value="3"] .strength-bar-box {
  background: linear-gradient(to top, #f59e0b, #fbbf24);
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

.strength-bar.active[data-value="4"] .strength-bar-box {
  background: linear-gradient(to top, #f97316, #fb923c);
  box-shadow: 0 4px 12px rgba(249, 115, 22, 0.3);
}

.strength-bar.active[data-value="5"] .strength-bar-box {
  background: linear-gradient(to top, #ef4444, #f87171);
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

/* Button styling */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-sm);
  padding: 0.875rem 1.5rem;
  font-size: 1rem;
  font-weight: 600;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-base);
  text-decoration: none;
  font-family: inherit;
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
  color: white;
  box-shadow: var(--shadow-md);
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 10px 20px -5px rgba(230, 176, 34, 0.4);
}

.btn-primary:active:not(:disabled) {
  transform: translateY(0);
}

.btn-secondary {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border: 2px solid var(--border-color);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--bg-secondary);
  border-color: var(--text-tertiary);
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-full {
  width: 100%;
}

/* Location buttons */
.location-buttons {
  display: flex;
  gap: var(--spacing-sm);
  margin-top: var(--spacing-sm);
}

/* Map container */
.map-container {
  height: 600px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  border: 2px solid rgba(255, 255, 255, 0.3);
}

#map {
  width: 100%;
  height: 100%;
}

/* Loading spinner */
.loading {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: white;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Alert messages */
.alert {
  padding: var(--spacing-md);
  border-radius: var(--radius-md);
  margin-top: var(--spacing-lg);
  font-size: 0.875rem;
  font-weight: 500;
  animation: slideIn var(--transition-base);
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.alert-success {
  background: #d1fae5;
  color: #065f46;
  border: 1px solid #10b981;
}

.alert-error {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #ef4444;
}

/* Map popup styling */
.mapkit-annotation-callout {
  font-family: 'Inter', sans-serif !important;
}

/* Responsive design */
@media (max-width: 767px) {
  .header-logo {
    max-width: 250px;
  }

  .header h1 {
    font-size: 1.875rem;
  }

  .header p {
    font-size: 1rem;
  }

  .card {
    padding: var(--spacing-md);
  }

  .map-container {
    height: 400px;
  }

  .location-buttons {
    flex-direction: column;
  }

  .btn {
    width: 100%;
  }
}

/* Smooth transitions for all interactive elements */
button,
input,
select,
textarea,
a {
  transition: all var(--transition-base);
}

/* Focus visible for accessibility */
*:focus-visible {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

/* Hide number input spinners */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

input[type="number"] {
  -moz-appearance: textfield;
  appearance: textfield;
}