/* Location Recommendation System - Shared Component */

/* Recommended Location Highlighting */
.ws-location-recommended {
  border: 3px solid var(--accent-color) !important;
  box-shadow: 0 8px 32px rgba(191,161,74,0.3) !important;
  position: relative;
}

.ws-location-recommended::before {
  content: '🌟 Recommended for you';
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--accent-color);
  color: var(--charcoal);
  padding: 4px 16px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  box-shadow: 0 2px 8px rgba(191,161,74,0.3);
  z-index: 10;
}

/* Location Recommendation Modal */
.ws-modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  align-items: center;
  justify-content: center;
}

.ws-modal.show {
  display: flex;
}

.ws-modal-content {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: 0 8px 32px rgba(44,38,33,0.25);
  padding: 0;
  width: 90%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
}

.ws-modal-header {
  padding: 24px 24px 16px 24px;
  border-bottom: 1px solid var(--taupe);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.ws-modal-header h3 {
  margin: 0;
  color: var(--primary-color);
  font-size: 1.4rem;
}

.ws-modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--charcoal);
  padding: 4px;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.ws-modal-close:hover {
  background: var(--taupe);
  color: var(--charcoal);
}

.ws-modal-body {
  padding: 20px 24px;
}

.ws-modal-body p {
  margin: 0 0 20px 0;
  color: var(--charcoal);
  line-height: 1.5;
}

.ws-location-consent {
  margin: 20px 0;
}

.ws-checkbox-label {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  font-size: 1rem;
  color: var(--charcoal);
}

.ws-checkbox-label input[type="checkbox"] {
  display: none;
}

.ws-checkbox-custom {
  width: 20px;
  height: 20px;
  border: 2px solid var(--primary-color);
  border-radius: 4px;
  position: relative;
  background: var(--surface);
  transition: all 0.2s ease;
}

.ws-checkbox-label input[type="checkbox"]:checked + .ws-checkbox-custom {
  background: var(--primary-color);
}

.ws-checkbox-label input[type="checkbox"]:checked + .ws-checkbox-custom::after {
  content: '✓';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: white;
  font-size: 14px;
  font-weight: bold;
}

.ws-location-status {
  margin-top: 20px;
  padding: 16px;
  background: var(--background);
  border-radius: var(--radius);
  border-left: 4px solid var(--accent-color);
}

.ws-location-status p {
  margin: 0;
  color: var(--charcoal);
  font-weight: 500;
}

.ws-modal-footer {
  padding: 16px 24px 24px 24px;
  border-top: 1px solid var(--taupe);
}

.ws-modal-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

.ws-modal-btn {
  padding: 12px 20px;
  border-radius: var(--radius);
  font-family: var(--font-secondary);
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  transition: all 0.3s ease;
  border: 2px solid transparent;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.ws-modal-btn-primary {
  background: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
}

.ws-modal-btn-primary:hover:not(:disabled) {
  background: #8a1a2e;
  border-color: #8a1a2e;
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(156,28,52,0.25);
}

.ws-modal-btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.ws-modal-btn-secondary {
  background: var(--taupe);
  color: var(--charcoal);
  border-color: var(--taupe);
}

.ws-modal-btn-secondary:hover {
  background: #a89a8a;
  border-color: #a89a8a;
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(168,154,138,0.25);
}

/* Responsive Modal Adjustments */
@media (max-width: 768px) {
  .ws-modal-content {
    width: 95%;
    max-width: none;
    margin: 20px;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
  }
  
  .ws-modal-header,
  .ws-modal-body,
  .ws-modal-footer {
    padding-left: 20px;
    padding-right: 20px;
  }
  
  .ws-modal-actions {
    flex-direction: column;
    gap: 8px;
  }
  
  .ws-modal-btn {
    width: 100%;
    justify-content: center;
    padding: 14px 20px;
    font-size: 1rem;
    min-height: 44px;
  }
  
  .ws-location-consent {
    margin: 16px 0;
  }
  
  .ws-checkbox-label {
    font-size: 0.95rem;
    line-height: 1.4;
  }
  
  .ws-location-status {
    margin-top: 16px;
    padding: 12px;
  }
}

@media (max-width: 480px) {
  .ws-modal-content {
    width: 98%;
    margin: 10px;
    max-height: calc(100vh - 20px);
    background: #ffffff; /* Ensure light content background on dark overlay */
    color: #222222;      /* Default text color for contrast */
  }
  
  .ws-modal-header,
  .ws-modal-body,
  .ws-modal-footer {
    padding-left: 16px;
    padding-right: 16px;
  }
  
  .ws-modal-header h3 {
    font-size: 1.2rem;
    color: #222222; /* Improve heading contrast on mobile */
    line-height: 1.3;
  }
  
  .ws-modal-body p {
    font-size: 0.95rem;
    line-height: 1.5;
    margin-bottom: 16px;
    color: #222222; /* Ensure body text contrast */
  }
  
  .ws-checkbox-label {
    font-size: 0.9rem;
    line-height: 1.4;
    gap: 10px;
    color: #222222; /* Ensure label text contrast */
  }
  
  .ws-checkbox-custom {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
  }
  
  .ws-location-status {
    margin-top: 12px;
    padding: 10px;
  }
  
  .ws-location-status p {
    font-size: 0.9rem;
  }
  
  .ws-modal-btn {
    padding: 12px 16px;
    font-size: 0.95rem;
    min-height: 48px;
  }
}

/* Extra small mobile devices */
@media (max-width: 360px) {
  .ws-modal-content {
    width: 99%;
    margin: 5px;
    max-height: calc(100vh - 10px);
  }
  
  .ws-modal-header,
  .ws-modal-body,
  .ws-modal-footer {
    padding-left: 12px;
    padding-right: 12px;
  }
  
  .ws-modal-header h3 {
    font-size: 1.1rem;
  }
  
  .ws-modal-body p {
    font-size: 0.9rem;
    margin-bottom: 12px;
  }
  
  .ws-checkbox-label {
    font-size: 0.85rem;
    gap: 8px;
  }
  
  .ws-checkbox-custom {
    width: 16px;
    height: 16px;
  }
  
  .ws-modal-btn {
    padding: 10px 14px;
    font-size: 0.9rem;
    min-height: 44px;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .ws-modal-content {
    max-height: calc(100vh - 20px);
    margin: 10px;
  }
  
  .ws-modal-header {
    padding: 16px 20px 12px 20px;
  }
  
  .ws-modal-body {
    padding: 16px 20px;
  }
  
  .ws-modal-footer {
    padding: 12px 20px 16px 20px;
  }
  
  .ws-location-consent {
    margin: 12px 0;
  }
}
