/*
 * This is a manifest file that'll be compiled into application.css.
 *
 * With Propshaft, assets are served efficiently without preprocessing steps. You can still include
 * application-wide styles in this file, but keep in mind that CSS precedence will follow the standard
 * cascading order, meaning styles declared later in the document or manifest will override earlier ones,
 * depending on specificity.
 *
 * Consider organizing styles into separate files for maintainability.
 */

/* Brand color variables */
:root {
  --color-brand: #e84a58;
  --color-brand-hover: #d63444;
  --color-brand-dark: #c12e3c;
}

/* Table with clickable rows - opt-in with .clickable-rows class */
.clickable-rows td.p-0 > a {
  text-decoration: none;
  color: inherit;
  /* Extend link area to cover border gaps */
  margin-top: -2px;
  margin-bottom: -2px;
  position: relative;
}

.clickable-rows td.p-0 > a:hover {
  text-decoration: none;
}

.hero-title {
  font-family: "Wotfard", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    Oxygen, Ubuntu, Cantarell, sans-serif;
  font-size: 2rem; /* Mobile: 32px - smaller for better mobile fit */
  font-style: normal;
  font-weight: 500;
  line-height: 2.25rem; /* Mobile: 36px line height for better readability */
  letter-spacing: -0.06rem; /* Reduced letter spacing for mobile */
}

/* Desktop hero title styles */
@media (min-width: 768px) {
  .hero-title {
    font-size: 3rem; /* Tablet: 48px */
    line-height: 3.25rem; /* Tablet: 52px */
    letter-spacing: -0.12rem;
  }
}

@media (min-width: 1024px) {
  .hero-title {
    font-size: 3.5rem; /* Desktop: 64px */
    line-height: 4rem; /* Desktop: 64px */
    letter-spacing: -0.16rem;
  }
}

.hero-subtitle {
  font-family: "Wotfard", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    Oxygen, Ubuntu, Cantarell, sans-serif;
  font-size: 1.125rem; /* Mobile: 18px */
  font-style: normal;
  font-weight: 400;
  line-height: 1.75rem; /* Mobile: 28px line height */
  letter-spacing: -0.015rem; /* Reduced letter spacing for mobile */
}

/* Desktop hero subtitle styles */
@media (min-width: 768px) {
  .hero-subtitle {
    font-size: 1.25rem; /* Tablet: 20px */
    line-height: 1.875rem; /* Tablet: 30px */
    letter-spacing: -0.02rem;
  }
}

@media (min-width: 1024px) {
  .hero-subtitle {
    font-size: 1.5rem; /* Desktop: 24px */
    line-height: normal;
    letter-spacing: -0.03rem;
  }
}

/* Logo styling */
.logo-svg {
  transition: all 0.3s ease;
}

.logo-svg:hover {
  transform: scale(1.1);
}

/* Brand color utilities using custom Tailwind brand colors */
.bg-brand {
  background-color: var(--color-brand) !important;
}

.btn-brand {
  background-color: var(--color-brand);
  color: white;
}

.btn-brand:hover {
  background-color: var(--color-brand-hover);
}

.btn-brand-outline {
  color: var(--color-brand);
  border-color: var(--color-brand);
}

.btn-brand-outline:hover {
  background-color: var(--color-brand);
  color: white;
}

.btn-brand-cta-secondary {
  border: 2px solid white;
  color: white;
}

.btn-brand-cta-secondary:hover {
  background-color: white;
  color: var(--color-brand);
}

section {
  margin-bottom: 2rem;
}

/* Mobile-specific hero section spacing adjustments */
@media (max-width: 767px) {
  /* Better mobile container padding for hero section */
  .container-main {
    padding-left: 1rem; /* 16px */
    padding-right: 1rem; /* 16px */
  }

  /* Optimize mobile hero layout */
  .hero-title {
    margin-bottom: 0.75rem; /* Tighter spacing below title */
  }

  .hero-subtitle {
    margin-bottom: 1rem; /* Reduced spacing for mobile */
  }
}

/* Tablet spacing adjustments */
@media (min-width: 768px) and (max-width: 1023px) {
  .hero-title {
    margin-bottom: 1.25rem;
  }

  .hero-subtitle {
    margin-bottom: 1.75rem;
  }
}

/* Global cursor pointer rules for all interactive elements */
button,
input[type="button"],
input[type="submit"],
input[type="reset"],
input[type="checkbox"],
a,
select,
summary,
[role="button"],
[role="link"],
.cursor-pointer {
  cursor: pointer;
}

/* Ensure text inputs and textareas keep text cursor */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="search"],
input[type="tel"],
input[type="url"],
textarea {
  cursor: text !important;
}

/* Disabled elements should show not-allowed cursor */
button:disabled,
input:disabled,
select:disabled,
textarea:disabled,
[disabled] {
  cursor: not-allowed !important;
}

/* Security settings utilities */
.min-w-screen-55 {
  min-width: 55vw;
}

.min-h-screen-75 {
  min-height: 75vh;
}

/* Password Strength Feedback Animations */
[data-controller*="password-strength"] {
  position: relative;
}

[data-password-strength-target="strengthIndicator"] {
  transform-origin: top;
  animation: slideDown 0.3s ease-out;
}

[data-password-strength-target="strengthIndicator"].hidden {
  display: none;
}

[data-password-strength-target="strengthBar"] {
  transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1),
    background-color 0.3s ease;
  will-change: width;
}

[data-password-strength-target="confirmationFeedback"] {
  transform-origin: left;
  animation: fadeInUp 0.2s ease-out;
}

[data-password-strength-target="confirmationFeedback"].hidden {
  display: none;
}

/* Smooth slide down animation for password strength */
@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
    max-height: 0;
  }
  to {
    opacity: 1;
    transform: translateY(0);
    max-height: 200px;
  }
}

/* Smooth fade in animation for confirmation feedback */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Requirement item animations */
[data-requirement] {
  transition: color 0.3s ease;
}

[data-requirement] .requirement-icon {
  transition: color 0.3s ease, transform 0.2s ease;
}

[data-requirement].text-green-600 .requirement-icon {
  transform: scale(1.1);
}

/* Only keep truly necessary custom styles that can't be replaced with Tailwind */

/* PWA and font styling */
.wotfard-font {
  font-family: "Wotfard", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    Oxygen, Ubuntu, Cantarell, sans-serif !important;
}

.pwa-body {
  padding-top: env(safe-area-inset-top) !important;
  background: linear-gradient(
    to bottom,
    white env(safe-area-inset-top),
    white env(safe-area-inset-top)
  ) !important;
  font-family: "Wotfard", system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  --webkit-font-smoothing: antialiased;
  --moz-osx-font-smoothing: grayscale;
}

/* Line clamp utilities for text truncation */
.line-clamp-1 {
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 1;
}

.line-clamp-2 {
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.line-clamp-3 {
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

/* Apple-style Properties Grid - Alternating 2-3 Pattern */
.properties-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(2, 1fr);
}

@media (min-width: 768px) {
  .properties-grid {
    gap: 1.5rem;
    /* Create a 5-column grid to accommodate 2+3 pattern */
    grid-template-columns: repeat(6, 1fr);
  }

  /* First and second items in each group of 5 span 3 columns each (2 items total) */
  .properties-grid .property-card:nth-child(5n + 1),
  .properties-grid .property-card:nth-child(5n + 2) {
    grid-column: span 3;
  }

  /* Third, fourth, and fifth items in each group span 2 columns each (3 items total) */
  .properties-grid .property-card:nth-child(5n + 3),
  .properties-grid .property-card:nth-child(5n + 4),
  .properties-grid .property-card:nth-child(5n + 5) {
    grid-column: span 2;
  }
}

@media (min-width: 1024px) {
  .properties-grid {
    gap: 2rem;
  }
}

/* Property Card Enhancement */
.property-card {
  position: relative;
  overflow: hidden;
  border-radius: 0.5rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1),
    0 2px 4px -1px rgba(0, 0, 0, 0.06);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  aspect-ratio: 4/5;
}

@media (min-width: 768px) {
  .property-card {
    aspect-ratio: 5/6;
  }

  /* Larger cards in first row (2 items) have taller aspect ratio */
  .properties-grid .property-card:nth-child(5n + 1),
  .properties-grid .property-card:nth-child(5n + 2) {
    aspect-ratio: 4/5;
  }

  /* Smaller cards in second row (3 items) have slightly shorter aspect ratio */
  .properties-grid .property-card:nth-child(5n + 3),
  .properties-grid .property-card:nth-child(5n + 4),
  .properties-grid .property-card:nth-child(5n + 5) {
    aspect-ratio: 3/4;
  }
}

@media (min-width: 1024px) {
  .property-card {
    aspect-ratio: 3/4;
  }

  /* Maintain the aspect ratio differences on larger screens */
  .properties-grid .property-card:nth-child(5n + 1),
  .properties-grid .property-card:nth-child(5n + 2) {
    aspect-ratio: 4/5;
  }

  .properties-grid .property-card:nth-child(5n + 3),
  .properties-grid .property-card:nth-child(5n + 4),
  .properties-grid .property-card:nth-child(5n + 5) {
    aspect-ratio: 3/4;
  }
}

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

.property-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* Property Card Overlay */
.property-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.8) 0%, transparent 50%);
  pointer-events: none;
}

/* Property Info Styling */
.property-info {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 1rem;
  color: white;
  z-index: 10;
}

.property-title {
  font-size: 1.125rem;
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: 0.25rem;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.property-price {
  font-size: 1.25rem;
  font-weight: 700;
  color: white;
}

.property-price-context {
  font-size: 0.875rem;
  opacity: 0.75;
}

/* Badges */
.property-badge {
  position: absolute;
  top: 0.75rem;
  z-index: 10;
  padding: 0.25rem 0.5rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.property-badge-exclusive {
  right: 0.75rem;
  background-color: var(--color-brand);
  color: white;
}

.property-badge-type {
  left: 0.75rem;
  background-color: rgba(0, 0, 0, 0.5);
  color: white;
  backdrop-filter: blur(4px);
}

/* Responsive adjustments */
@media (max-width: 767px) {
  .property-info {
    padding: 0.75rem;
  }

  .property-title {
    font-size: 1rem;
  }

  .property-price {
    font-size: 1.125rem;
  }

  .property-badge {
    top: 0.5rem;
    font-size: 0.6875rem;
    padding: 0.1875rem 0.375rem;
  }

  .property-badge-exclusive {
    right: 0.5rem;
  }

  .property-badge-type {
    left: 0.5rem;
  }
}

/* Animation for loading state */
.property-card.loading {
  background: linear-gradient(90deg, #f3f4f6 25%, #e5e7eb 50%, #f3f4f6 75%);
  background-size: 200% 100%;
  animation: loading 1.5s infinite;
}

@keyframes loading {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

/* Turbo Frame Loading States */
.availability-section {
  transition: opacity 0.3s ease-in-out;
}

.availability-loading {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 200px;
}

.availability-loading.hidden {
  display: none;
}

/* Smooth transitions for availability updates */
turbo-frame[id="availability"] {
  display: block;
  min-height: 200px;
  transition: opacity 0.2s ease-in-out;
}

turbo-frame[id="availability"].opacity-50 {
  opacity: 0.5;
  pointer-events: none;
}

/* Specific override for any button or div containing images */
button:has(img),
button:has(img):focus,
button:has(img):active,
div:has(img),
div:has(img):focus,
div:has(img):active {
  outline: none !important;
  box-shadow: none !important;
}

/* Airbnb-style Image Gallery Modal Enhancements */
#image-gallery-modal {
  backdrop-filter: blur(8px);
}

/* Enhanced close button styling */
#image-gallery-modal button[data-action*="close"] {
  backdrop-filter: blur(10px);
  background: rgba(0, 0, 0, 0.3);
  border-radius: 8px;
  padding: 8px 12px;
  transition: all 0.2s ease;
}

#image-gallery-modal button[data-action*="close"]:hover {
  background: rgba(0, 0, 0, 0.5);
  transform: translateY(-1px);
}

/* Enhanced navigation button styling */
#image-gallery-modal button[data-image-gallery-target="prevButton"],
#image-gallery-modal button[data-image-gallery-target="nextButton"] {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transition: all 0.2s ease;
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.9) !important;
  color: rgba(0, 0, 0, 0.8) !important;
  line-height: 1;
  font-family: system-ui, -apple-system, sans-serif;
  text-shadow: none;
  backdrop-filter: blur(10px);
}

#image-gallery-modal button[data-image-gallery-target="prevButton"]:hover,
#image-gallery-modal button[data-image-gallery-target="nextButton"]:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
  background: rgba(255, 255, 255, 1) !important;
  color: rgba(0, 0, 0, 0.9) !important;
  border: 1px solid rgba(0, 0, 0, 0.1);
}

/* Enhanced image counter styling */
#image-gallery-modal [data-image-gallery-target="counter"] {
  background: rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(10px);
  padding: 8px 16px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Smooth image transitions */
#image-gallery-modal img[data-image-gallery-target="modalImage"] {
  border-radius: 8px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

/* Mobile responsive adjustments for modal */
@media (max-width: 768px) {
  #image-gallery-modal button[data-action*="close"] {
    padding: 6px 8px;
    font-size: 14px;
  }

  #image-gallery-modal button[data-image-gallery-target="prevButton"],
  #image-gallery-modal button[data-image-gallery-target="nextButton"] {
    width: 40px;
    height: 40px;
  }

  #image-gallery-modal [data-image-gallery-target="counter"] {
    padding: 6px 12px;
    font-size: 14px;
  }
}

/* Founder Letter Styling */
.founder-letter-content {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  line-height: 1.8;
  letter-spacing: -0.015em;
}

.founder-letter-content p {
  margin-bottom: 1.5rem;
  font-size: 1.125rem;
  color: #374151;
}

.founder-letter-content strong {
  font-weight: 600;
  color: #111827;
}

.founder-letter-signature {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
}

.founder-letter-heading {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  font-weight: 600;
  letter-spacing: -0.025em;
}

/* Enhanced letter paper effect */
.letter-paper {
  background: linear-gradient(to bottom, #ffffff 0%, #fefefe 100%);
  border: 1px solid #e5e7eb;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 20px 25px -5px rgba(0, 0, 0, 0.1),
    0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* Responsive typography for founder letter */
@media (max-width: 768px) {
  .founder-letter-content p {
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 1.25rem;
  }
}


/* Custom grid for weekly calendar view */
.grid-cols-13 {
  grid-template-columns: repeat(13, minmax(0, 1fr));
}

/* Diagonal lines pattern for unavailable weeks */
.bg-pattern-diagonal-lines {
  background-color: white; /* Gray-50 base - lighter */
  background-image: repeating-linear-gradient(
    45deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.15) 3px,
    rgba(0, 0, 0, 0.15) 5px
  );
}

/* Close spacing for multiple units of the same check-in day */
.mb-0-5 {
  margin-bottom: 0.125rem; /* 2px */
}

/* Sidebar collapse styles - center icons when collapsed */
[data-sidebar-collapsed="true"]
  a[data-controller*="sidebar-tooltip"]
  .flex.items-center {
  justify-content: center !important;
}

/* Remove right margin from icons when sidebar is collapsed */
[data-sidebar-collapsed="true"] a[data-controller*="sidebar-tooltip"] svg {
  margin-right: 0 !important;
}

/* Preserve active state colors when collapsed */
[data-sidebar-collapsed="true"]
  a[data-controller*="sidebar-tooltip"].bg-blue-50 {
  background-color: rgb(239 246 255) !important; /* bg-blue-50 */
  color: rgb(29 78 216) !important; /* text-blue-700 */
  border-color: rgb(191 219 254) !important; /* border-blue-200 */
}

/* Center logo when sidebar is collapsed */
[data-sidebar-collapsed="true"] [data-admin-sidebar-target="header"] {
  justify-content: center !important;
}

/* Center the logo link itself when collapsed */
[data-sidebar-collapsed="true"] [data-admin-sidebar-target="header"] a {
  justify-content: center !important;
}

/* Inventory block hover styles */
.inventory-block-hover:hover {
  border-left-color: #e84a58 !important;
}

/* Turbo Frame Animation Styles */

/* Cascade exit animation for items */
.cascade-exit {
  animation: cascadeExit 500ms cubic-bezier(0.4, 0, 0.2, 1) forwards;
  animation-fill-mode: both;
}

/* Cascade enter animation for items */
.cascade-enter {
  animation: cascadeEnter 700ms cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
  animation-fill-mode: both;
}

/* Exit animation - items fade out and slightly move down */
@keyframes cascadeExit {
  from {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  to {
    opacity: 0;
    transform: translateY(20px) scale(0.95);
  }
}

/* Enter animation - items fade in with upward movement */
@keyframes cascadeEnter {
  from {
    opacity: 0;
    transform: translateY(30px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Container subtle fade during transition */
.turbo-frame-loading {
  pointer-events: none;
}

/* Ensure smooth transitions for the grid container */
turbo-frame#resorts_section .all-resorts-grid {
  min-height: 200px; /* Prevent layout jump */
}

/* Initial state for grid items to prepare for animations */
.all-resorts-grid > * {
  transform-origin: center center;
  will-change: transform, opacity;
}

/* Featured carousel scrollbar hiding */
.scrollbar-hide {
  -ms-overflow-style: none;  /* IE and Edge */
  scrollbar-width: none;  /* Firefox */
}

.scrollbar-hide::-webkit-scrollbar {
  display: none;  /* Chrome, Safari and Opera */
}
