/* THE HIDDEN Apartments - Mobile-First Guest Portal Styles */

/* ===== ROOT VARIABLES ===== */
:root {
  --primary-color: #1a472a;
  --primary-dark: #0f2818;
  --secondary-color: #2c5530;
  --accent-color: #d4af37;
  --success-color: #10b981;
  --danger-color: #ef4444;
  --warning-color: #f59e0b;
  --light-bg: #f8f9fa;
  --dark-color: #121212;
  --gray-color: #6c757d;
  --card-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1),
    0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --card-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1),
    0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* ===== GLOBAL STYLES ===== */
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  background: linear-gradient(135deg, #1a472a 0%, #2c5530 100%);
  min-height: 100vh;
  padding-bottom: 2rem;
}

/* ===== NAVIGATION ===== */
.navbar {
  backdrop-filter: blur(10px);
  background-color: rgba(255, 255, 255, 0.95) !important;
}

.navbar-brand {
  font-size: 1.5rem;
  font-weight: 700;
}

/* ===== PROGRESS STEPS (Mobile Optimized) ===== */
.progress-steps {
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
  margin: 2rem 0;
  padding: 0 1rem;
}

.progress-steps::before {
  content: "";
  position: absolute;
  top: 30px;
  left: 0;
  right: 0;
  height: 3px;
  background: #e5e7eb;
  z-index: 0;
}

.step {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  z-index: 1;
  flex: 1;
}

.step-icon {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: white;
  border: 3px solid #e5e7eb;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: #9ca3af;
  transition: all 0.3s ease;
  margin-bottom: 0.5rem;
}

.step.active .step-icon {
  background: linear-gradient(
    135deg,
    var(--primary-color),
    var(--secondary-color)
  );
  border-color: var(--primary-color);
  color: white;
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(26, 71, 42, 0.4);
}

.step.completed .step-icon {
  background: var(--success-color);
  border-color: var(--success-color);
  color: white;
}

.step-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: #6b7280;
  text-align: center;
  margin-top: 0.5rem;
}

.step.active .step-label {
  color: var(--primary-color);
}

/* Mobile: Make step labels smaller on very small screens */
@media (max-width: 576px) {
  .step-label {
    font-size: 0.65rem !important;
    margin-top: 0.25rem;
  }

  .step-icon {
    width: 50px;
    height: 50px;
    font-size: 1.2rem;
  }

  .progress-steps {
    padding: 0 0.25rem;
  }
}

/* ===== CARDS ===== */
.card {
  border-radius: 1rem;
  border: none;
  box-shadow: var(--card-shadow-lg);
  margin-bottom: 1.5rem;
}

.card-header {
  border-radius: 1rem 1rem 0 0 !important;
  background: linear-gradient(
    135deg,
    var(--primary-color),
    var(--secondary-color)
  ) !important;
  border: none;
  padding: 1.5rem;
}

.card-body {
  padding: 1.5rem;
}

/* ===== FORM CONTROLS (Mobile Optimized) ===== */
.form-label {
  font-weight: 600;
  color: #374151;
  margin-bottom: 0.5rem;
  font-size: 0.95rem;
}

.form-control,
.form-select {
  border-radius: 0.75rem;
  border: 2px solid #e5e7eb;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  transition: all 0.3s ease;
}

.form-control:focus,
.form-select:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(26, 71, 42, 0.1);
}

/* Make inputs larger on mobile for better touch targets */
@media (max-width: 768px) {
  .form-control,
  .form-select {
    padding: 1rem 1.25rem;
    font-size: 16px; /* Prevents zoom on iOS */
  }
}

/* ===== BUTTONS (Mobile Optimized) ===== */
.btn {
  border-radius: 0.75rem;
  padding: 0.875rem 1.75rem;
  font-weight: 600;
  font-size: 1rem;
  transition: all 0.3s ease;
  border: none;
}

.btn-primary {
  background: linear-gradient(
    135deg,
    var(--primary-color),
    var(--secondary-color)
  );
  box-shadow: 0 4px 12px rgba(26, 71, 42, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(26, 71, 42, 0.4);
}

.btn-lg {
  padding: 1rem 2rem;
  font-size: 1.1rem;
}

/* Full width buttons on mobile */
@media (max-width: 768px) {
  .btn {
    width: 100%;
    padding: 1rem;
    font-size: 1.05rem;
  }

  .btn + .btn {
    margin-top: 0.75rem;
  }
}

/* ===== APARTMENT CARDS (Mobile Optimized) ===== */
.apartment-card {
  border-radius: 1rem;
  overflow: hidden;
  transition: all 0.3s ease;
  cursor: pointer;
  background: white;
  border: 2px solid #e5e7eb;
  margin-bottom: 1rem;
}

.apartment-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--card-shadow-lg);
  border-color: var(--primary-color);
}

.apartment-card.selected {
  border-color: var(--primary-color);
  background: linear-gradient(
    to right,
    rgba(26, 71, 42, 0.05),
    rgba(44, 85, 48, 0.05)
  );
}

.apartment-image {
  width: 100%;
  height: 200px;
  object-fit: cover;
}

@media (max-width: 768px) {
  .apartment-image {
    height: 180px;
  }
}

.apartment-details {
  padding: 1.25rem;
}

.apartment-name {
  font-size: 1.25rem;
  font-weight: 700;
  color: #1f2937;
  margin-bottom: 0.5rem;
}

.apartment-features {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin: 1rem 0;
}

.feature-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: #f3f4f6;
  border-radius: 2rem;
  font-size: 0.875rem;
  color: #6b7280;
}

.apartment-price {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--primary-color);
  margin: 1rem 0;
}

/* ===== BOOKING SUMMARY (Mobile Sticky) ===== */
.booking-summary {
  background: white;
  border-radius: 1rem;
  padding: 1.5rem;
  box-shadow: var(--card-shadow);
  position: sticky;
  top: 80px;
}

@media (max-width: 992px) {
  .booking-summary {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    border-radius: 1rem 1rem 0 0;
    z-index: 1000;
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.1);
    max-height: 50vh;
    overflow-y: auto;
  }
}

.summary-row {
  display: flex;
  justify-content: space-between;
  padding: 0.75rem 0;
  border-bottom: 1px solid #e5e7eb;
}

.summary-row:last-child {
  border-bottom: none;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary-color);
  padding-top: 1rem;
}

/* ===== LOADING SPINNER ===== */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.spinner {
  width: 60px;
  height: 60px;
  border: 4px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

/* ===== ALERTS (Mobile Optimized) ===== */
.alert {
  border-radius: 0.75rem;
  border: none;
  padding: 1rem 1.25rem;
  margin-bottom: 1rem;
}

.alert-success {
  background: linear-gradient(135deg, #10b981, #059669);
  color: white;
}

.alert-danger {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: white;
}

.alert-info {
  background: linear-gradient(
    135deg,
    var(--primary-color),
    var(--secondary-color)
  );
  color: white;
}

/* ===== MODALS (Mobile Optimized) ===== */
.modal-content {
  border-radius: 1rem;
  border: none;
}

.modal-header {
  background: linear-gradient(
    135deg,
    var(--primary-color),
    var(--secondary-color)
  );
  color: white;
  border-radius: 1rem 1rem 0 0;
  border: none;
}

.modal-footer {
  border: none;
  padding: 1.5rem;
}

@media (max-width: 576px) {
  .modal-dialog {
    margin: 0.5rem;
  }

  .modal-fullscreen-sm-down {
    max-width: 100%;
    margin: 0;
    height: 100%;
  }

  .modal-fullscreen-sm-down .modal-content {
    height: 100%;
    border-radius: 0;
  }
}

/* ===== BOOKING TOKEN DISPLAY ===== */
.booking-token-display {
  background: linear-gradient(
    135deg,
    var(--primary-color),
    var(--secondary-color)
  );
  color: white;
  padding: 2rem;
  border-radius: 1rem;
  text-align: center;
  margin: 1.5rem 0;
  box-shadow: var(--card-shadow-lg);
}

.token-value {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: 2px;
  margin: 1rem 0;
  word-break: break-all;
}

@media (max-width: 576px) {
  .token-value {
    font-size: 1.2rem;
    letter-spacing: 1px;
  }
}

/* ===== VIEW BOOKING & EXTEND STAY SECTIONS ===== */
.action-section {
  background: white;
  border-radius: 1rem;
  padding: 2rem;
  box-shadow: var(--card-shadow-lg);
  margin-bottom: 2rem;
}

.action-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid #e5e7eb;
}

.action-icon {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(
    135deg,
    var(--primary-color),
    var(--secondary-color)
  );
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.5rem;
}

.action-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: #1f2937;
  margin: 0;
}

/* ===== BOOKING DETAILS TABLE ===== */
.booking-details-table {
  width: 100%;
  margin: 1.5rem 0;
}

.booking-details-table tr {
  border-bottom: 1px solid #e5e7eb;
}

.booking-details-table td {
  padding: 1rem 0.5rem;
}

.booking-details-table td:first-child {
  font-weight: 600;
  color: #6b7280;
  width: 40%;
}

.booking-details-table td:last-child {
  color: #1f2937;
  font-weight: 500;
}

@media (max-width: 576px) {
  .booking-details-table td {
    display: block;
    width: 100%;
    padding: 0.5rem 0;
  }

  .booking-details-table td:first-child {
    font-size: 0.875rem;
    padding-bottom: 0.25rem;
  }

  .booking-details-table tr {
    padding: 1rem 0;
    display: block;
  }
}

/* ===== UTILITY CLASSES ===== */
.text-gradient {
  background: linear-gradient(
    135deg,
    var(--primary-color),
    var(--secondary-color)
  );
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.badge-custom {
  padding: 0.5rem 1rem;
  border-radius: 2rem;
  font-weight: 600;
  font-size: 0.875rem;
}

.badge-success {
  background: var(--success-color);
  color: white;
}

.badge-warning {
  background: var(--warning-color);
  color: white;
}

.badge-danger {
  background: var(--danger-color);
  color: white;
}

/* ===== RESPONSIVE SPACING ===== */
@media (max-width: 768px) {
  .container {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .card-body {
    padding: 1rem;
  }

  h1 {
    font-size: 1.75rem;
  }

  h2 {
    font-size: 1.5rem;
  }

  h3 {
    font-size: 1.25rem;
  }
}

/* ===== TOUCH-FRIENDLY ELEMENTS ===== */
@media (hover: none) and (pointer: coarse) {
  /* Increase touch targets for mobile */
  .btn,
  .form-control,
  .form-select,
  .apartment-card {
    min-height: 48px;
  }

  .nav-link {
    padding: 1rem;
  }

  /* Remove hover effects on touch devices */
  .apartment-card:hover {
    transform: none;
  }

  .btn-primary:hover {
    transform: none;
  }
}

/* ===== FILTER SECTION - MOBILE RESPONSIVE ===== */

/* Filter section base styles */
.filter-section-card {
  border-radius: 12px;
  overflow: hidden;
  transition: all 0.3s ease;
}

/* Filter toggle button - only visible on mobile/tablet */
#filterToggleBtn {
  font-weight: 600;
  transition: all 0.3s ease;
  position: relative;
}

#filterToggleBtn:active {
  transform: scale(0.98);
}

/* Filter count badge */
#filterCountBadge {
  animation: pulse 0.5s ease;
}

@keyframes pulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
  }
}

/* Price range slider styling */
.form-range {
  height: 6px;
  cursor: pointer;
}

.form-range::-webkit-slider-thumb {
  width: 20px;
  height: 20px;
  background: var(--primary-color);
  border: 3px solid white;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.form-range::-moz-range-thumb {
  width: 20px;
  height: 20px;
  background: var(--primary-color);
  border: 3px solid white;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Filter checkboxes - larger touch targets */
.form-check-input {
  width: 1.25rem;
  height: 1.25rem;
  cursor: pointer;
}

.form-check-label {
  cursor: pointer;
  user-select: none;
}

/* Results count alert */
#resultsCount {
  font-size: 0.95rem;
}

/* ===== MOBILE BREAKPOINTS ===== */

/* Extra small devices (phones, less than 576px) */
@media (max-width: 575.98px) {
  /* Filter header */
  .filter-section-card .card-header {
    padding: 0.75rem 1rem;
  }

  .filter-section-card .card-header h5 {
    font-size: 1rem;
  }

  /* Filter body */
  .filter-section-card .card-body {
    padding: 1rem;
  }

  /* Price inputs */
  .input-group-sm .form-control,
  .input-group-sm .input-group-text {
    font-size: 0.875rem;
    padding: 0.375rem 0.5rem;
  }

  /* Filter labels */
  .form-label.small {
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
  }

  /* Checkboxes */
  .form-check {
    margin-bottom: 0.5rem;
  }

  .form-check-label.small {
    font-size: 0.85rem;
  }

  /* Filter buttons */
  .btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
  }

  /* Results alert */
  .alert.py-2 {
    padding: 0.5rem 0.75rem !important;
    font-size: 0.85rem;
  }

  /* Collapse animation */
  #filterCollapse {
    transition: height 0.35s ease;
  }
}

/* Small devices (landscape phones, 576px and up) */
@media (min-width: 576px) and (max-width: 767.98px) {
  .filter-section-card .card-body {
    padding: 1.25rem;
  }

  .form-check-inline {
    margin-right: 1rem;
  }
}

/* Medium devices (tablets, 768px and up) */
@media (min-width: 768px) and (max-width: 991.98px) {
  /* Show filter toggle button on tablets */
  #filterToggleBtn {
    display: inline-block !important;
  }

  /* Adjust grid for tablet */
  .filter-section-card .row.g-3 {
    row-gap: 1.5rem !important;
  }

  /* Two-column layout for some filters */
  .col-md-6 {
    flex: 0 0 50%;
    max-width: 50%;
  }
}

/* Large devices (desktops, 992px and up) */
@media (min-width: 992px) {
  /* Always show filters on desktop */
  #filterCollapse {
    display: block !important;
  }

  /* Hide toggle button on desktop */
  #filterToggleBtn {
    display: none !important;
  }

  /* Better spacing on desktop */
  .filter-section-card .card-body {
    padding: 1.5rem;
  }

  .filter-section-card .row.g-3 {
    row-gap: 2rem !important;
  }
}

/* ===== ACCESSIBILITY IMPROVEMENTS ===== */

/* Focus states for keyboard navigation */
.form-check-input:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 0.25rem rgba(26, 71, 42, 0.25);
}

.form-range:focus {
  outline: none;
  box-shadow: 0 0 0 0.25rem rgba(26, 71, 42, 0.25);
}

.btn:focus {
  box-shadow: 0 0 0 0.25rem rgba(26, 71, 42, 0.25);
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .form-check-input {
    border-width: 2px;
  }

  .btn {
    border-width: 2px;
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  #filterCollapse,
  .filter-section-card,
  #filterToggleBtn,
  .form-range {
    transition: none;
  }

  #filterCountBadge {
    animation: none;
  }
}

/* ===== SMOOTH SCROLLING FOR MOBILE ===== */
@media (max-width: 991.98px) {
  html {
    scroll-behavior: smooth;
  }

  /* Prevent layout shift when filters collapse */
  #filterCollapse.collapsing {
    transition: height 0.35s ease;
  }
}
