@import url('loader.css');
@import url('cursor.css');

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

html {
    scroll-behavior: smooth;
    height: 100%;
}

body {
    font-family: var(--font-body);
    color: var(--text-primary);
    background-color: var(--bg-primary);
    line-height: 1.8;
    overflow-x: hidden;
    font-weight: 300;
    position: relative;

    /* Layout Fix for Sticky Footer */
    min-height: 100svh;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1 0 auto;
    width: 100%;
}

footer {
    margin-top: auto;
    width: 100%;
}

/* Global Parallax Background */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: var(--bg-image-global);
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    /* Parallax feel */
    z-index: -2;
    opacity: 0.15;
    /* Subtle texture behind everything */
    filter: grayscale(100%);
    /* Elegant monochrome backing */
    pointer-events: none;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-heading);
    font-weight: 400;
    /* Lighter weight for luxury */
    color: var(--text-primary);
    margin-bottom: var(--spacing-sm);
    letter-spacing: -0.02em;
    line-height: 1.1;
}

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

ul {
    list-style: none;
}

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

/* Utilities */
.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 var(--spacing-md);
}

.section-padding {
    padding: var(--spacing-xl) 0;
}

/* --- PREMIUM BUTTON SYSTEM (REFINED) --- */

/* 1. Primary CTA (Organic Luxury) */
.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 18px 48px;
    background: linear-gradient(135deg, #1a1a1a 0%, #333 100%);
    color: var(--text-light);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 60% 40% 70% 30% / 50%;
    /* Subtle organic shape */
    font-family: var(--font-body);
    font-weight: 500;
    font-size: 0.9rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: all 0.5s ease;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

/* Metallic Sheen */
.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -150%;
    width: 150%;
    height: 100%;
    background-color: rgba(212, 175, 55, 0.2);
    transform: skewX(-20deg);
    transition: 0.6s ease;
}

.btn-primary:hover {
    transform: translateY(-3px) scale(1.02);
    border-radius: 50px;
    /* Morphs to perfect pill on hover */
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.25);
    background: #000;
    border-color: var(--accent-gold);
}

.btn-primary:hover::before {
    left: 150%;
}

/* 2. Secondary CTA (Glassy/Outline) */
.btn-secondary {
    display: inline-block;
    padding: 16px 42px;
    background-color: transparent;
    color: var(--text-primary);
    border: 1px solid currentColor;
    border-radius: 50px;
    font-family: var(--font-body);
    font-weight: 500;
    font-size: 0.9rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.21, 1, 0.36, 1);
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.btn-secondary::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--text-primary);
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.4s cubic-bezier(0.21, 1, 0.36, 1);
    z-index: -1;
}

.btn-secondary:hover {
    color: var(--text-light);
    border-color: transparent;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

.btn-secondary:hover::after {
    transform: scaleX(1);
    transform-origin: left;
}

/* --- HEADER STYLES --- */
#main-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 10000;
    transition: background-color 0.3s ease, backdrop-filter 0.3s ease, border-bottom-color 0.3s ease, color 0.3s ease;
    border-bottom: 1px solid transparent;
}

#main-header.scrolled {
    background-color: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom-color: rgba(0, 0, 0, 0.05);
}

/* --- LISTINGS PAGE WHITE THEME --- */
body.page-listings {
    background-color: #FFFFFF;
    color: var(--text-primary);
}

/* Override global background image for listings */
body.page-listings::before {
    display: none;
}

body.page-listings h1,
body.page-listings h2,
body.page-listings h3,
body.page-listings h4,
body.page-listings h5,
body.page-listings h6 {
    color: var(--text-primary);
}

body.page-listings p,
body.page-listings span,
body.page-listings li {
    color: var(--text-primary);
}

body.page-listings .text-muted {
    color: var(--text-secondary);
}

/* Header adaptation for white theme */
body.page-listings #main-header.scrolled {
    background-color: rgba(255, 255, 255, 0.95);
    border-bottom-color: rgba(0, 0, 0, 0.05);
}

body.page-listings .logo, 
body.page-listings #menu-toggle {
     color: var(--text-primary) !important;
}

body.page-listings #language-switcher {
    color: var(--text-primary) !important;
}

/* Filters */
body.page-listings .filters-container {
    background-color: #F9F9F9 !important;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

body.page-listings .filters-container label {
    color: var(--text-primary) !important;
}

body.page-listings select {
    background-color: #FFFFFF !important;
    color: var(--text-primary) !important;
    border-color: rgba(0, 0, 0, 0.1) !important;
}

body.page-listings select option {
    background-color: #FFFFFF;
    color: var(--text-primary);
}

/* Cards */
body.page-listings .villa-card {
    background-color: #FFFFFF !important;
    border: 1px solid rgba(0, 0, 0, 0.05) !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05) !important;
}

body.page-listings .villa-card .card-body {
    background-color: #FFFFFF !important;
    color: var(--text-primary);
}

body.page-listings .villa-card h3 {
    color: var(--text-primary) !important;
}

body.page-listings .villa-card strong {
    color: var(--text-primary) !important;
}

body.page-listings .villa-card p {
    color: var(--text-secondary) !important;
}

/* Buttons in White Theme */
body.page-listings .btn-secondary {
    color: var(--text-primary);
    border-color: var(--text-primary);
}

body.page-listings .btn-secondary:hover {
    background-color: var(--text-primary);
    color: #FFFFFF;
}

body.page-listings .btn-secondary::after {
    background-color: var(--text-primary);
}

/* Footer adaptation */
body.page-listings footer {
    border-top: 1px solid rgba(0,0,0,0.05);
}

/* Responsive Header Height */
@media (max-width: 768px) {
    :root {
        --header-height: 80px;
    }
}

/* Content Offset */
body {
    padding-top: var(--header-height);
}

body.no-padding {
    padding-top: 0;
}

/* Scroll Margin for Anchors */
section, [id] {
    scroll-margin-top: calc(var(--header-height) + 20px);
}

/* --- CONTACT PAGE HEADER FIX --- */
body.page-contact #main-header {
    color: #FFFFFF;
}

body.page-contact #main-header.scrolled {
    background-color: rgba(0, 0, 0, 0.85); /* Darker background on scroll for contact page */
    color: #FFFFFF;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

body.page-contact .lang-btn,
body.page-contact #menu-toggle {
    color: #FFFFFF !important;
}

/* --- CUSTOM LANGUAGE SWITCHER --- */
.custom-lang-dropdown {
    position: relative;
    font-family: var(--font-body);
}

.lang-btn {
    background: transparent;
    border: 1px solid rgba(255,255,255,0.2);
    color: inherit;
    padding: 8px 16px;
    border-radius: 30px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

/* In white theme (listings), button border needs to be visible */
body.page-listings .lang-btn {
    border-color: rgba(0,0,0,0.1);
}

.lang-btn:hover {
    background: rgba(255,255,255,0.1);
}

body.page-listings .lang-btn:hover {
    background: rgba(0,0,0,0.05);
}

.lang-list {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 10px;
    background: #FFFFFF;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    min-width: 160px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s ease;
    z-index: 1005;
    overflow: hidden;
}

.custom-lang-dropdown.active .lang-list {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.lang-list li {
    padding: 12px 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #333; /* Always dark text in dropdown */
    cursor: pointer;
    transition: background 0.2s;
    font-size: 0.95rem;
}

.lang-list li:hover {
    background: #f5f5f5;
}

.lang-list li.selected {
    font-weight: 600;
    background: #f9f9f9;
}

.flag-icon {
    font-size: 1.2rem;
    line-height: 1;
}
