/* Layout fixes for proper footer positioning */
body {
  min-height: 100vh;
}

main.container {
  padding-bottom: 2rem; /* Add some space before footer */
}

/* General Reset */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  display: table;
  font-family: "Montserrat", sans-serif !important; /* Chosen: File 2's !important */
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  background-color: #f2f2f2;
  user-select: none;
  max-height: 100%; /* Chosen: File 2's max-height */
}

/* Preloader Styles (from File 1 & 2 - identical) */
#preloader {
  position: fixed;
  width: 100%;
  height: 100%;
  background-color: #f2f2f2;
  z-index: 9999;
  display: flex;
  justify-content: center;
  align-items: center;
}

.loader {
  border: 8px solid #f3f3f3;
  border-top: 8px solid darkcyan;
  border-radius: 50%;
  width: 60px;
  height: 60px;
  animation: spin 1.2s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

body.loading #preloader {
  display: flex;
}

body.loaded #preloader {
  display: none;
}

/* Enhanced Card Styles with better shadows and branding */
.card {
  border-radius: 15px;
  background-color: #ffffff;
  padding: 20px;
  max-width: 600px;
  margin: auto;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  border: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
}

.card h1 {
  font-size: 28px;
  color: darkcyan;
  animation: fadeIn 1s ease-in-out;
}

/* Enhanced card header styling */
.bg-dark-cyan {
  background-color: darkcyan !important;
}

.card-header {
  border-radius: 15px 15px 0 0 !important;
  border-bottom: none;
}

/* Form section styling */
.form-section {
  background-color: #f8f9fa;
  padding: 1.5rem;
  border-radius: 10px;
  border: 1px solid #e9ecef;
  transition: background-color 0.2s ease;
}

.form-section:hover {
  background-color: #f1f3f4;
}

/* Enhanced Form Control Styles */
.form-control {
  border-radius: 10px;
  padding: 12px 15px;
  font-size: 16px;
  border: 2px solid #e9ecef;
  transition: all 0.3s ease;
  background-color: #fff;
}

.form-control:focus {
  border-color: darkcyan;
  box-shadow: 0 0 0 0.2rem rgba(0, 128, 128, 0.15);
  background-color: #fff;
}

.form-floating > .form-control:focus ~ label {
  color: darkcyan;
}

/* Enhanced form labels */
.form-label {
  font-weight: 600;
  color: #495057;
  margin-bottom: 0.5rem;
}

.form-label i {
  color: darkcyan;
}

/* Enhanced Button Styles */
.btn-primary {
  background-color: darkcyan;
  border: none;
  padding: 12px 20px;
  font-size: 16px;
  border-radius: 10px;
  transition: all 0.3s ease;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.btn-primary:hover {
  background-color: #005f5f;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.btn-primary:active {
  transform: translateY(0);
}

/* Submit button specific styling */
.submit-btn {
  background: linear-gradient(135deg, darkcyan, #005f5f);
  border: none;
  padding: 15px 30px;
  font-size: 18px;
  font-weight: 700;
  border-radius: 12px;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.submit-btn:hover {
  background: linear-gradient(135deg, #005f5f, darkcyan);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.submit-btn: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;
}

.submit-btn:hover:before {
  left: 100%;
}

/* Sex Radios (from File 2) */
.sex-radios input[type="radio"] {
  margin-right: 5px;
}

/* Enhanced Responsive Design Media Queries */
@media (max-width: 768px) {
  .card {
    padding: 15px;
    margin: 10px;
  }

  .form-control {
    font-size: 16px; /* Prevents zoom on iOS */
  }

  .btn-primary {
    font-size: 16px;
  }

  .features-grid .col-md-4 {
    margin-bottom: 1rem;
  }

  .feature-toggle-card {
    padding: 12px;
    height: 120px; /* Fixed height for mobile too */
  }

  .feature-label {
    font-size: 0.8rem;
  }

  .feature-icon {
    font-size: 1.5rem;
  }

  .rating .fa-star {
    font-size: 1.8em;
  }

  .submit-btn {
    padding: 12px 20px;
    font-size: 16px;
  }

  .form-section {
    padding: 1rem;
  }

  .camera-controls .btn-group {
    flex-direction: column;
    width: 100%;
  }

  .camera-controls .btn {
    margin-bottom: 0.5rem;
  }

  .map-wrapper {
    height: 350px;
  }

  .image-grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  }

  .feature-badge {
    padding: 12px;
  }

  .time-display {
    font-size: 1rem;
  }

  .notes-text {
    font-size: 1rem;
    padding: 1rem;
    color: #000;
  }
}

@media (max-width: 600px) {
  .card {
    border-radius: 10px;
  }

  .card-header {
    border-radius: 10px 10px 0 0 !important;
  }

  .upload-area {
    padding: 1rem;
  }

  .image-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  }

  .feature-toggle-card {
    padding: 10px;
    height: 110px; /* Fixed height for smallest screens */
  }

  .feature-icon {
    font-size: 1.3rem;
  }

  .feature-label {
    font-size: 0.75rem;
  }

  .map-wrapper {
    height: 300px;
  }
}

/* Animations (Chosen: duplicate with transform: translateY) */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-5px); /* Reduced from -10px to prevent overflow */
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideUp {
  0% {
    transform: translateY(50px);
  }
  100% {
    transform: translateY(0);
  }
}

/* Page content H1 - specifically target content areas */
.container h1,
.card h1,
.section-card h1 {
  padding: 10px;
  font-size: 32px;
  color: #222;
  text-align: center;
  animation: fadeIn 1s ease-in-out;
}

/* Page content P - specifically target content areas */
.container p,
.card p,
.section-card p {
  font-size: 18px;
  color: #ddd;
  text-align: center;
  animation: fadeIn 1s ease-in-out;
}

/* Map Styles (from File 1 & 2 - identical, using File 2's hover preference) */
#map {
  min-height: 400px;
  height: 100%;
  border-radius: 15px;
  border: none;
  width: 100%;
  margin: auto;
  transition: box-shadow 0.3s ease;
}

#map:hover {
  box-shadow: 0px 0px 15px rgba(0, 0, 0, 0.3); /* Chosen: File 2's version */
}

/* Header and Footer Styles (from File 1 & 2) */
header {
  width: 100%;
  background-color: darkcyan;
}

footer {
  background-color: darkcyan;
  color: #ddd;
  /* Remove conflicting styles that override Bootstrap flex layout */
}

/* Navbar Styles (from File 1 & 2) */
.navbar {
  background-color: darkcyan;
}

.navbar-brand {
  padding-inline: 10px;
  border-radius: 10px;
  transition: transform 0.3s ease;
}

.navbar-brand:hover {
  transform: scale(1.1);
}

.nav-1-button {
  text-align: center;
  white-space: nowrap;
  margin: 5px;
  transition: transform 0.3s ease, background-color 0.3s ease;
}

.nav-1-button:hover {
  transform: scale(1.05);
  background-color: #eee;
}

/* Image Container Styles (from File 1) */
.image-container {
  position: relative;
  text-align: center;
}

.image-container img {
  width: auto;
  height: 300px;
  border-radius: 4px;
  object-fit: contain;
  box-sizing: border-box;
  margin: auto;
}

.image-container {
  flex: 0 0 33.3333%;
}

.image-container .remove-image {
  position: absolute;
  top: 5px;
  right: 10px;
  background: rgba(255, 255, 255, 0.7);
  border: none;
  border-radius: 50%;
  color: #ff4d4d;
  cursor: pointer;
  font-size: 1.2rem;
  text-align: center;
  width: 24px;
  height: 24px;
}

.caption-input {
  width: 100%;
  padding: 5px;
  margin-top: 5px;
  border: 1px solid #ccc;
  border-radius: 4px;
}

/* Enhanced Rating Styles */
.rating-container {
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 15px;
  background-color: #fff;
  border-radius: 10px;
  border: 2px solid #e9ecef;
}

.rating {
  display: flex;
  flex-direction: row;
  gap: 5px;
}

.rating .fa-star {
  font-size: 2.2em;
  color: #ddd;
  cursor: pointer;
  transition: all 0.3s ease;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.rating .fa-star:hover {
  transform: scale(1.1);
  color: #f5b301;
}

.rating .fa-star.hover,
.rating .fa-star.selected {
  color: #f5b301;
  text-shadow: 0 0 10px rgba(245, 179, 1, 0.5);
}

/* Map container styling for add page */
.map-container {
  border-radius: 15px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.map-container #map {
  border: none;
  border-radius: 15px;
  margin-bottom: 0px;
}

/* Toggle Switch (from File 1) */
.toggle-group {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.switch {
  position: relative;
  display: inline-block;
  width: 60px;
  height: 34px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  transition: 0.4s;
  border-radius: 34px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 26px;
  width: 26px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  transition: 0.4s;
  border-radius: 50%;
}

input:checked + .slider {
  background-color: #2196f3;
}

input:checked + .slider:before {
  transform: translateX(26px);
}

/* Submit Button (from File 1) */
button[type="submit"] {
  width: 100%;
  padding: 12px;
  color: white;
  border: none;
  border-radius: 4px;
  font-size: 1em;
  cursor: pointer;
  transition: background-color 0.3s;
}

button[type="submit"]:hover {
  background-color: #006b6b;
}

/* Error Messages (Combined as requested) */
.error,
.invalid-feedback {
  color: red;
  font-size: 0.9em;
  margin-top: 5px;
  display: none;
}

/* Header Content (from File 2) */
.header-content {
  width: 60%;
  max-width: 1200px;
  text-align: center;
  margin: auto;
}

@media (max-width: 600px) {
  .header-content {
    width: 80%;
    text-align: center;
    margin: auto;
  }

  #brand-text {
    display: none;
  }
}

/* Container (from File 2) */
.container {
  max-height: 100%;
  width: 100%;
  height: 70%;
  padding: 2%;
  margin: auto;
}

/* Navbar Nav (from File 2) */
.navbar-nav {
  padding: 5px;
}

/* Filters (from File 2) */
.filters {
  text-align: left;
  padding-bottom: 5px;
}

.filters > .btn-filter {
  background-color: darkcyan;
  border: 2px solid whitesmoke;
  border-radius: 20px;
  color: whitesmoke;
  height: 40px;
  font-size: small;
  transition: transform 0.3s ease, background-color 0.3s ease;
}

.filters > .btn-filter:hover {
  background-color: #005f5f;
  transform: translateY(-3px);
}

/* Tagline (from File 2) */
.tagline {
  overflow: hidden; /* Prevent animation overflow */
}

.tagline > h1 {
  color: whitesmoke;
  font-weight: bold;
  width: fit-content;
  text-align: left;
  white-space: nowrap;
  padding: 0px;
  animation: fadeIn 1s ease-in-out;
}

.tagline > p {
  color: whitesmoke;
  font-weight: bold;
  width: fit-content;
  text-align: left;
  white-space: nowrap;
  padding: 0px;
  padding-bottom: 25px;
  animation: fadeIn 1s ease-in-out;
}

/* Navbar Tabs Media Query (from File 2) */
@media (max-width: 991px) {
  .navbar-tabs > button {
    margin-left: 10px;
  }

  .navbar-collapse {
    text-align: left;
    position: absolute;
    z-index: 100;
  }
}

/* Custom Marker Icon (from File 2) */
.custom-marker-icon img {
  transition: transform 0.2s ease-in-out;
}

.custom-marker-icon:hover img {
  transform: scale(1.1);
}

/* Enhanced Image Grid */
.image-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.image-item {
  background-color: #eee;
  position: relative;
  border-radius: 12px;
  transition: transform 0.3s ease;
  padding: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.image-item:hover {
  transform: scale(1.02);
}

.image-grid img {
  width: 100%;
  height: auto;
  object-fit: contain; /* Changed from cover to contain to show full image */
  border: none; /* Remove white borders */
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
  background-color: white; /* Add white background for images with transparency */
}

.image-grid img:hover {
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

/* Map wrapper for index page */
.map-wrapper {
  position: relative;
  height: 500px;
  border-radius: 15px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  border: 2px solid #e9ecef;
}

#map {
  width: 100%;
  height: 100%;
  border-radius: 15px;
}

/* Opening hours styling */
.opening-hours {
  background-color: #f8f9fa;
  padding: 1.5rem;
  border-radius: 10px;
}

.time-display {
  display: flex;
  align-items: center;
  font-size: 1.2rem;
  font-weight: 600;
  color: #495057;
}

.time-text {
  background: linear-gradient(135deg, darkcyan, #005f5f);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: 700;
}

/* Notes styling */
.notes-text {
  font-size: 1.1rem;
  line-height: 1.6;
  color: #212529 !important; /* Much darker text for better readability */
  font-style: italic;
  background-color: #f8f9fa;
  padding: 1.5rem;
  border-radius: 10px;
}

/* Enhanced Features Section */
.features-grid {
  background-color: transparent;
  padding: 0;
}

.feature-toggle-card {
  background-color: #fff;
  padding: 15px;
  border-radius: 12px;
  border: 2px solid #e9ecef;
  transition: all 0.3s ease;
  height: 140px; /* Fixed height to ensure all cards are exactly the same */
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
}

.feature-toggle-card:hover {
  border-color: darkcyan;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
}

.feature-info {
  text-align: center;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 60px;
}

.feature-icon {
  font-size: 2rem;
  color: darkcyan;
  display: block;
  margin-bottom: 8px;
  flex-shrink: 0;
}

.feature-label {
  font-weight: 600;
  color: #495057;
  font-size: 0.9rem;
  display: block;
  line-height: 1.2;
  word-wrap: break-word;
  hyphens: auto;
  text-align: center;
  max-width: 100%;
}

/* Feature badges for toilet details page */
.feature-badge {
  background: linear-gradient(135deg, darkcyan, #005f5f);
  color: white;
  padding: 15px;
  border-radius: 12px;
  text-align: center;
  transition: transform 0.2s ease;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.feature-badge:hover {
  transform: translateY(-2px);
}

.feature-badge .feature-icon {
  font-size: 2rem;
  color: white;
  margin-bottom: 8px;
}

.feature-badge .feature-text {
  font-weight: 600;
  font-size: 1rem;
}

/* Enhanced Bootstrap switch styling */
.feature-toggle-card .form-check {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 10px;
  flex-shrink: 0;
}

.form-check-input {
  width: 3rem;
  height: 1.5rem;
  margin: 0;
}

.form-check-input:checked {
  background-color: darkcyan;
  border-color: darkcyan;
}

.form-check-input:focus {
  border-color: darkcyan;
  outline: 0;
  box-shadow: 0 0 0 0.25rem rgba(0, 128, 128, 0.25);
}

/* Rating display for toilet details */
.rating-display .rating {
  display: flex;
  gap: 5px;
}

.rating-display .fa-star {
  font-size: 1.8rem;
  color: #6c757d; /* Darker gray for empty stars */
  pointer-events: none; /* Make stars completely static */
  cursor: default;
}

.rating-display .fa-star.selected {
  color: #ffd700;
  text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

/* Upload area styling */
.upload-area {
  background-color: #f8f9fa;
  border: 2px dashed #dee2e6;
  border-radius: 10px;
  padding: 1.5rem;
  text-align: center;
  transition: all 0.3s ease;
  overflow: hidden; /* Ensure content stays within bounds */
}

.upload-area:hover {
  border-color: darkcyan;
  background-color: rgba(0, 128, 128, 0.05);
}

/* Video preview styling */
.upload-area #video {
  max-width: 100%;
  max-height: 300px;
  border-radius: 8px;
  border: 2px solid darkcyan;
  margin: 10px 0;
  display: block;
  margin-left: auto;
  margin-right: auto;
}

.file-upload-area {
  margin: 1rem 0;
}

.file-upload-btn {
  padding: 12px 24px;
  font-weight: 600;
  border-radius: 8px;
}

.upload-text {
  color: #6c757d;
}

.camera-controls .btn {
  border-radius: 8px;
  font-weight: 500;
}

/* Image preview grid */
.image-preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 15px;
  margin-top: 1rem;
}

.image-preview-grid img {
  width: 100%;
  height: 150px;
  object-fit: cover;
  border-radius: 8px;
  border: 2px solid #e9ecef;
  transition: transform 0.2s ease;
}

.image-preview-grid img:hover {
  transform: scale(1.05);
  border-color: darkcyan;
}
