/* Preload critical fonts */
@font-face {
  font-family: 'Helvetica Neue';
  font-style: normal;
  font-weight: 300;
  font-display: swap;
  src: url('https://fonts.gstatic.com/s/helveticaneue/v70/1Ptsg8zYS_SKggPNyCg4TYFv.ttf') format('truetype');
}

@font-face {
  font-family: 'Helvetica Neue';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('https://fonts.gstatic.com/s/helveticaneue/v70/1Ptsg8zYS_SKggPNyC0TTYFv.ttf') format('truetype');
}

:root {
    --primary: #000; /* Black */
    --secondary: #D4AF37; /* Gold */
    --accent: #FFF; /* White */
    --text: #000; /* Black text */
    --text-light: #FFF; /* White text */
    --text-muted: #666; /* Gray text */
    --background: #FFF; /* White background */
    --background-dark: #000; /* Black background */
    --spacing: clamp(1rem, 2vw, 2rem);
    --font-primary: 'Helvetica Neue', -apple-system, blinkmacsystemfont, 'Segoe UI', roboto, sans-serif;
    --font-secondary: 'Times New Roman', serif;
}

/* Base Styles */
body {
    font-family: var(--font-primary);
    margin: 0;
    padding: 0;
    background: var(--background);
    color: var(--text);
    line-height: 1.6;
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Layout */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing);
}

/* Hero Section */
.hero {
    height: 100vh;
    background: linear-gradient(rgb(0 0 0 / 30%), rgb(0 0 0 / 30%)),
                url('https://images.unsplash.com/photo-1560448204-e02f11c3d0e2?auto=format&fit=crop&w=1350&q=80');
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgb(0 0 0 / 40%);
    z-index: 1;
}

.hero-content {
    max-width: 800px;
    margin: 0 auto;
    padding: var(--spacing);
    position: relative;
    z-index: 2;
    color: var(--text-light);
}

.hero img {
    max-width: 100%;
    height: auto;
}

@media (width <= 768px) {
    .hero img {
        display: none !important;
    }
}

/* Typography */
h1 {
    font-family: var(--font-primary);
    font-size: clamp(2.5rem, 8vw, 5rem);
    font-weight: 300;
    margin-bottom: 1rem;
    letter-spacing: -0.02em;
    line-height: 1.1;
}

h2 {
    font-family: var(--font-primary);
    font-size: clamp(1.8rem, 4vw, 3rem);
    font-weight: 300;
    margin-bottom: 1rem;
    letter-spacing: -0.01em;
    line-height: 1.2;
}

h3 {
    font-family: var(--font-primary);
    font-size: clamp(1.2rem, 2.5vw, 1.8rem);
    font-weight: 400;
    margin-bottom: 0.5rem;
    letter-spacing: -0.005em;
}

p {
    font-family: var(--font-primary);
    font-size: clamp(1rem, 1.5vw, 1.1rem);
    font-weight: 400;
    margin-bottom: 1.5rem;
    line-height: 1.6;
    color: var(--text-muted);
}

/* Image Text Grid */
.image-text-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: calc(var(--spacing) * 2);
    align-items: center;
    padding: calc(var(--spacing) * 3) 0;
}

.image-content img {
    width: 100%;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgb(0 0 0 / 30%);
}

/* Buttons */
.cta-button, .contact-button {
    display: inline-block;
    background: transparent;
    color: var(--text-light);
    text-decoration: none;
    padding: 1rem 2rem;
    border: 2px solid var(--secondary);
    font-size: 1rem;
    font-weight: 400;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.cta-button::before, .contact-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: var(--secondary);
    transition: left 0.3s ease;
    z-index: -1;
}

.cta-button:hover, .contact-button:hover {
    color: var(--background-dark);
}

.cta-button:hover::before, .contact-button:hover::before {
    left: 0;
}

.submit-button {
    width: 100%;
    padding: 1rem;
    background: var(--background-dark);
    color: var(--text-light);
    border: 2px solid var(--background-dark);
    font-size: 1rem;
    font-weight: 400;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.3s ease;
}

.submit-button:hover {
    background: var(--secondary);
    border-color: var(--secondary);
    color: var(--background-dark);
}

/* Services Section */
.services-section {
    padding: calc(var(--spacing) * 4) 0;
    background: var(--background);
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: calc(var(--spacing) * 3);
    margin-top: calc(var(--spacing) * 2);
}

.service-item {
    background: var(--background);
    border: 1px solid #e5e5e5;
    padding: calc(var(--spacing) * 2);
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
    position: relative;
}

.service-item:hover {
    border-color: var(--secondary);
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgb(0 0 0 / 10%);
}

.service-item h3 {
    color: var(--text);
    margin-bottom: calc(var(--spacing) * 0.5);
    font-size: 1.4rem;
    font-weight: 400;
}

/* Navigation */
.home-link {
    position: fixed;
    top: 20px;
    left: 20px;
    color: var(--text);
    text-decoration: none;
    z-index: 100;
    padding: 10px;
    background: rgb(0 0 0 / 50%);
    border-radius: 5px;
}

/* Contact CTA Section */
.contact-cta {
    text-align: center;
    padding: calc(var(--spacing) * 4) 0;
    background: var(--background);
    border-top: 1px solid #e5e5e5;
    border-bottom: 1px solid #e5e5e5;
    margin-top: 2rem;
}

/* Footer */
.footer {
    text-align: center;
    padding: calc(var(--spacing) * 2) 0;
    background: var(--background-dark);
    color: var(--text-light);
    font-size: 0.9rem;
}

.footer .container {
    padding: 24px 0;
    text-align: center;
}

/* Newsletter Section */
.newsletter-form {
    max-width: 400px;
    margin: 0 auto;
}

.newsletter-input {
    margin-bottom: 1rem;
}

.newsletter-submit {
    width: 100%;
}

/* Responsive Design */
@media (width <= 768px) {
    .image-text-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing);
    }
    
    .text-content {
        order: 2;
    }
    
    .image-content {
        order: 1;
    }
}

/* Form Section */
.form-section {
    max-width: 600px;
    margin: 0 auto;
    padding: calc(var(--spacing) * 4) var(--spacing);
    background: var(--background);
}

.form-group {
    margin-bottom: calc(var(--spacing) * 1.5);
}

.form-group label {
    display: block;
    margin-bottom: calc(var(--spacing) * 0.5);
    font-weight: 400;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

.form-group input,
.form-group select {
    width: 100%;
    padding: calc(var(--spacing) * 0.75);
    border: 1px solid #e5e5e5;
    border-radius: 0;
    background: var(--background);
    color: var(--text);
    font-size: 1rem;
    font-family: var(--font-primary);
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--secondary);
}

/* Admin Access Styles */
#admin-access {
    position: fixed;
    bottom: 10px;
    left: 10px;
    z-index: 9999;
}

#admin-login-btn {
    background: rgb(102 126 234 / 40%);
    border: 2px solid rgb(102 126 234 / 60%);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    opacity: 0.7;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: white;
    box-shadow: 0 2px 10px rgb(0 0 0 / 20%);
}

#admin-login-btn:hover {
    opacity: 1;
    background: rgb(102 126 234 / 80%);
    transform: scale(1.1);
}

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

@media (width <= 768px) {
    .form-section {
        padding: 2rem 1rem;
    }
}

/* Villa Gallery Styles */
.villa-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin: 3rem 0;
}

.villa-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgb(0 0 0 / 10%);
    transition: transform 0.3s;
}

.villa-card:hover {
    transform: translateY(-5px);
}

.villa-image {
    position: relative;
    height: 200px;
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: flex-end;
}

.villa-overlay {
    background: linear-gradient(transparent, rgb(0 0 0 / 70%));
    width: 100%;
    padding: 1.5rem;
    color: white;
}

.villa-title {
    margin: 0;
    font-size: 1.3rem;
    text-shadow: 2px 2px 4px rgb(0 0 0 / 50%);
}

.villa-price {
    margin: 0.5rem 0;
    font-size: 1rem;
    font-weight: bold;
}

.villa-location {
    opacity: 0.9;
    font-size: 0.9rem;
}

.villa-details {
    padding: 1rem;
}

.villa-description {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

@media (width <= 768px) {
    .villa-gallery { 
        grid-template-columns: 1fr; 
        gap: 1rem; 
        margin: 2rem 0; 
    }
}

/* Villa Background Images */
.villa-image-1 {
    background-image: url('https://images.unsplash.com/photo-1613977257363-707ba9348227?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=2340&q=80');
}

.villa-image-2 {
    background-image: url('https://images.unsplash.com/photo-1600596542815-ffad4c1539a9?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=2075&q=80');
}

.villa-image-3 {
    background-image: url('https://images.unsplash.com/photo-1560448204-e02f11c3d0e2?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=2070&q=80');
}

.villa-image-4 {
    background-image: url('https://images.unsplash.com/photo-1571896349842-33c89424de2d?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=2080&q=80');
}

/* Property Matching Styles */
.property-matching-title {
    text-align: center;
    color: var(--primary);
    margin-bottom: 10px;
}

.property-matching-subtitle {
    text-align: center;
    color: #666;
    margin-bottom: 30px;
}

.loading-subtitle {
    font-size: 0.9rem;
    color: #666;
    margin-top: 10px;
}

.properties-title {
    text-align: center;
    color: var(--primary);
    margin-bottom: 40px;
}

.empty-icon {
    font-size: 4rem;
    margin-bottom: 20px;
}

.hidden {
    display: none;
}

/* Language Switcher */
.lang-switcher {
    position: fixed;
    top: 30px;
    right: 30px;
    z-index: 1000;
    background: transparent;
    padding: 0;
    border-radius: 0;
}

.lang-switcher a {
    color: var(--text-light);
    text-decoration: none;
    margin: 0 15px;
    font-size: 0.9rem;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: color 0.3s ease;
    opacity: 0.7;
}

.lang-switcher a:hover {
    opacity: 1;
    color: var(--secondary);
}

/* Admin Login Styles */
.admin-login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary);
    padding: 20px;
}

.login-card {
    background: var(--background);
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 40px rgb(0 0 0 / 10%);
    width: 100%;
    max-width: 400px;
    text-align: center;
}

.login-logo {
    width: 80px;
    height: 80px;
    background: var(--secondary);
    border-radius: 50%;
    margin: 0 auto 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    font-size: 24px;
    font-weight: bold;
}

.login-title {
    color: var(--text);
    margin-bottom: 10px;
    font-size: 24px;
    font-weight: 600;
}

.login-subtitle {
    color: var(--text-muted);
    margin-bottom: 30px;
    font-size: 14px;
}

.form-group {
    margin-bottom: 20px;
    text-align: left;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    color: var(--text);
    font-weight: 500;
    font-size: 14px;
}

.form-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s;
    box-sizing: border-box;
}

.form-input:focus {
    outline: none;
    border-color: var(--secondary);
}

.login-button {
    width: 100%;
    padding: 14px;
    background: var(--secondary);
    color: var(--primary);
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    margin-top: 10px;
}

.login-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgb(212 175 55 / 30%);
}

.login-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.error-message {
    background: #fee;
    color: #c33;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
    display: none;
}

.success-message {
    background: #efe;
    color: #363;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
    display: none;
}

.intercom-link {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.intercom-link p {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 10px;
}

.intercom-button {
    display: inline-flex;
    align-items: center;
    padding: 10px 20px;
    background: var(--secondary);
    color: var(--primary);
    text-decoration: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    transition: background-color 0.2s;
}

.intercom-button:hover {
    background: #B8860B;
}

.intercom-icon {
    width: 16px;
    height: 16px;
    margin-right: 8px;
}

/* Admin Dashboard Styles */
.dashboard-header {
    background: var(--background);
    border-bottom: 1px solid #e2e8f0;
    padding: 16px 24px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
}

.dashboard-title {
    font-size: 24px;
    font-weight: 600;
    color: var(--text);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: #f1f5f9;
    border-radius: 8px;
    font-size: 14px;
}

.logout-button {
    padding: 8px 16px;
    background: #ef4444;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.logout-button:hover {
    background: #dc2626;
}

.dashboard-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.stat-card {
    background: var(--background);
    border-radius: 12px;
    padding: 24px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 3px rgb(0 0 0 / 10%);
}

.stat-number {
    font-size: 32px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 8px;
}

.stat-label {
    font-size: 14px;
    color: var(--text-muted);
    font-weight: 500;
}

.intercom-section {
    background: var(--background);
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    overflow: hidden;
    margin-bottom: 32px;
}

.section-header {
    padding: 20px 24px;
    border-bottom: 1px solid #e2e8f0;
    background: #f8fafc;
}

.section-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 8px;
}

.section-subtitle {
    font-size: 14px;
    color: var(--text-muted);
}

.intercom-container {
    padding: 24px;
}

.intercom-actions {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.action-button {
    display: inline-flex;
    align-items: center;
    padding: 12px 20px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
    transition: all 0.2s;
    border: none;
    cursor: pointer;
}

.action-button.primary {
    background: var(--secondary);
    color: var(--primary);
}

.action-button.primary:hover {
    background: #B8860B;
    transform: translateY(-1px);
}

.action-button.secondary {
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #e2e8f0;
}

.action-button.secondary:hover {
    background: #e2e8f0;
}

.intercom-embed {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
    height: 600px;
    background: #f8fafc;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 16px;
}

.embed-placeholder {
    text-align: center;
    color: var(--text-muted);
}

.embed-icon {
    width: 64px;
    height: 64px;
    background: #e2e8f0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
}

.quick-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.quick-action-card {
    background: var(--background);
    border-radius: 12px;
    padding: 24px;
    border: 1px solid #e2e8f0;
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
}

.quick-action-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgb(0 0 0 / 10%);
}

.action-icon {
    width: 48px;
    height: 48px;
    background: var(--secondary);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    color: var(--primary);
}

.action-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 8px;
}

.action-description {
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.5;
}

.chat-mode-toggle {
    margin-bottom: 24px;
    padding: 16px;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.chat-mode-title {
    margin: 0 0 12px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
}

.chat-mode-options {
    display: flex;
    gap: 16px;
    align-items: center;
}

.chat-mode-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.chat-mode-span {
    font-size: 14px;
    color: #475569;
}

.chat-mode-description {
    margin: 8px 0 0;
    font-size: 12px;
    color: var(--text-muted);
}

.svg-margin {
    margin-right: 8px;
}

.conversations-container {
    display: none;
}

.conversations-list {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    margin-bottom: 16px;
}

.conversation-detail {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    min-height: 300px;
    display: none;
}

.embed-app-id {
    margin-top: 8px;
    font-size: 12px;
    color: #94a3b8;
}

.admin-modal {
    position: fixed;
    inset: 0;
    background: rgb(0 0 0 / 50%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

@media (width <= 768px) {
    .dashboard-container {
        padding: 16px;
    }

    .header-content {
        flex-direction: column;
        gap: 16px;
        align-items: flex-start;
    }

    .intercom-actions {
        flex-direction: column;
    }

    .action-button {
        justify-content: center;
    }
}