/* ===================================
   CSS Variables & Reset
   =================================== */
:root {
    /* Colors */
    --primary-color: #BD9A68;
    --secondary-color: #202020;
    --text-dark: #202020;
    --text-light: #666666;
    --text-white: #ffffff;
    --bg-light: #f8f8f8;
    --bg-overlay: rgba(0, 0, 0, 0.5);
    
    /* Typography */
    --font-primary: 'Montserrat', sans-serif;
    --font-heading: 'Vidaloka', serif;
    
    /* Spacing */
    --section-padding: 80px;
    --container-width: 1200px;
    
    /* Transitions */
    --transition-base: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    font-family: var(--font-primary);
    font-size: 16px;
    line-height: 1.7;
    color: var(--text-dark);
    background-color: #fff;
    overflow-x: hidden;
    position: relative;
}

p, span {
    font-family: var(--font-primary);
}

body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background-image: url('../images/bg-image.webp');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0.20;
    pointer-events: none;
    /* Performance optimization for smooth rendering */
    will-change: transform;
    transform: translateZ(0);
    backface-visibility: hidden;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition-base);
}

button {
    border: none;
    background: none;
    cursor: pointer;
    font-family: inherit;
}

input,
textarea {
    font-family: inherit;
}

/* ===================================
   Language Switcher
   =================================== */
.language-switcher {
    position: fixed;
    top: 30px;
    right: 30px;
    z-index: 1000;
}

.language-current {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(189, 154, 104, 0.3);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-dark);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
}

.language-current:hover {
    background: rgba(255, 255, 255, 1);
    border-color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transform: translateY(-1px);
}

.language-current .flag-icon {
    font-size: 20px;
    line-height: 1;
}

/* Flag icon styles for flag-icons library */
.language-switcher .flag-icon-img {
    width: 20px;
    height: 15px;
    margin-right: 8px;
    border-radius: 2px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    display: inline-block;
    vertical-align: middle;
}

.language-current .lang-name {
    margin-right: 5px;
}

.language-current i {
    font-size: 12px;
    transition: transform 0.3s ease;
    color: var(--text-light);
}

.language-dropdown.show ~ .language-current i,
.language-current:hover i {
    transform: rotate(180deg);
}

.language-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 180px;
    background: #ffffff;
    border: 1px solid rgba(189, 154, 104, 0.2);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    overflow: hidden;
}

.language-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.language-option {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 12px 20px;
    background: transparent;
    border: none;
    text-align: left;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-dark);
}

.language-option:hover {
    background: rgba(189, 154, 104, 0.08);
}

.language-option.active {
    background: rgba(189, 154, 104, 0.12);
    color: var(--primary-color);
}

.language-option .flag-icon {
    font-size: 20px;
    line-height: 1;
}

.language-option .flag-icon-img {
    width: 20px;
    height: 15px;
}

.language-option .lang-name {
    flex: 1;
}

/* Fade animation for text changes */
.i18n-fade {
    animation: i18nFadeIn 0.3s ease;
}

@keyframes i18nFadeIn {
    0% {
        opacity: 0.5;
    }
    100% {
        opacity: 1;
    }
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .language-switcher {
        top: 15px;
        right: 15px;
    }
    
    .language-current {
        padding: 8px 15px;
        font-size: 13px;
    }
    
    .language-current .flag-icon {
        font-size: 18px;
    }
    
    .language-dropdown {
        min-width: 160px;
    }
    
    .language-option {
        padding: 10px 15px;
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .language-current .lang-name {
        display: none;
    }
    
    .language-current {
        padding: 8px 12px;
    }
}

/* ===================================
   Container & Layout
   =================================== */
.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 15px;
}

/* ===================================
   Typography
   =================================== */
.section-header {
    text-align: center;
    margin-bottom: 50px;
}

.section-subtitle {
    display: block;
    color: var(--text-dark);
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 15px;
}

.section-title {
    font-size: 44px;
    font-weight: 400;
    line-height: 1.2;
    margin-bottom: 0;
    text-transform: uppercase;
    font-family: var(--font-heading);
}

/* ===================================
   Buttons
   =================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 16px 40px;
    font-size: 15px;
    font-weight: 500;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    border-radius: 0;
    transition: var(--transition-base);
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.btn-primary {
    background-color: var(--primary-color);
    color: var(--text-white);
    border: 2px solid var(--primary-color);
}

.btn-primary:hover {
    background-color: #000000;
    border-color: #000000;
    color: #ffffff;
}

/* Rolling Text Animation */
.btn_m {
    overflow: hidden;
    height: 22px; /* Set fixed height for the rolling effect */
}

.btn_c {
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn:hover .btn_c {
    transform: translateY(-22px); /* Matches height of btn_m */
}

.btn_t1, .btn_t2 {
    height: 22px;
    line-height: 22px;
    display: block;
}

.btn-large {
    padding: 18px 50px;
    font-size: 16px;
}

.btn-text {
    position: relative;
    z-index: 2;
}

.btn-loader {
    display: none;
    width: 20px;
    height: 20px;
    border: 2px solid #fff;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.btn.loading {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.btn.loading .btn-text {
    opacity: 1;
    display: inline-block;
    vertical-align: middle;
}

.btn.loading .btn-loader {
    display: inline-block;
    vertical-align: middle;
}

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



/* ===================================
   Hero Section - Production Optimized
   =================================== */
.hero-section {
    position: relative;
    /* Use dynamic viewport height for mobile address bar compatibility */
    height: 100vh;
    height: 100dvh; /* Dynamic viewport - recalculates with address bar */
    min-height: 600px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    /* Critical: Isolate as composite layer to prevent repaint cascade */
    isolation: isolate;
    /* Prevent layout shift */
    contain: layout style paint;
}

/* Background Image Layer - Absolute positioning for maximum stability */
.hero-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    overflow: hidden;
    /* Force GPU layer - prevents CPU repaint */
    will-change: transform;
    transform: translateZ(0);
    backface-visibility: hidden;
    /* Prevent sub-pixel rendering issues */
    transform-style: preserve-3d;
}

.hero-bg-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* Object-fit is more stable than background-size */
    object-fit: cover;
    object-position: center center;
    /* Disable user interactions */
    pointer-events: none;
    user-select: none;
    /* Force GPU rendering and prevent repaints */
    will-change: transform;
    transform: translateZ(0) scale(1.001); /* Scale prevents sub-pixel gaps */
    backface-visibility: hidden;
    /* Smooth rendering */
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
    /* Prevent drag */
    -webkit-user-drag: none;
    -moz-user-drag: none;
}

/* Fallback for browsers without dvh support */
@supports not (height: 100dvh) {
    .hero-section {
        /* Use fixed pixel height on mobile to avoid address bar issues */
        min-height: 100vh;
    }
}

/* Mobile-specific optimizations */
@media (max-width: 768px) {
    .hero-section {
        /* Use small viewport height on mobile (excludes address bar) */
        height: 100svh;
        /* Prevent iOS rubber-band effect issues */
        overscroll-behavior: none;
    }
    
    .hero-bg-image {
        /* Slightly larger scale on mobile prevents gaps during scroll */
        transform: translateZ(0) scale(1.002);
    }
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, rgba(32, 32, 32, 0.7) 0%, rgba(32, 32, 32, 0.21) 51.04%, rgba(32, 32, 32, 0.7) 100%), linear-gradient(0deg, rgba(32, 32, 32, 0.2), rgba(32, 32, 32, 0.2));
    z-index: 1;
    /* GPU layer isolation */
    will-change: opacity;
    transform: translateZ(0);
    backface-visibility: hidden;
}

.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    color: var(--text-white);
    max-width: 900px;
    padding: 0 20px;
    /* Ensure content doesn't trigger repaints */
    will-change: transform;
    transform: translateZ(0);
    backface-visibility: hidden;
}

.hero-title {
    font-family: var(--font-heading);
    font-size: 64px;
    font-weight: 400;
    line-height: 1.2;
    letter-spacing: -1px;
    margin-bottom: 30px;
    animation: fadeInUp 1s ease;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    text-transform: uppercase;
}

.btn{
    border-radius: 8px;
}

.hero-subtitle {
    font-family: var(--font-primary);
    font-size: 15px;
    line-height: 1.9;
    margin-bottom: 40px;
    opacity: 0.98;
    animation: fadeInUp 1s ease 0.2s;
    animation-fill-mode: backwards;
    letter-spacing: 0.5px;
    font-weight: 300;
}

.scroll-indicator {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
}

.scroll-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: -5px;
}

.scroll-link span {
    width: 20px;
    height: 20px;
    border-left: 2px solid var(--text-white);
    border-bottom: 2px solid var(--text-white);
    transform: rotate(-45deg);
    opacity: 0.7;
    animation: scrollDown 1.5s ease-in-out infinite;
}

.scroll-link span:nth-child(2) {
    animation-delay: 0.15s;
    margin-top: -8px;
}

.scroll-link span:nth-child(3) {
    animation-delay: 0.3s;
    margin-top: -8px;
}

@keyframes scrollDown {
    0% { opacity: 0.4; transform: rotate(-45deg) translate(0, 0); }
    50% { opacity: 1; transform: rotate(-45deg) translate(-3px, 3px); }
    100% { opacity: 0.4; transform: rotate(-45deg) translate(0, 0); }
}

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

/* ===================================
   About Section
   =================================== */
.about-section {
    padding: 80px 0px 80px 0px;
}

.about-content {
    max-width: 900px;
    margin: 0 auto;
    text-align: center;
}

.about-content p {
    font-size: 15px;
    line-height: 1.86;
    color: var(--text-light);
    margin-bottom: 20px;
}

.about-content p:last-child {
    margin-bottom: 0;
}

.about-content strong {
    color: var(--text-light);
    font-weight: 600;
}

/* ===================================
   Villa Section
   =================================== */
.villa-section {
    padding: 50px 0;
}

.villa-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
}

.villa-image {
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0,0,0,0.1);
}

.villa-image img {
    width: 100%;
    height: 450px;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.villa-image:hover img {
    transform: scale(1.05);
}

.villa-description .section-header {
    text-align: left;
    margin-bottom: 30px;
}

.villa-description .section-subtitle {
    font-size: 14px;
    line-height: 1.8;
    color: var(--text-dark);
    text-transform: uppercase;
    letter-spacing: normal;
    display: block;
}

.villa-description .section-title {
    font-size: 48px;
    text-transform: uppercase;
    line-height: 1.29;
}

/* ===================================
   Gallery Section
   =================================== */
.gallery-section {
    padding: var(--section-padding) 0;
    
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(2, 300px);
    gap: 24px;
    
}
.gallery-container{
    max-width: 1790px;
    margin: 0 auto;
}
.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 16px;
    cursor: pointer;
}

.gallery-item-1 {
    grid-column: 1 / 3;
    grid-row: 1 / 3;
}

.gallery-item-2 {
    grid-column: 3 / 4;
    grid-row: 1 / 2;
}

.gallery-item-3 {
    grid-column: 4 / 5;
    grid-row: 1 / 2;
}

.gallery-item-4 {
    grid-column: 3 / 4;
    grid-row: 2 / 3;
}

.gallery-item-5 {
    grid-column: 4 / 5;
    grid-row: 2 / 3;
}

.gallery-link {
    display: block;
    width: 100%;
    height: 100%;
    position: relative;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

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

.gallery-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(20, 33, 45, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-base);
}

.gallery-overlay span {
    background: #ffffff;
    color: #14212d;
    padding: 18px 35px;
    border-radius: 12px;
    font-weight: 600;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    font-size: 14px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    transition: var(--transition-base);
}

.gallery-item:hover .gallery-overlay span {
    background-color: var(--primary-color);
    color: #ffffff;
}

/* ===================================
   Video Section
   =================================== */
.video-section {
    padding: var(--section-padding) 0;
}

.video-wrapper {
    margin-top: 50px;
}

.video-container {
    position: relative;
    width: 100%;
    height: 600px;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0,0,0,0.15);
}

.video-thumbnail {
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
}

.video-play-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90px;
    height: 90px;
    background-color: var(--primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: var(--transition-base);
    box-shadow: 0 5px 20px rgba(189, 154, 104, 0.5);
}

.video-play-btn:hover {
    transform: translate(-50%, -50%) scale(1.1);
    background-color: #a88655;
}

.video-play-btn i {
    font-size: 32px;
    color: var(--text-white);
    margin-left: 4px;
}

/* ===================================
   Contact Section
   =================================== */
.contact-section {
    padding: var(--section-padding) 0;
    background-color: transparent;
}

.contact-wrapper {
    max-width: 100%;
    margin: 0 auto;
    padding: 80px;
    background-color: #ffffff;
    border-radius: 12px;
}

.contact-section .section-header {
    margin-bottom: 40px;
}

.contact-section .section-subtitle {
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 1.5px;
    color: #333;
    margin-bottom: 10px;
}

.contact-section .section-title {
     font-family: var(--font-heading);
    font-size: 24px;
    font-weight: 400;
    line-height: 1.4;
    padding: 0 40px;
    text-transform: uppercase;
    color: #202020;
    max-width: 800px;
    margin: 0 auto;
}

.contact-form {
    margin-top: 40px;
    max-width: 750px;
    margin-left: auto;
    margin-right: auto;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 15px;
}

.form-group {
    position: relative;
    margin-bottom: 15px;
}

.form-control {
    width: 100%;
    padding: 14px 20px;
    font-size: 14px;
    border: 1px solid #707070;
    background-color: #fff;
    border-radius: 10px;
    transition: var(--transition-base);
    outline: none;
    color: #333;
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(189, 154, 104, 0.1);
}

.form-control::placeholder {
    color: #666;
    font-size: 14px;
}

textarea.form-control {
    resize: none;
    min-height: 200px;
}

.form-submit {
    text-align: center;
    margin-top: 40px;
}

.form-message {
    text-align: center;
    margin-top: 20px;
    padding: 15px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    display: none;
}

.form-message.success {
    display: block;
    background-color: #f5f5dcdb;
    color: #000000;
    border: 1px solid #a88655;
}

.form-message.error {
    display: block;
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.contact-section .btn-primary {
    background-color: #BD9A68;
    border-color: #BD9A68;
    color: #ffffff;
    padding: 15px 45px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.contact-section .btn-primary:hover {
    background-color: #a88655;
    border-color: #a88655;
}

/* ===================================
   Lightbox Modal
   =================================== */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.lightbox.active {
    display: flex;
    opacity: 1;
}

.lightbox-content {
    position: relative;
    max-width: 90%;
    max-height: 90vh;
    text-align: center;
}

.lightbox img {
    max-width: 100%;
    max-height: 85vh;
    object-fit: contain;
    margin: 0 auto;
}

.lightbox-counter {
    color: var(--text-white);
    font-size: 14px;
    margin-top: 15px;
    opacity: 0.8;
}

.lightbox-close,
.lightbox-prev,
.lightbox-next {
    position: absolute;
    color: var(--text-white);
    font-size: 40px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 15px;
    transition: var(--transition-base);
    z-index: 10000;
}

.lightbox-close {
    top: 20px;
    right: 30px;
    font-size: 50px;
}

.lightbox-close:hover {
    color: var(--primary-color);
}

.lightbox-prev {
    left: 30px;
    top: 50%;
    transform: translateY(-50%);
}

.lightbox-next {
    right: 30px;
    top: 50%;
    transform: translateY(-50%);
}

.lightbox-prev:hover,
.lightbox-next:hover {
    color: var(--primary-color);
}

/* ===================================
   Video Modal
   =================================== */
.video-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.video-modal.active {
    display: flex;
    opacity: 1;
}

.video-modal-content {
    position: relative;
    width: 90%;
    max-width: 1200px;
    aspect-ratio: 16 / 9;
}

.video-modal iframe {
    width: 100%;
    height: 100%;
}

.video-modal-close {
    position: absolute;
    top: 10px;
    right: 10px;
    color: var(--text-white);
    font-size: 45px;
    background: rgba(0, 0, 0, 0.6);
    border: none;
    cursor: pointer;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-base);
    z-index: 10000;
    line-height: 1;
    padding: 0;
}

.video-modal-close:hover {
    background: rgba(189, 154, 104, 0.9);
    color: var(--text-white);
    transform: rotate(90deg);
}

/* ===================================
   Back to Top Button
   =================================== */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 45px;
    height: 45px;
    background-color: var(--primary-color);
    color: #ffffff;
    border: none;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.back-to-top.show {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    background-color: #000000;
    transform: translateY(-5px);
}

.back-to-top i {
    font-size: 18px;
}

/* ===================================
   Animations
   =================================== */
.animate-element {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.animate-element.animated {
    opacity: 1;
    transform: translateY(0);
}
h1, h2, h3, h4, h5, h6 {
    font-family: 'Vidaloka', serif;
    /* color: #202020; */
    margin-top: 0px;
    margin-bottom: .7rem;
    line-height: 1.2;
    font-weight: 400;
    text-transform: inherit;
}
