/* ==========================================================================
   Property Detail Page Styles
   ========================================================================== */

/* Hero Section */
.property-hero {
  position: relative;
  height: 60vh;
  min-height: 400px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-neutral-50);
}

.property-hero-image {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.property-hero-image::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(44, 44, 44, 0.35), rgba(44, 44, 44, 0.55));
}

.property-hero-content {
  position: relative;
  z-index: 1;
  text-align: center;
  background: rgba(0, 0, 0, 0.5);
  padding: var(--space-6) var(--space-12);
  border-radius: var(--radius-lg);
  width: fit-content;
  max-width: none;
}

.property-hero-title {
  font-family: var(--font-heading);
  font-size: var(--text-5xl);
  font-weight: 700;
  margin-bottom: var(--space-4);
  text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.property-hero-specs {
  font-size: var(--text-lg);
  opacity: 0.95;
  text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

/* Description Section */
.section-property-description {
  background-color: var(--color-bg-primary);
}

.property-description-text {
  max-width: 800px;
  margin: 0 auto;
  font-size: var(--text-lg);
  line-height: var(--leading-relaxed);
}

.property-description-text p {
  margin-bottom: var(--space-4);
}

.property-description-text p:last-child {
  margin-bottom: 0;
}

/* Fancy list styling for property descriptions */
.property-description-text ul,
.property-description-text ol {
  list-style: none;
  padding: 0;
  margin: var(--space-4) 0;
}

.property-description-text li {
  position: relative;
  padding-left: 1.75rem;
  margin-bottom: var(--space-3);
  line-height: var(--leading-relaxed);
}

.property-description-text li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.35em;
  width: 16px;
  height: 16px;
  background-color: var(--color-accent-600);
  mask-image: url('/images/bullet.svg');
  -webkit-mask-image: url('/images/bullet.svg');
  mask-size: contain;
  -webkit-mask-size: contain;
  mask-repeat: no-repeat;
  -webkit-mask-repeat: no-repeat;
}

.property-description-text li:last-child {
  margin-bottom: 0;
}

/* Subheadings within description */
.property-description-text strong {
  display: block;
  font-family: var(--font-heading);
  font-size: var(--text-xl);
  font-weight: 600;
  color: var(--color-text-primary);
  margin-top: var(--space-6);
  margin-bottom: var(--space-3);
}

.property-description-text p:first-child strong {
  margin-top: 0;
}

/* Highlights Grid */
.section-property-highlights {
  background-color: var(--color-bg-secondary);
}

.property-highlights-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-6);
  margin-top: var(--space-8);
  align-items: stretch;
}

.property-highlight-card {
  background: #fff;
  padding: var(--space-8);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  text-align: center;
  transition: transform var(--transition-base), box-shadow var(--transition-base);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.property-highlight-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.property-highlight-title {
  font-family: var(--font-heading);
  font-size: var(--text-2xl);
  font-weight: 600;
  margin-bottom: var(--space-3);
  color: var(--color-text-primary);
}

.property-highlight-card p {
  color: var(--color-text-secondary);
  font-size: var(--text-lg);
  line-height: var(--leading-normal);
  margin: 0;
}

/* Amenities Grid */
.section-property-amenities {
  background-color: var(--color-bg-primary);
}

.property-amenities-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-8);
  margin-top: var(--space-8);
}

.property-amenities-group {
  background: #fff;
  padding: var(--space-6);
  border-radius: var(--radius-lg);
}

.property-amenities-category {
  font-family: var(--font-heading);
  font-size: var(--text-xl);
  font-weight: 600;
  margin-bottom: var(--space-4);
  color: var(--color-accent-600);
  padding-bottom: var(--space-2);
  border-bottom: 2px solid var(--color-accent-200);
}

.property-amenities-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.property-amenities-list li {
  padding: var(--space-2) 0;
  padding-left: var(--space-6);
  position: relative;
  color: var(--color-text-primary);
}

.property-amenities-list li::before {
  content: '\2713';
  position: absolute;
  left: 0;
  color: var(--color-success-500);
  font-weight: 600;
}

/* Gallery Grid */
.section-property-gallery {
  background-color: var(--color-bg-secondary);
}

.property-gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: var(--space-4);
  margin-top: var(--space-8);
}

.property-gallery-item {
  aspect-ratio: 4/3;
  overflow: hidden;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition-base), box-shadow var(--transition-base);
  cursor: pointer;
}

.property-gallery-item:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.property-gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-slow);
}

.property-gallery-item:hover img {
  transform: scale(1.05);
}

/* Booking CTA */
.section-booking-cta {
  background-color: var(--color-accent-50);
  text-align: center;
}

.booking-cta-content h2 {
  font-family: var(--font-heading);
  font-size: var(--text-3xl);
  font-weight: 700;
  margin-bottom: var(--space-2);
  color: var(--color-text-primary);
}

.booking-cta-content p {
  font-size: var(--text-lg);
  color: var(--color-neutral-600);
  margin-bottom: var(--space-6);
}

/* Loading State */
.property-loading {
  min-height: 60vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.property-loading p {
  margin-top: var(--space-4);
  color: var(--color-text-secondary);
}

/* Error State */
.property-error .alert {
  max-width: 600px;
  margin: 0 auto;
  text-align: center;
}

.property-error .alert h2 {
  margin-bottom: var(--space-4);
}

.property-error .alert p {
  margin-bottom: var(--space-6);
}

/* Spinner */
.spinner-lg {
  width: 48px;
  height: 48px;
  border: 4px solid var(--color-neutral-200);
  border-top-color: var(--color-accent-500);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

/* Alert Styles */
.alert {
  padding: var(--space-8);
  border-radius: var(--radius-lg);
  background: var(--color-bg-primary);
  box-shadow: var(--shadow-md);
}

.alert-error {
  border-left: 4px solid var(--color-error-500);
}

.alert-error h2 {
  color: var(--color-error-700);
}

/* Responsive Adjustments */
@media (max-width: 767px) {
  .property-hero {
    height: 50vh;
    min-height: 350px;
  }

  .property-hero-title {
    font-size: var(--text-3xl);
  }

  .property-hero-specs {
    font-size: var(--text-base);
  }

  .property-highlights-grid,
  .property-amenities-grid {
    grid-template-columns: 1fr;
  }

  .property-gallery-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-2);
  }

  .booking-cta-content h2 {
    font-size: var(--text-2xl);
  }
}

@media (min-width: 768px) {
  .property-hero {
    height: 70vh;
  }

  .property-hero-title {
    font-size: var(--text-6xl);
  }

  .property-gallery-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 1024px) {
  .property-gallery-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* Featured Gallery Item (first image larger) */
.property-gallery-item:first-child {
  grid-column: span 2;
  grid-row: span 2;
}

@media (max-width: 767px) {
  .property-gallery-item:first-child {
    grid-column: span 2;
    grid-row: span 1;
  }
}

/* ==========================================================================
   Booking Section Styles
   ========================================================================== */

.section-property-booking {
  background-color: var(--color-bg-primary);
}

.calendar-info {
  background: var(--color-accent-50);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-6);
  text-align: center;
}

.calendar-info p {
  font-size: var(--text-sm);
  color: var(--color-accent-700);
  margin: 0;
}

.property-booking-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-8);
  margin-top: var(--space-8);
}

@media (min-width: 1024px) {
  .property-booking-layout {
    display: flex;
    gap: var(--space-6);
    align-items: stretch;
  }

  .property-calendar-container {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
  }

  .property-booking-sidebar {
    flex-shrink: 0;
    width: 280px;
    display: flex;
    flex-direction: column;
  }

  .property-booking-sidebar .card {
    flex: 1;
    display: flex;
    flex-direction: column;
  }

  .property-booking-sidebar .card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
  }
}

.property-calendar-container {
  background-color: var(--color-surface);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  box-shadow: var(--shadow-sm);
}

.property-booking-sidebar {
  position: sticky;
  top: calc(80px + var(--space-4));
  height: fit-content;
}

.property-booking-sidebar .card {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border: none;
}

.property-booking-sidebar .card-body {
  padding: var(--space-6);
}

/* Property Info Section (max guests, combo includes) */
.property-info-section {
  padding: var(--space-4) 0;
  border-bottom: 1px solid var(--color-neutral-200);
  margin-bottom: var(--space-4);
}

.property-info-row {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--color-text-secondary);
  font-size: var(--text-sm);
}

.property-info-icon {
  display: flex;
  align-items: center;
  color: var(--color-accent-600);
}

.property-info-text strong {
  color: var(--color-text-primary);
  font-weight: 600;
}

.property-combo-includes {
  margin-top: var(--space-3);
  padding-top: var(--space-3);
  border-top: 1px dashed var(--color-neutral-200);
}

.property-info-label {
  display: block;
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-accent-600);
  margin-bottom: var(--space-2);
}

.property-combo-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.property-combo-list li {
  font-size: var(--text-sm);
  color: var(--color-text-primary);
  padding: var(--space-1) 0;
  padding-left: var(--space-4);
  position: relative;
}

.property-combo-list li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: var(--color-success-500);
  font-weight: 600;
  font-size: var(--text-xs);
}

.selected-dates-info {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
  margin-bottom: var(--space-6);
}

.selected-date {
  text-align: center;
}

.date-label {
  display: block;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-neutral-600);
  margin-bottom: var(--space-2);
}

.date-value {
  display: block;
  font-size: var(--text-base);
  font-weight: 500;
  color: var(--color-text-primary);
}

.pricing-breakdown {
  background: var(--color-bg-secondary);
  padding: var(--space-4);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-6);
}

.pricing-row {
  display: flex;
  justify-content: space-between;
  padding: var(--space-2) 0;
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
}

.pricing-row.total {
  border-top: 2px solid var(--color-neutral-300);
  margin-top: var(--space-2);
  padding-top: var(--space-3);
  font-weight: 700;
  font-size: var(--text-lg);
  color: var(--color-text-primary);
}

.empty-state-small {
  text-align: center;
  padding: var(--space-6) 0;
  color: var(--color-neutral-500);
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.empty-state-small p {
  margin: 0;
}

.btn-full {
  width: 100%;
}

/* Prominent CTA button for booking */
.property-booking-sidebar .btn-primary {
  background-color: var(--color-accent-800);
  border-color: var(--color-accent-800);
  font-weight: 600;
  letter-spacing: 0.02em;
  box-shadow: 0 4px 12px rgba(68, 72, 61, 0.3);
  transition: all var(--transition-base);
}

.property-booking-sidebar .btn-primary:hover:not(:disabled) {
  background-color: var(--color-accent-900);
  border-color: var(--color-accent-900);
  box-shadow: 0 6px 16px rgba(68, 72, 61, 0.4);
  transform: translateY(-1px);
}

.property-booking-sidebar .btn-primary:active:not(:disabled) {
  background-color: var(--color-accent-950);
  border-color: var(--color-accent-950);
  box-shadow: 0 2px 8px rgba(68, 72, 61, 0.3);
  transform: translateY(0);
}

/* ==========================================================================
   Related Properties Section
   ========================================================================== */

.section-related-properties {
  background-color: var(--color-bg-secondary);
}

.section-related-properties .properties-overview-grid {
  margin-top: var(--space-8);
}

/* Related property cards - image link */
.section-related-properties .property-card-image-link {
  display: block;
}

/* Related property cards - specs text styling */
.section-related-properties .property-card-specs-text {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  margin-bottom: var(--space-2);
}

/* ==========================================================================
   Skeleton Loading Animations
   ========================================================================== */

@keyframes skeleton-loading {
  0% {
    background-position: -200px 0;
  }
  100% {
    background-position: calc(200px + 100%) 0;
  }
}

.skeleton {
  background: linear-gradient(
    90deg,
    var(--color-neutral-200) 0px,
    var(--color-neutral-100) 40px,
    var(--color-neutral-200) 80px
  );
  background-size: 200px 100%;
  animation: skeleton-loading 1.5s infinite;
  border-radius: var(--radius-md);
}

.skeleton-hero {
  width: 100%;
  height: 60vh;
  min-height: 400px;
  margin-bottom: var(--space-8);
}

.skeleton-text {
  height: 20px;
  margin-bottom: var(--space-4);
}

.skeleton-text.short {
  width: 60%;
}

.skeleton-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: var(--space-4);
}

.skeleton-grid-item {
  height: 200px;
  background: linear-gradient(
    90deg,
    var(--color-neutral-200) 0px,
    var(--color-neutral-100) 40px,
    var(--color-neutral-200) 80px
  );
  background-size: 200px 100%;
  animation: skeleton-loading 1.5s infinite;
  border-radius: var(--radius-md);
}

/* Fade-in animation for content */
.fade-in {
  animation: fadeIn 0.3s ease-in;
}

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

/* Calendar loading skeleton */
.calendar-skeleton {
  height: 400px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-bg-secondary);
  border-radius: var(--radius-lg);
}

/* ==========================================================================
   Enhanced Error States
   ========================================================================== */

.error-state {
  max-width: 600px;
  margin: 0 auto;
  text-align: center;
}

.error-icon {
  color: var(--color-error-500);
  margin-bottom: var(--space-6);
}

.error-title {
  font-family: var(--font-heading);
  font-size: var(--text-3xl);
  font-weight: 700;
  margin-bottom: var(--space-4);
  color: var(--color-neutral-900);
}

.error-message {
  font-size: var(--text-lg);
  color: var(--color-neutral-600);
  margin-bottom: var(--space-8);
  line-height: var(--leading-relaxed);
}

.alert-warning {
  border-left: 4px solid var(--color-warning-500);
  background: var(--color-warning-50);
}

.alert-warning h3 {
  color: var(--color-warning-700);
}

/* ==========================================================================
   Image Loading States
   ========================================================================== */

.gallery-image {
  transition: opacity var(--transition-base);
  opacity: 0.5;
}

.gallery-image.loaded {
  opacity: 1;
}

.gallery-image.error {
  opacity: 0.7;
  filter: grayscale(100%);
}

/* Reserve aspect ratio to prevent layout shift */
.property-gallery-item {
  background: var(--color-neutral-100);
}

/* ==========================================================================
   Empty State Handling
   ========================================================================== */

.empty-state-text {
  color: var(--color-neutral-500);
  font-style: italic;
  text-align: center;
  padding: var(--space-8) 0;
}

/* ==========================================================================
   Accessibility Improvements
   ========================================================================== */

/* Skip link for keyboard navigation */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--color-accent-600);
  color: white;
  padding: var(--space-2) var(--space-4);
  text-decoration: none;
  border-radius: var(--radius-sm);
  z-index: 1000;
}

.skip-link:focus {
  top: var(--space-2);
  left: var(--space-2);
}

/* Screen reader only text */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* Enhanced focus indicators */
.property-gallery-item:focus,
.property-highlight-card:focus,
#book-now-btn:focus {
  outline: 3px solid var(--color-accent-500);
  outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .property-hero-image::after {
    background: rgba(0, 0, 0, 0.7);
  }

  .btn {
    border: 2px solid currentColor;
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ==========================================================================
   Performance Optimizations
   ========================================================================== */

/* Use CSS containment for performance */
.property-gallery-item {
  contain: layout style paint;
}

.property-highlight-card {
  contain: layout style;
}

/* Use transform for animations (GPU accelerated) */
.property-gallery-item:hover {
  transform: translateY(-2px) translateZ(0);
  will-change: transform;
}

/* ==========================================================================
   Lightbox Gallery Styles
   ========================================================================== */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox[hidden] {
  display: none;
}

.lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.95);
}

.lightbox-close {
  position: absolute;
  top: var(--space-4);
  right: var(--space-4);
  z-index: 10;
  width: 48px;
  height: 48px;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  border-radius: 50%;
  color: white;
  font-size: 32px;
  line-height: 1;
  cursor: pointer;
  transition: background var(--transition-base);
}

.lightbox-close:hover {
  background: rgba(255, 255, 255, 0.2);
}

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  width: 56px;
  height: 56px;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  border-radius: 50%;
  color: white;
  cursor: pointer;
  transition: background var(--transition-base);
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-nav:hover {
  background: rgba(255, 255, 255, 0.2);
}

.lightbox-nav:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.lightbox-nav svg {
  width: 24px;
  height: 24px;
}

.lightbox-prev {
  left: var(--space-4);
}

.lightbox-next {
  right: var(--space-4);
}

.lightbox-content {
  position: relative;
  z-index: 5;
  max-width: 90vw;
  max-height: 85vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-image {
  max-width: 100%;
  max-height: 85vh;
  object-fit: contain;
  border-radius: var(--radius-md);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.lightbox-counter {
  position: absolute;
  bottom: var(--space-4);
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  padding: var(--space-2) var(--space-4);
  background: rgba(0, 0, 0, 0.6);
  border-radius: var(--radius-full);
  color: white;
  font-size: var(--text-sm);
}

@media (max-width: 767px) {
  .lightbox-nav {
    width: 44px;
    height: 44px;
  }

  .lightbox-prev {
    left: var(--space-2);
  }

  .lightbox-next {
    right: var(--space-2);
  }

  .lightbox-close {
    top: var(--space-2);
    right: var(--space-2);
    width: 40px;
    height: 40px;
    font-size: 28px;
  }
}
