/* Hampstead Surveyors - Modern CSS Styling */

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

:root {
    --primary-color: #1a365d;
    --secondary-color: #2d5a87;
    --accent-color: #3182ce;
    --text-dark: #2d3748;
    --text-light: #718096;
    --gold: #d4af37;
    --background-light: #f7fafc;
    --white: #ffffff;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    --gradient: linear-gradient(135deg, #1a365d 0%, #2d5a87 100%);
}

html {
    scroll-behavior: smooth;
}

/* Mobile scroll optimization */
@supports (-webkit-overflow-scrolling: touch) {
    body {
        -webkit-overflow-scrolling: touch;
    }
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    background-color: var(--white);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Header & Navigation */
.header {
    background: rgba(26, 54, 93, 0.95);
    backdrop-filter: blur(10px);
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
    will-change: background-color, box-shadow;
    transform: translateZ(0);
}

.header.scrolled {
    background: rgba(26, 54, 93, 0.98);
    box-shadow: var(--shadow);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 80px;
}

.logo {
    font-size: 28px;
    font-weight: 700;
    color: var(--white);
    text-decoration: none;
    letter-spacing: -0.5px;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 30px;
}

.nav-menu a {
    color: var(--white);
    text-decoration: none;
    font-weight: 500;
    font-size: 16px;
    transition: color 0.3s ease;
    position: relative;
}

.nav-menu a:hover {
    color: var(--gold);
}

.nav-menu a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--gold);
    transition: width 0.3s ease;
}

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

.nav-toggle {
    display: none;
    flex-direction: column;
    cursor: pointer;
}

.nav-toggle span {
    width: 25px;
    height: 3px;
    background: var(--white);
    margin: 3px 0;
    transition: 0.3s;
}

/* Hero Section */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
    padding: 80px 0 40px 0;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(26, 54, 93, 0.1);
    z-index: 1;
}

/* Hero Background System - Improved for smooth transitions */
.hero {
    position: relative;
}

.hero-bg-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: scroll;
    opacity: 0;
    transition: opacity 1.2s ease-in-out;
    z-index: 0;
    transform: translate3d(0, 0, 0);
}

.hero-bg-layer.active {
    opacity: 1;
}

.hero-bg-layer.bg-1 {
    background-image: linear-gradient(rgba(26, 54, 93, 0.6), rgba(45, 90, 135, 0.6)), url('../images/hero-hampstead-aerial.jpg');
}

.hero-bg-layer.bg-2 {
    background-image: linear-gradient(rgba(26, 54, 93, 0.6), rgba(45, 90, 135, 0.6)), url('../images/hero-georgian-terrace.jpg');
}

.hero-bg-layer.bg-3 {
    background-image: linear-gradient(rgba(26, 54, 93, 0.6), rgba(45, 90, 135, 0.6)), url('../images/hero-modern-luxury.jpg');
}

/* Hero Background Indicators */
.hero-bg-indicators {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 12px;
    z-index: 15;
}

.bg-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.4);
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.bg-indicator.active {
    background: rgba(255, 255, 255, 0.9);
    border-color: rgba(255, 255, 255, 0.6);
    transform: scale(1.2);
}

.bg-indicator:hover {
    background: rgba(255, 255, 255, 0.7);
    transform: scale(1.1);
}

.bg-indicator:focus {
    outline: 2px solid rgba(255, 255, 255, 0.8);
    outline-offset: 2px;
    background: rgba(255, 255, 255, 0.7);
}

/* Background transition effects */
.hero {
    background-attachment: scroll; /* Better performance on mobile */
}

@media (max-width: 768px) {
    .hero-bg-indicators {
        bottom: 20px;
    }
    
    .bg-indicator {
        width: 10px;
        height: 10px;
    }
    
    .hero {
        background-attachment: scroll;
    }
}

/* Performance optimizations */
.hero-container,
.hero-content,
.contact-form-container {
    transform: translateZ(0);
}

/* Scroll optimization */
.hero {
    contain: layout style paint;
}

.section {
    contain: layout style;
}

/* Optimize repaints during scroll */
.header,
.hero-bg-indicators {
    contain: layout style paint;
}

/* Prevent layout shifts during scroll */
img {
    max-width: 100%;
    height: auto;
}

/* Optimize transforms for better performance */
.cta-button:hover {
    transform: translate3d(0, -3px, 0);
}

.service-card:hover {
    transform: translate3d(0, -10px, 0);
}

/* Reduced motion accessibility */
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
    
    .hero,
    .hero-bg-layer,
    .bg-indicator,
    .cta-button,
    .service-card {
        transition: none;
        transform: none;
    }
}

.hero-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 60px;
    align-items: start;
    position: relative;
    z-index: 5;
    width: 100%;
    box-sizing: border-box;
    min-height: calc(100vh - 160px);
}

.hero-content {
    align-self: start;
    margin-top: 60px;
}

.hero-content h1 {
    font-size: 3.5rem;
    font-weight: 800;
    color: var(--white);
    line-height: 1.1;
    margin-bottom: 20px;
    animation: slideInUp 1s ease-out;
}

.hero-content p {
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 30px;
    animation: slideInUp 1s ease-out 0.2s both;
}

.cta-button {
    background: var(--gradient);
    color: var(--white);
    padding: 18px 40px;
    border: none;
    border-radius: 8px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    transition: all 0.3s ease;
    box-shadow: var(--shadow);
    animation: slideInUp 1s ease-out 0.4s both;
}

.cta-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.2);
}

/* Contact Form Styling */
.contact-form-container {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 40px;
    border-radius: 15px;
    box-shadow: var(--shadow);
    animation: slideInRight 1s ease-out 0.6s both;
    width: 100%;
    max-width: 450px;
    justify-self: end;
    align-self: start;
    margin-top: 40px;
    position: relative;
    overflow: visible;
}

.contact-form-container h3 {
    color: var(--primary-color);
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 20px;
    text-align: center;
}



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

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 15px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s ease;
    font-family: inherit;
}

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

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: var(--text-dark);
}

/* Sections */
.section {
    padding: 100px 0;
}

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

.section-title {
    text-align: center;
    margin-bottom: 60px;
}

.section-title h2 {
    font-size: 3rem;
    font-weight: 800;
    color: var(--primary-color);
    margin-bottom: 20px;
}

.section-title p {
    font-size: 1.2rem;
    color: var(--text-light);
    max-width: 600px;
    margin: 0 auto;
}

/* Services Grid */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 40px;
    margin: 60px 0;
}

.service-card {
    background: var(--white);
    padding: 40px 30px;
    border-radius: 15px;
    box-shadow: var(--shadow);
    text-align: center;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 4px;
    background: var(--gradient);
    transition: left 0.3s ease;
}

.service-card:hover::before {
    left: 0;
}

.service-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15);
}

.service-icon {
    width: 80px;
    height: 80px;
    background: var(--gradient);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    font-size: 2rem;
    color: var(--white);
}

.service-card h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 15px;
}

.service-card p {
    color: var(--text-light);
    line-height: 1.6;
}

.location-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 10px;
    margin-bottom: 20px;
}

/* Features Section */
.features {
    background: var(--background-light);
}

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

.feature-item {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

.feature-icon {
    width: 60px;
    height: 60px;
    background: var(--gradient);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--white);
    flex-shrink: 0;
}

.feature-content h4 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 10px;
}

.feature-content p {
    color: var(--text-light);
}

/* Reviews Section */
.reviews {
    background: var(--primary-color);
    color: var(--white);
}

.reviews .section-title h2,
.reviews .section-title p {
    color: var(--white);
}

.reviews-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 40px;
}

.review-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    padding: 30px;
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.stars {
    color: var(--gold);
    font-size: 1.2rem;
    margin-bottom: 15px;
}

.review-text {
    font-size: 1.1rem;
    line-height: 1.6;
    margin-bottom: 20px;
    font-style: italic;
}

.reviewer {
    font-weight: 600;
    color: var(--gold);
}

.reviewer-title {
    font-size: 0.9rem;
    opacity: 0.8;
}

/* Video Section */
.video-showcase {
    padding: 100px 0;
    background: var(--background-light);
}

.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 40px;
    margin-top: 60px;
}

.video-item {
    position: relative;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.3s ease;
}

.video-item:hover {
    transform: scale(1.05);
}

.video-item video {
    width: 100%;
    height: 250px;
    object-fit: cover;
}

.video-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
    padding: 30px 20px 20px;
    color: var(--white);
}

.video-overlay h4 {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 5px;
}

/* Footer */
.footer {
    background: var(--primary-color);
    color: var(--white);
    padding: 60px 0 30px;
}

.footer-content {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 40px;
    margin-bottom: 40px;
}

.footer-section h3 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 20px;
    color: var(--gold);
}

.footer-section p,
.footer-section li {
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.8;
}

.footer-section ul {
    list-style: none;
}

.footer-section a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-section a:hover {
    color: var(--gold);
}

.footer-bottom {
    text-align: center;
    padding-top: 30px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.6);
}

/* Optimized Animations for better scroll performance */
@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translate3d(0, 50px, 0);
    }
    to {
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translate3d(50px, 0, 0);
    }
    to {
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }
}

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

/* Scroll animations */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Responsive Design */
@media (max-width: 768px) {
    .nav-menu {
        position: fixed;
        top: 80px;
        left: -100%;
        width: 100%;
        height: calc(100vh - 80px);
        background: var(--primary-color);
        flex-direction: column;
        justify-content: flex-start;
        padding-top: 50px;
        transition: left 0.3s ease;
    }

    .nav-menu.active {
        left: 0;
    }

    .nav-toggle {
        display: flex;
    }

    .hero-container {
        grid-template-columns: 1fr;
        gap: 40px;
        text-align: center;
        padding: 40px 20px;
        height: auto;
        min-height: auto;
        align-items: flex-start;
    }

    .hero-content h1 {
        font-size: 2.5rem;
    }

    .contact-form-container {
        padding: 30px 20px;
        margin: 20px auto 0;
        max-width: 100%;
        width: 100%;
        box-sizing: border-box;
        align-self: start;
        justify-self: center;
    }

    .section-title h2 {
        font-size: 2.2rem;
    }

    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .services-grid,
    .reviews-grid,
    .video-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .hero-content h1 {
        font-size: 2rem;
    }

    .hero-content p {
        font-size: 1rem;
    }

    .hero {
        min-height: auto;
        padding: 60px 0 20px 0;
    }
    
    .hero-content {
        margin-top: 20px;
    }
    
    .contact-form-container {
        margin-top: 30px;
        padding: 25px 15px;
    }

    .service-card {
        padding: 30px 20px;
    }
}

/* Blog Styles */
.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 40px;
    margin-top: 60px;
}

.blog-card {
    background: var(--white);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
}

.blog-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15);
}

.blog-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.blog-card-content {
    padding: 30px;
}

.blog-card h3 {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 15px;
    line-height: 1.3;
}

.blog-card p {
    color: var(--text-light);
    margin-bottom: 20px;
    line-height: 1.6;
}

.blog-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
    color: var(--text-light);
    margin-bottom: 15px;
}

.read-more {
    color: var(--accent-color);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

.read-more:hover {
    color: var(--primary-color);
}

/* Article page styles */
.article-header {
    background: var(--gradient);
    color: var(--white);
    padding: 150px 0 100px;
    text-align: center;
}

.article-title {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 20px;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.article-meta {
    font-size: 1.1rem;
    opacity: 0.9;
}

.article-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 60px 20px;
    line-height: 1.8;
}

.article-content h2 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
    margin: 40px 0 20px;
}

.article-content h3 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--primary-color);
    margin: 30px 0 15px;
}

.article-content p {
    margin-bottom: 20px;
    color: var(--text-dark);
}

.article-content ul, .article-content ol {
    margin: 20px 0;
    padding-left: 30px;
}

.article-content li {
    margin-bottom: 10px;
}

.article-content img {
    width: 100%;
    height: auto;
    border-radius: 10px;
    margin: 30px 0;
    box-shadow: var(--shadow);
}

/* FAQ Styles */
.faq-section {
    background: var(--background-light);
    padding: 80px 0;
}

.faq-item {
    background: var(--white);
    border-radius: 10px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

.faq-question {
    padding: 25px 30px;
    font-weight: 600;
    color: var(--primary-color);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background-color 0.3s ease;
}

.faq-question:hover {
    background: var(--background-light);
}

.faq-answer {
    padding: 0 30px;
    max-height: 0;
    overflow: hidden;
    transition: all 0.3s ease;
}

.faq-answer.active {
    padding: 20px 30px;
    max-height: 500px;
}

.faq-toggle {
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--accent-color);
    transition: transform 0.3s ease;
}

.faq-toggle.active {
    transform: rotate(45deg);
}

/* Loading Animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: var(--white);
    animation: spin 1s ease-in-out infinite;
}

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

/* Utility Classes */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }
.mb-0 { margin-bottom: 0; }
.mb-20 { margin-bottom: 20px; }
.mb-40 { margin-bottom: 40px; }
.mt-40 { margin-top: 40px; }
.hidden { display: none; }