/* My Home Buyers Survey - Main Stylesheet */
/* Optimized for Core Web Vitals and Performance */

/* CSS Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    /* Mobile tap highlight */
    -webkit-tap-highlight-color: rgba(26, 77, 143, 0.2);
}

:root {
    --primary-color: #1a4d8f;
    --secondary-color: #2c7ac4;
    --accent-color: #f39c12;
    --text-dark: #333;
    --text-light: #666;
    --bg-light: #f8f9fa;
    --white: #ffffff;
    --success: #27ae60;
    --border-color: #e0e0e0;
    --shadow: 0 2px 10px rgba(0,0,0,0.1);
    --shadow-hover: 0 4px 20px rgba(0,0,0,0.15);
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
    /* Mobile optimization */
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
}

body {
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    background-color: var(--white);
    overflow-x: hidden;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.2;
    margin-bottom: 1rem;
    color: var(--text-dark);
}

h1 {
    font-size: 2.5rem;
}

h2 {
    font-size: 2rem;
}

h3 {
    font-size: 1.5rem;
}

p {
    margin-bottom: 1rem;
    color: var(--text-light);
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.3s ease;
    /* Mobile-friendly touch target */
    min-height: 44px;
    display: inline-block;
    position: relative;
}

a:hover {
    color: var(--secondary-color);
}

a:focus {
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
}

a:active {
    opacity: 0.8;
}

/* Header & Navigation */
header {
    background-color: var(--white);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: all 0.3s ease;
}

nav {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-weight: bold;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
    align-items: center;
}

.nav-menu a {
    font-weight: 500;
    transition: color 0.3s ease;
    position: relative;
}

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

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

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

.nav-toggle span {
    width: 25px;
    height: 3px;
    background-color: var(--primary-color);
    transition: all 0.3s ease;
}

/* Hero Section */
.hero {
    position: relative;
    min-height: 90vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(26, 77, 143, 0.95), rgba(44, 122, 196, 0.9));
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(26, 77, 143, 0.85), rgba(44, 122, 196, 0.75));
    z-index: 2;
}

.hero-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 1;
    opacity: 1;
}

.hero-content-wrapper {
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
    padding: 2rem;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: center;
    position: relative;
    z-index: 3;
}

.hero-text {
    color: var(--white);
}

.hero h1 {
    color: var(--white);
    font-size: 3rem;
    margin-bottom: 1.5rem;
    line-height: 1.1;
}

.hero p {
    color: rgba(255, 255, 255, 0.95);
    font-size: 1.2rem;
    margin-bottom: 2rem;
}

.hero-form-container {
    background: var(--white);
    padding: 2.5rem;
    border-radius: 12px;
    box-shadow: var(--shadow-hover);
}

.hero-form-container h3 {
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    text-align: center;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.875rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    text-align: center;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    text-decoration: none;
}

.btn-primary {
    background: var(--accent-color);
    color: var(--white);
}

.btn-primary:hover {
    background: #e67e22;
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

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

.btn-secondary:hover {
    background: var(--primary-color);
    color: var(--white);
}

/* Section Styles */
section {
    padding: 5rem 2rem;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
}

.section-header {
    text-align: center;
    margin-bottom: 3rem;
}

.section-header h2 {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.section-header p {
    font-size: 1.1rem;
    max-width: 700px;
    margin: 0 auto;
}

/* Features Grid */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.feature-card {
    background: var(--white);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    border: 1px solid var(--border-color);
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

.feature-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
}

.feature-card h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
}

/* Services Section */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2.5rem;
    margin-top: 3rem;
}

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

.service-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-hover);
}

.service-image {
    width: 100%;
    height: 250px;
    object-fit: cover;
}

.service-content {
    padding: 2rem;
}

.service-card h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.service-price {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent-color);
    margin: 1rem 0;
}

.service-features {
    list-style: none;
    margin: 1.5rem 0;
}

.service-features li {
    padding: 0.5rem 0;
    color: var(--text-light);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.service-features li:before {
    content: '✓';
    color: var(--success);
    font-weight: bold;
}

/* Team Section */
.team-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2.5rem;
    margin-top: 3rem;
}

.team-member {
    background: var(--white);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    text-align: center;
}

.team-member:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

.team-image {
    width: 100%;
    height: 350px;
    object-fit: contain;
    background-color: #f8f9fa;
}

.team-info {
    padding: 2rem;
}

.team-member h3 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.team-role {
    color: var(--accent-color);
    font-weight: 600;
    margin-bottom: 1rem;
}

/* Testimonials */
.testimonials-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.testimonial-card {
    background: var(--white);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: var(--shadow);
    position: relative;
}

.quote-icon {
    font-size: 3rem;
    color: var(--accent-color);
    opacity: 0.3;
    position: absolute;
    top: 1rem;
    left: 1.5rem;
}

.testimonial-text {
    position: relative;
    z-index: 1;
    font-style: italic;
    margin-bottom: 1.5rem;
}

.testimonial-author {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.author-info h4 {
    color: var(--primary-color);
    margin-bottom: 0.25rem;
}

.stars {
    color: var(--accent-color);
    font-size: 1.2rem;
}

/* Areas Coverage */
.areas-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-top: 3rem;
}

.area-card {
    background: var(--white);
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    border-left: 4px solid var(--accent-color);
}

.area-card:hover {
    transform: translateX(5px);
    box-shadow: var(--shadow-hover);
}

.area-card h3 {
    color: var(--primary-color);
    font-size: 1.2rem;
}

/* FAQ Section */
.faq-container {
    max-width: 900px;
    margin: 3rem auto 0;
}

.faq-item {
    background: var(--white);
    margin-bottom: 1.5rem;
    border-radius: 8px;
    box-shadow: var(--shadow);
    overflow: hidden;
}

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

.faq-question:hover {
    background: #e8eef5;
}

.faq-icon {
    font-size: 1.5rem;
    transition: transform 0.3s ease;
}

.faq-item.active .faq-icon {
    transform: rotate(180deg);
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.5s ease-out, padding 0.5s ease-out, opacity 0.5s ease-out;
    padding: 0 1.5rem;
    background: var(--white);
    opacity: 0;
}

.faq-item.active .faq-answer {
    max-height: 9999px;
    padding: 1.5rem;
    opacity: 1;
}

/* Blog Grid */
.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 2.5rem;
    margin-top: 3rem;
}

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

.blog-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-hover);
}

.blog-image {
    width: 100%;
    height: 250px;
    object-fit: cover;
}

.blog-content {
    padding: 2rem;
}

.blog-meta {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    color: var(--text-light);
}

.blog-card h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-size: 1.3rem;
}

.blog-excerpt {
    color: var(--text-light);
    margin-bottom: 1.5rem;
}

.read-more {
    color: var(--accent-color);
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

/* Blog Article Page */
.blog-article {
    max-width: 900px;
    margin: 0 auto;
    padding: 5rem 2rem 3rem 2rem;
}

.article-header {
    margin-bottom: 3rem;
    position: static;
    z-index: auto;
}

.article-title {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
    position: static;
    z-index: auto;
}

.article-meta {
    display: flex;
    gap: 2rem;
    color: var(--text-light);
    margin-bottom: 2rem;
}

.article-image {
    width: 100%;
    max-height: 500px;
    object-fit: cover;
    border-radius: 12px;
    margin-bottom: 2rem;
}

.article-content {
    font-size: 1.1rem;
    line-height: 1.8;
}

.article-content h2 {
    margin-top: 2.5rem;
    margin-bottom: 1.5rem;
    color: var(--primary-color);
}

.article-content h3 {
    margin-top: 2rem;
    margin-bottom: 1rem;
    color: var(--secondary-color);
}

.article-content ul, .article-content ol {
    margin: 1.5rem 0 1.5rem 2rem;
}

.article-content li {
    margin-bottom: 0.5rem;
    color: var(--text-light);
}

.back-to-blog {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 2rem;
    color: var(--primary-color);
    font-weight: 600;
}

/* Contact Form */
.contact-section {
    background: var(--bg-light);
}

.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    margin-top: 3rem;
}

.contact-info h3 {
    color: var(--primary-color);
    margin-bottom: 1.5rem;
}

.contact-form {
    background: var(--white);
    padding: 2.5rem;
    border-radius: 12px;
    box-shadow: var(--shadow);
}

/* Footer */
footer {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: var(--white);
    padding: 3rem 2rem 1.5rem;
}

footer p {
    color: var(--white);
}

.footer-content {
    max-width: 1400px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 3rem;
    margin-bottom: 2rem;
}

.footer-section h3 {
    color: var(--white);
    margin-bottom: 1.5rem;
}

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

.footer-section ul li {
    margin-bottom: 0.75rem;
}

.footer-section a {
    color: var(--white);
    transition: color 0.3s ease;
}

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

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

.footer-bottom p {
    color: var(--white);
}

.footer-bottom a {
    color: var(--white);
    transition: color 0.3s ease;
}

.footer-bottom a:hover {
    color: var(--accent-color);
}

/* Responsive Design */
@media (max-width: 1024px) {
    .hero h1 {
        font-size: 2.5rem;
    }
    
    .hero-content-wrapper {
        grid-template-columns: 1fr;
    }
    
    .contact-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .nav-menu {
        position: fixed;
        left: -100%;
        top: 70px;
        flex-direction: column;
        background-color: var(--white);
        width: 100%;
        text-align: center;
        transition: 0.3s;
        box-shadow: var(--shadow);
        padding: 2rem 0;
        gap: 1rem;
        z-index: 999;
    }

    .nav-menu.active {
        left: 0;
    }
    
    .nav-menu a {
        padding: 1rem 1.5rem;
        font-size: 1.1rem;
        min-height: 48px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .nav-toggle {
        display: flex;
        min-width: 48px;
        min-height: 48px;
        padding: 12px;
    }
    
    /* Typography - Mobile Optimized */
    h1 {
        font-size: 1.875rem;
        line-height: 1.2;
    }
    
    h2 {
        font-size: 1.5rem;
        line-height: 1.3;
    }
    
    h3 {
        font-size: 1.25rem;
    }
    
    .hero h1 {
        font-size: 1.875rem;
        line-height: 1.2;
        margin-bottom: 1rem;
    }
    
    .hero p {
        font-size: 1rem;
        line-height: 1.6;
    }
    
    /* Body text - minimum 16px for mobile readability */
    body {
        font-size: 16px;
        line-height: 1.6;
    }
    
    p {
        font-size: 1rem;
        line-height: 1.6;
        margin-bottom: 1.25rem;
    }
    
    /* Grids - Single Column on Mobile */
    .features-grid,
    .services-grid,
    .team-grid,
    .areas-grid,
    .blog-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    /* Section Spacing - Optimized for Mobile */
    section {
        padding: 2.5rem 1.25rem;
    }
    
    .container {
        padding: 0 1.25rem;
    }
    
    /* Buttons - Touch-Friendly */
    .btn {
        padding: 1rem 2rem;
        font-size: 1rem;
        min-height: 48px;
        width: 100%;
        max-width: 100%;
        display: block;
        margin: 0.5rem 0;
    }
    
    /* Hero Section - Mobile Optimized */
    .hero {
        min-height: auto;
        padding: 4rem 1.25rem 3rem;
    }
    
    .hero-content-wrapper {
        gap: 2rem;
    }
    
    /* Form Optimization for Mobile */
    input[type="text"],
    input[type="email"],
    input[type="tel"],
    textarea,
    select {
        font-size: 16px !important; /* Prevents zoom on iOS */
        min-height: 48px;
        padding: 0.75rem 1rem;
    }
    
    textarea {
        min-height: 120px;
    }
    
    /* Service Cards - Mobile Stack */
    .service-card {
        margin-bottom: 1.5rem;
    }
    
    /* Tables - Responsive */
    .comparison-table {
        font-size: 0.875rem;
        overflow-x: auto;
        display: block;
    }
    
    .comparison-table th,
    .comparison-table td {
        padding: 0.75rem 0.5rem;
        font-size: 0.875rem;
    }
    
    /* Footer - Mobile Stack */
    .footer-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .footer-section {
        text-align: center;
    }
    
    /* FAQ - Mobile Friendly */
    .faq-question {
        padding: 1rem;
        font-size: 1rem;
    }
    
    .faq-answer {
        padding: 0 1rem;
        font-size: 0.95rem;
    }
    
    .faq-item.active .faq-answer {
        padding: 1rem;
    }
    
    /* Blog Cards - Mobile Optimized */
    .blog-card {
        margin-bottom: 1.5rem;
    }
    
    .blog-meta {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    /* Article Content - Mobile Reading */
    .article-content {
        padding: 1.25rem;
    }
    
    .article-content h2 {
        margin-top: 2rem;
        margin-bottom: 1rem;
    }
    
    .article-content h3 {
        margin-top: 1.5rem;
        margin-bottom: 0.75rem;
    }
    
    .article-content ul,
    .article-content ol {
        padding-left: 1.5rem;
    }
    
    .article-content li {
        margin-bottom: 0.75rem;
    }
    
    /* Images - Mobile Responsive */
    .article-image,
    .blog-image,
    .service-image {
        width: 100%;
        height: auto;
        margin: 1.5rem 0;
    }
    
    /* Stats - Mobile Stack */
    .stats {
        flex-direction: column;
        gap: 1.5rem;
    }
    
    /* Testimonials - Mobile Optimized */
    .testimonial {
        padding: 1.5rem;
    }
    
    /* Back to Top Button - Mobile Position */
    .back-to-top {
        bottom: 20px;
        right: 20px;
        width: 48px;
        height: 48px;
    }
    
    /* Areas Grid - Mobile Stack */
    .area-card {
        padding: 1.25rem;
    }
    
    /* Team Members - Mobile Cards */
    .team-member {
        max-width: 100%;
    }
    
    .team-image {
        height: 300px;
    }
}

/* Additional Mobile Breakpoint for Small Phones */
@media (max-width: 480px) {
    .hero h1 {
        font-size: 1.625rem;
    }
    
    h2 {
        font-size: 1.375rem;
    }
    
    section {
        padding: 2rem 1rem;
    }
    
    .btn {
        padding: 0.875rem 1.5rem;
        font-size: 0.95rem;
    }
    
    .comparison-table {
        font-size: 0.75rem;
    }
    
    .comparison-table th,
    .comparison-table td {
        padding: 0.5rem 0.25rem;
    }
}

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

.fade-in {
    animation: fadeInUp 0.6s ease-out;
}

/* Loading Optimization */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Security Headers Optimization */
.secure-content {
    content-security-policy: default-src 'self';
}

/* Performance Optimization */
* {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Accessibility */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Print Styles */
@media print {
    header, footer, .nav-menu {
        display: none;
    }
}