* {
    font-family: "SF-Pro-Rounded";
    box-sizing: border-box;
}

/* Improve scrolling performance */
.th-app-container,
.th-page-wrapper,
.th-page-container {
    will-change: transform;
    transform: translateZ(0); /* Force hardware acceleration */
}

.th-app-container-locked {
    overflow: hidden;
}

.th-sub-page-wrapper {
    padding-right: var(--th-images-width);
}

.th-hidden {
    opacity: 0;
}

body,
html {
    height: 100%;
    touch-action: pan-y; /* Allow vertical scrolling */
}

body {
    overflow: hidden;
}

.th-root {
    height: var(--unit-100vh);
    overflow: hidden;
}
body.th-body-bg {
    transition: background-color 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

p,
span,
label,
input,
textarea {
    font-weight: 500;
    font-size: 14px;
    line-height: 1;
    letter-spacing: 0.04em;
}

:root {
    --unit-100vh: 100vh;
    --th-images-width: 45vw;
    --th-page-padding: 70px;
    --th-page-mobile-padding: 30px;
}
@supports (height: 100dvh) {
    :root {
        --unit-100vh: 100dvh;
    }
}

.th-title:first-child {
    margin-top: 0;
}

h1.th-title,
h2.th-title {
    font-family: "Libre Baskerville", serif;
    font-weight: 400;
    font-style: normal;
    font-weight: "bold";
    line-height: 52px;
    text-align: left;
    margin: 0.09em 0;
}

h1.th-title {
    font-size: 3em;
}

h2.th-title {
    font-size: 2.5em;
}

@media (max-width: 600px) {
    h1.th-title {
        font-size: 2.5em; /* Adjust as needed */
        line-height: 46px;
    }

    h2.th-title {
        font-size: 1.5em; /* Adjust as needed */
    }
}

.th-title i {
    font-family: "Libre Baskerville", serif;
    font-weight: 400;
    font-style: italic;
}

p.th-paragraph {
    margin: 0.75em 0;
}

/* Icon after the text */
a.th-link .th-link-icon {
    fill: var(--th-textColor);
}

a.th-link .th-link-icon > svg {
    width: 8px;
}
/* Link styling */
a.th-link {
    color: unset;
    display: inline-flex;
    align-items: center;
    gap: 5px; /* space between text and icon */
    text-decoration: none;
}

/* Text wrapper for underline */
a.th-link .th-link-text {
    position: relative;
    display: inline-block;
}

/* Base underline (50% opacity) */
a.th-link .th-link-text::before {
    content: "";
    position: absolute;
    left: 0;
    bottom: -2px;
    height: 2px;
    width: 100%;
    background-color: var(--th-textColor);
    opacity: 0.15;
    border-radius: 1px;
}

/* Hover underline (100% opacity, animates from left to right) */
a.th-link .th-link-text::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -2px;
    height: 2px;
    width: 0;
    background-color: var(--th-textColor);
    opacity: 1;
    border-radius: 1px;
    transition: width 0.3s ease;
}

/* Animate hover underline */
a.th-link:hover .th-link-text::after {
    width: 100%;
}
/* Keep underline on active item */
.th-menu-nav-item-active a.th-link .th-link-text::after {
    width: 100%;
}

.th-menu-nav-item:hover::after {
    width: 100%;
}

.th-menu-nav-item-active::after {
    width: 100%;
}

label.th-form-label {
    text-transform: lowercase;
}

hr.th-divider {
    width: 100px;
    height: 2px;
    min-height: 2px;
    border: none;
    border-radius: 1px;
    background-color: var(--th-textColor);
    margin: 1em 0;
}

.th-inline-emoji {
    height: 1.25em;
    vertical-align: middle;
    display: inline;
    width: auto;
    fill: var(--th-textColor);
}

.th-loading-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: var(--unit-100vh);
    background-color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition:
        opacity 0.5s ease,
        visibility 0.5s ease;
    z-index: 9999;
}

.th-loading-modal-visible {
    opacity: 1;
    visibility: visible;
}

.th-loading-modal-hidden {
    opacity: 0;
    visibility: hidden;
}

.th-loading-logo {
    width: 200px;
    display: block;
    margin: 0 auto;
    animation: scale-pulse 2s infinite ease-in-out;
    transform-origin: center center;
}

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

/* Page component styles */
.th-page-wrapper {
    height: var(--unit-100vh);
    width: 100%;
    padding-right: var(--th-images-width);
    scroll-snap-align: start;
    scroll-snap-stop: normal;
    /* Allow react-scroll to handle smooth transitions */
}

.th-page-wrapper-mobile {
    padding-right: 0;
}

.th-page-container {
    height: var(--unit-100vh);
    width: 100%;
    gap: 25px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

.th-page-content {
    flex: 0 0 0%;
    flex-grow: 3;
    padding: var(--th-page-padding);
    padding-top: 0;
    margin: 0;
    height: var(--unit-100vh); /* Use fixed height instead of min-height */
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: start;
    row-gap: 20px;
    text-align: left;
    transition: opacity 0.3s ease-in-out;
    /* Prevent layout shifts */
    contain: layout style;
    overflow-y: scroll;
}

.th-page-content-mobile {
    padding: var(--th-page-mobile-padding);
}

.th-page-content-hidden {
    opacity: 0;
}

.th-menu-page {
    background-color: var(--th-backgroundColor);
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw;
    height: var(--unit-100vh);
    padding-right: var(--th-images-width);
}

.th-mobile-menu-page {
    padding-right: 0;
}

.th-menu-page-container {
    padding: var(--th-page-padding);
}

.th-menu-nav {
    list-style: none;
    padding: 0;
    margin: 0;
    text-align: end;
}

.th-menu-nav-item {
    border: none;
    padding: 0.25em 0;
    font-size: 2.5em;
    text-transform: lowercase;
    background: none;
    font-family: "Libre Baskerville", serif;
    font-weight: 500;
    font-style: italic;
    color: var(--th-textColor);
    position: relative; /* Needed for pseudo-element positioning */
    cursor: pointer;
}

.th-menu-nav-item::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 13px;
    height: 2px;
    width: 0;
    background-color: var(--th-textColor);
    border-radius: 1px;
    transition: width 0.3s ease;
}

.th-menu-nav-item:hover::after {
    width: 100%;
}

.th-menu-nav-item-active::after {
    width: 100%;
}

.menu-icon {
    cursor: pointer;
    width: 64px;
    height: 64px;
}

.th-line {
    transition:
        transform 0.4s ease,
        opacity 0.4s ease;
    transform-origin: 32px 32px; /* Center of SVG */
}

.th-menu-icon.th-menu-icon-open .line1 {
    transform: rotate(45deg) translate(0px, 0px);
}

.th-menu-icon.th-menu-icon-open .line2 {
    opacity: 0;
}

.th-menu-icon.th-menu-icon-open .line3 {
    transform: rotate(-45deg) translate(0px, 0px);
}

.th-mobile-menu-page-container {
    padding: var(--th-page-mobile-padding);
}

/* ContentRenderer component styles */
.th-content-default {
    font-size: 1.2rem;
    max-width: 600px;
}

.th-content-container {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    min-height: 0;
    justify-content: center;
    align-items: flex-start;
}

.th-content-container-mobile-image {
    justify-content: start;
}

.th-content-container-wrapper {
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    flex-grow: 1;
}

/* App component styles */
.th-app-container {
    height: var(--unit-100vh);
    overflow-y: auto;
    scroll-snap-type: y mandatory;
    /* Let react-scroll handle smooth scrolling */
    -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
    scrollbar-width: none; /* Hide scrollbar on Firefox */
    -ms-overflow-style: none; /* Hide scrollbar on IE/Edge */
    width: 100%;
}

/* Hide scrollbar on WebKit browsers */
.th-app-container::-webkit-scrollbar {
    display: none;
}

.th-loading-container {
    height: var(--unit-100vh);
    display: flex;
    align-items: center;
    justify-content: center;
}

.th-error-container {
    height: var(--unit-100vh);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

/* Images Sidebar Styles - Floating Overlay */
.th-images-sidebar {
    position: fixed;
    top: 0;
    right: 0;
    width: var(--th-images-width);
    height: var(--unit-100vh);
    background: rgba(248, 249, 250, 0.95);
    z-index: 1000;
    pointer-events: none;
}

.th-images-sidebar::-webkit-scrollbar {
    display: none;
}

.th-images-container {
    display: flex;
    flex-direction: column;
    height: var(--unit-100vh);
    transition: opacity 0.5s ease-in-out;
    opacity: 1;
    position: relative;
    top: 0;
    left: 0;
    width: 100%;
}

/* Grid layouts for different numbers of images */
.th-single-image-grid {
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: 1fr;
    height: var(--unit-100vh);
}

.th-two-images-grid {
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: 1fr 1fr;
    height: var(--unit-100vh);
}

.th-three-images-grid {
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: 1fr 1fr 1fr;
    height: var(--unit-100vh);
}

.th-four-images-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    height: var(--unit-100vh);
}

.th-multiple-images-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: repeat(auto-fit, minmax(20vh, 1fr));
    height: var(--unit-100vh);
    gap: 2px;
}

.th-image-wrapper {
    width: 100%;
    height: 100%;
    overflow: hidden;
    position: relative;
}

.th-image-carousel {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.th-carousel-image-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 1s ease-in-out;
}

.th-carousel-image-wrapper.th-active {
    opacity: 1;
    z-index: 1;
}

.th-carousel-image-wrapper.th-hidden {
    opacity: 0;
    z-index: 0;
}

.th-carousel-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.th-single-image-wrapper {
    width: 100%;
    height: var(--unit-100vh);
    overflow: hidden;
}

.th-sidebar-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.th-no-images {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #666;
    font-style: italic;
    text-align: center;
    padding: 20px;
    grid-column: 1 / -1;
    grid-row: 1 / -1;
}

/* Header Logo Styles */
.th-header-logo {
    position: relative;
    display: inline-block;
}

.th-logo-image {
    width: auto;
    opacity: 1;
    transition: opacity 0.3s ease-in-out;
}

.th-logo-image svg {
    fill: var(--th-textColor);
    height: 45px;
    display: block;
    width: auto;
}

.th-logo-image-large svg {
    height: 120px;
}

.th-logo-image-large-mobile svg {
    height: 75px;
}

/* Utility classes */
.th-logo-image-hidden {
    opacity: 0;
}

.th-header {
    width: 100%;
    display: flex;
    margin-top: var(--th-page-padding);
    padding-left: var(--th-page-padding);
    padding-right: var(--th-page-padding);
    justify-content: space-between;
    align-items: center;
    transition: opacity 0.3s ease-in-out;
    opacity: 1;
}

.th-menu-header {
    align-items: center;
    justify-content: end;
    height: 45px;
}

.th-header-mobile {
    margin-top: var(--th-page-mobile-padding);
    padding-left: var(--th-page-mobile-padding);
    padding-right: var(--th-page-mobile-padding);
}

.th-header-float {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 9;
}

.th-page-mobile-image-wrapper::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 2;
    opacity: 1;
    height: 120px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 1), rgba(0, 0, 0, 0));
    -webkit-mask-image: linear-gradient(
        to bottom,
        rgba(0, 0, 0, 1),
        rgba(0, 0, 0, 0)
    );
}

.th-header-hidden {
    opacity: 0;
}

.th-header-button {
    background: none;
    border: none;
    width: 48px;
    height: 48px;
    padding: 0;
    z-index: 99;
    cursor: pointer;
}

.th-header-button-menu {
    width: unset;
}

.th-header-button > svg {
    width: 16px;
    stroke: var(--th-textColor);
    transition: width 0.3s ease;
}

.th-header-button:hover > svg {
    width: 18px;
}
.th-scroll-icon-wrapper {
    display: flex;
    align-items: center;
    flex-direction: row;
    column-gap: 15px;
}

.th-scroll-icon-text {
    margin: 0;
    font-weight: 400;
    letter-spacing: 3px;
    font-size: 0.8em;
}

.th-page-mobile-image-wrapper {
    width: 100%;
    flex-grow: 2;
    flex-shrink: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden; /* Prevent overflow */
    border-bottom: 1px solid var(--th-textColor);
    transition: opacity 0.3s ease-in-out;
    opacity: 1;
}

.th-page-mobile-image-wrapper-hidden {
    opacity: 0;
}

.th-mobile-image {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Scale image to fit both width and height */
    display: block;
    max-width: 100%;
    max-height: 100%;
}

/* Image component styles */
.th-image-container {
    position: relative;
}

.th-image-blurhash {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: blur(0px); /* Blurhash is already blurred */
}

.th-image-content {
    position: absolute;
    top: 0;
    left: 0;
    object-fit: cover;
    width: 100%;
    height: 100%;
    opacity: 1;
    transition: opacity 0.3s ease-in-out;
}

.th-image-error {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #666;
    font-style: italic;
    text-align: center;
    padding: 20px;
}

.th-image-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #666;
    font-style: italic;
    text-align: center;
    padding: 20px;
}

.th-images-container-hidden {
    opacity: 0;
    position: absolute;
}

/* App component styles */
.th-app-container-mobile {
    /* Mobile-specific styles for app container - can be extended as needed */
    /* Currently inherits from .th-app-container */
    /* Add mobile-specific overrides here if needed */
    /* Placeholder for future mobile-specific styles */
    /* This rule is intentionally minimal - extend as needed */
    /* Add properties here when mobile-specific styles are needed */
    /* Intentionally empty - add mobile-specific styles here when needed */
    /* Placeholder for future mobile-specific styles */
}

.th-page-container-mobile {
    gap: 0;
}

/* Mobile overlay styles */
.th-mobile-overlay {
    background-color: black;
    position: float;
    top: var(--100vh);
    left: 0;
    width: 100vw;
    height: calc(100vh - var(--100vh));
}

/* CacheReloadView component styles */
.tbview {
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 5px 25px;
    padding-bottom: 10px;
}

.tbcard-mobile {
    width: 100% !important;
    height: 100% !important;
    display: flex !important;
    flex-direction: column !important;
}

.tbcard-desktop {
    width: 70% !important;
    height: 70% !important;
    display: flex !important;
    flex-direction: column !important;
}

.tb-loading-container {
    padding: 20px;
}

.tb-loading-icon {
    font-size: 48px;
    color: white;
}

/* PropertyCards.css */
.th-property-cards-container {
    position: relative;
    width: 100%;
    overflow: hidden; /* hides scrollbar outside container */
    padding: 1em 0 0 0;
    flex-grow: 1;
}

.th-property-cards {
    overflow-x: auto;
    scroll-behavior: smooth;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch; /* smooth scrolling on iOS */
    display: flex;
    flex-wrap: nowrap; /* prevent wrapping */
    gap: 5px;
    position: relative;
    height: 100%;
}

.th-property-card {
    flex: 0 0 auto; /* prevent shrinking */
    width: 40vh; /* fixed width */
    height: 100%;
    border: 1px solid var(--th-textColor);
    border-radius: 10px;
    scroll-snap-align: start; /* align each card when scrolling */
    background-color: var(--th-backgroundColor);
    display: flex;
    flex-direction: column;
    cursor: pointer;
    transition:
        transform 0.25s ease,
        box-shadow 0.25s ease;
}

.th-property-card-wrapper {
    padding: 7px;
}

.th-property-card:hover {
    transform: scale(1.03);
}

.th-property-card-content {
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.th-property-card-image-wrapper {
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.th-property-card-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-top-left-radius: 10px;
    border-top-right-radius: 10px;
    border-bottom: 1px solid var(--th-textColor);
}

.th-property-card-placeholder-image {
    width: 100%;
    height: 200px;
    background-color: #eee;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 10px;
    color: #666;
}

.th-property-card-title {
    font-family: "Libre Baskerville", serif;
    font-weight: 400;
    text-transform: lowercase;
    font-size: 1.2rem;
    margin: 0;
}

.th-property-card-address {
    text-transform: lowercase;
    font-size: 14px;
    margin: 0;
}

.th-features-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    font-size: 14px;
    margin: 0.75em 0;
    margin-top: 0.25em;
}

.th-property-card .th-features-list {
    margin: 0;
    margin-top: 5px;
}

.th-features-listItem {
    background-color: var(--th-textColor);
    color: var(--th-backgroundColor);
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: lowercase;
}

.th-scroll-btn {
    font-family: "Libre Baskerville", serif;
    font-weight: 400;
    position: absolute;
    top: 50%;
    font-size: 16px;
    transform: translateY(-50%);
    border: 1px solid var(--th-textColor);
    backdrop-filter: blur(5px);
    background-color: color-mix(
        in srgb,
        var(--th-backgroundColor) 50%,
        transparent
    );
    font-size: 2rem;
    cursor: pointer;
    z-index: 10;
    padding: 0;
    width: 35px;
    height: 35px;
    line-height: 0.1px;
    border-radius: 50%;
    transition:
        background-color 0.2s ease,
        transform 0.2s ease;
}

.th-scroll-btn:hover {
    background-color: color-mix(
        in srgb,
        var(--th-backgroundColor) 75%,
        transparent
    );
    transform: translateY(-50%) scale(1.075);
}

.th-scroll-btn.th-left {
    left: 10px;
}

.th-scroll-btn.th-right {
    right: 10px;
}

/* Optional: hide scrollbar but keep scrolling functional */
.th-property-cards::-webkit-scrollbar {
    display: none;
}

.th-property-cards {
    -ms-overflow-style: none; /* IE and Edge */
    scrollbar-width: none; /* Firefox */
}

.th-property-cards-gradient {
    position: absolute;
    width: 70px;
    z-index: 9;
    transition: opacity 0.2s ease;
}

.th-property-cards-gradient-left {
    top: 0;
    left: 0;
    bottom: 0;
    background: linear-gradient(90deg, var(--th-backgroundColor), transparent);
}

.th-property-cards-gradient-right {
    top: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, var(--th-backgroundColor));
}

p.th-property-address {
    font-weight: 600;
}

.th-property-specs {
    display: flex;
    flex-wrap: wrap;
    gap: 1em;
    margin-top: 0.25em;
    margin-bottom: 0.75em;
}

.th-property-specs > p {
    margin: 0;
    font-weight: 600;
}

.th-property-specs > .th-features-list {
    margin: 0;
}

.th-property-specs span {
    font-family: "Libre Baskerville", serif;
    font-weight: 600;
}

.th-button {
    padding: 5px 10px;
    background-color: var(--th-backgroundColor);
    color: var(--th-textColor);
    fill: var(--th-textColor);
    border: 1px solid var(--th-textColor);
    border-radius: 10px;
    transition:
        background-color 0.3s ease,
        color 0.3s ease,
        fill 0.3s ease;
    display: inline-flex;
    align-items: center;
    text-transform: lowercase;
    margin: 0.74em 0;
    line-height: 1;
    font-weight: 500;
    min-height: 30px;
}

.th-button:disabled {
    opacity: 0.5;
}

.th-button img {
    width: 24px;
    margin-right: 24px;
}

.th-button > .th-icon,
.th-button > svg {
    fill: var(--th-textColor);
    stroke: var(--th-textColor);
    height: 16px;
    width: auto;
    margin-right: 4px;
}

.th-button:not(:disabled):hover {
    background-color: var(--th-textColor);
    color: var(--th-backgroundColor);
}

.th-button:not(:disabled):hover > .th-icon,
.th-button:not(:disabled):hover > svg {
    fill: var(--th-backgroundColor);
    stroke: var(--th-backgroundColor);
}

.th-booking-buttons {
    display: flex;
    gap: 15px;
    margin-top: 5px;
}

.th-mobile-booking-buttons {
    width: 100%;
}

.th-booking-buttons > button {
    background: none;
    border-radius: 8px;
    padding: 8px 12px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-grow: 1;
    cursor: pointer;
    transition:
        background-color 0.3s ease,
        color 0.3s ease;
}

.th-booking-buttons > button > svg {
    display: inline-block;
    height: 18px;
    width: auto;
    margin-right: 8px;
}

.th-airbnb-button {
    border: 1px solid #ff385c;
    color: #ff385c;
    fill: #ff385c;
}

.th-airbnb-button:hover {
    background-color: #ff385c;
    color: white;
    fill: white;
}

.th-bookingcom-button {
    border: 1px solid #003b95;
    color: #003b95;
    fill: #003b95;
}

.th-bookingcom-button:hover {
    background-color: #003b95;
    color: white;
    fill: white;
}

.th-contact-form-wrapper {
    width: 100%;
}

.th-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin: 0.75em 0;
    width: 100%;
}

.th-form-input:focus {
    outline: none; /* Removes the default outline */
    box-shadow: none; /* Removes Chrome's blue glow */
}

.th-form-input {
    border: 1px solid var(--th-textColor);
    border-radius: 8px;
    padding: 5px 10px;
    max-width: 400px;
    min-width: 0;
}

.th-form-input:disabled {
    opacity: 0.5;
}

.th-form-actions {
    display: flex;
    gap: 15px;
    align-items: center;
}

.th-form-actions > .th-button {
    margin: 0;
}

.th-form-actions > .th-form-error {
    margin: 0;
    border: 1px solid #ff42457d;
    padding: 3px 6px;
    color: #ff4245;
    border-radius: 12px;
    font-size: 12px;
    text-transform: lowercase;
}
