/* Topo Surveyor - Main Stylesheet */
/* Mobile-First Responsive Design */

:root {
    --primary-color: #0066cc;
    --secondary-color: #004d99;
    --accent-color: #ff6600;
    --text-dark: #222222;
    --text-light: #666666;
    --bg-light: #f8f9fa;
    --white: #ffffff;
    --border-color: #e0e0e0;
    --success-color: #28a745;
    --transition: all 0.3s ease;
}

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

html {
    scroll-behavior: smooth;
    font-size: 16px;
    -webkit-text-size-adjust: 100%; /* Prevents text scaling on iOS */
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0); /* Removes tap highlight on mobile */
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, 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;
}

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

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
    -webkit-tap-highlight-color: rgba(0, 102, 204, 0.2); /* Better tap feedback */
}

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

h1 { font-size: 2rem; }
h2 { font-size: 1.75rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }
h5 { font-size: 1.1rem; }
h6 { font-size: 1rem; }

p {
    margin-bottom: 1rem;
}

/* Container */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header & Navigation */
header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: var(--white);
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    z-index: 1000;
}

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

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

.nav-toggle {
    display: block;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    min-height: 44px; /* iOS minimum touch target */
    min-width: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    touch-action: manipulation;
}

.nav-toggle span {
    display: block;
    width: 25px;
    height: 3px;
    background: var(--text-dark);
    margin: 3px 0;
    transition: var(--transition);
    border-radius: 2px;
}

nav {
    position: fixed;
    top: 70px;
    left: -100%;
    width: 100%;
    height: calc(100vh - 70px);
    background: var(--white);
    transition: left 0.3s ease;
    overflow-y: auto;
}

nav.active {
    left: 0;
}

nav ul {
    list-style: none;
    padding: 2rem 20px;
}

nav ul li {
    margin: 1rem 0;
}

nav ul li a {
    display: block;
    padding: 0.75rem 1rem;
    color: var(--text-dark);
    font-weight: 500;
    border-radius: 5px;
    transition: var(--transition);
}

nav ul li a:hover,
nav ul li a.active {
    background: var(--primary-color);
    color: var(--white);
}

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

.hero-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

.hero-background video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    width: 100%;
    padding: 2rem 20px;
}

.hero-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    align-items: center;
}

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

.hero-text h1 {
    font-size: 2rem;
    margin-bottom: 1rem;
    animation: fadeInUp 0.8s ease;
}

.hero-text p {
    font-size: 1.1rem;
    margin-bottom: 2rem;
    animation: fadeInUp 0.8s ease 0.2s both;
}

.cta-button {
    display: inline-block;
    padding: 1rem 2rem;
    background: var(--accent-color);
    color: var(--white);
    border-radius: 5px;
    font-weight: 600;
    transition: var(--transition);
    animation: fadeInUp 0.8s ease 0.4s both;
    min-height: 44px; /* iOS minimum touch target */
    min-width: 44px;
    text-align: center;
    -webkit-user-select: none;
    user-select: none;
    touch-action: manipulation; /* Prevents double-tap zoom */
}

.cta-button:hover {
    background: #ff8533;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 102, 0, 0.3);
}

.cta-button:active {
    transform: translateY(0);
}

/* Contact Form */
.contact-form-container {
    background: var(--white);
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    animation: fadeInUp 0.8s ease 0.6s both;
}

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

.hubspot-form {
    min-height: 400px;
}

/* Sections */
section {
    padding: 4rem 0;
}

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

.section-title h2 {
    color: var(--primary-color);
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.section-title p {
    color: var(--text-light);
    font-size: 1.1rem;
}

/* Services Grid */
.services-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    margin-top: 2rem;
}

.service-card {
    background: var(--white);
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 3px 15px rgba(0,0,0,0.1);
    transition: var(--transition);
}

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

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

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

/* Service Detail Pages - Uniform Spacing */
.service-detail {
    padding: 4rem 0;
}

.service-detail h2 {
    color: var(--text-dark);
    margin-bottom: 1.5rem;
}

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

.service-detail p {
    color: var(--text-light);
    line-height: 1.8;
    margin-bottom: 1.25rem;
}

.service-detail ul {
    margin: 1.25rem 0;
    padding-left: 1.5rem;
}

.service-detail ul li {
    color: var(--text-light);
    line-height: 1.8;
    margin-bottom: 0.75rem;
}

.service-detail ul li strong {
    color: var(--text-dark);
}

.service-detail img {
    margin: 2rem 0;
}

.service-detail .cta-button {
    margin-top: 2.5rem;
}

/* Features Grid */
.features-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    margin-top: 2rem;
}

.feature-box {
    text-align: center;
    padding: 2rem;
}

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

.feature-box h4 {
    color: var(--text-dark);
    margin-bottom: 1rem;
}

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

/* Team Section */
.team-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    margin-top: 2rem;
}

.team-member {
    background: var(--white);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 3px 15px rgba(0,0,0,0.1);
    transition: var(--transition);
}

.team-member:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 25px rgba(0,0,0,0.15);
}

.team-member img {
    width: 100%;
    height: 300px;
    object-fit: cover;
}

.team-info {
    padding: 1.5rem;
    text-align: center;
}

.team-info h4 {
    color: var(--text-dark);
    margin-bottom: 0.5rem;
}

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

.team-info p {
    color: var(--text-light);
    font-size: 0.95rem;
}

/* Testimonials */
.testimonials-slider {
    max-width: 800px;
    margin: 2rem auto;
}

.testimonial {
    background: var(--white);
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 3px 15px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
}

.testimonial-content {
    margin-bottom: 1.5rem;
}

.stars {
    color: #ffc107;
    font-size: 1.2rem;
    margin-bottom: 1rem;
}

.testimonial-content p {
    font-style: italic;
    color: var(--text-light);
    line-height: 1.7;
}

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

.author-info h5 {
    color: var(--text-dark);
    margin-bottom: 0.25rem;
}

.author-info .location {
    color: var(--text-light);
    font-size: 0.9rem;
}

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

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

.faq-question {
    width: 100%;
    padding: 1.5rem;
    background: var(--white);
    border: none;
    text-align: left;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-dark);
    transition: var(--transition);
    min-height: 44px; /* Minimum touch target */
    touch-action: manipulation;
}

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

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

.faq-question::after {
    content: '+';
    font-size: 1.5rem;
    color: var(--primary-color);
    transition: var(--transition);
}

.faq-question.active::after {
    content: '−';
}

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

.faq-answer-content {
    padding: 0 1.5rem 1.5rem;
    color: var(--text-light);
    line-height: 1.7;
}

/* Blog Section */
.blog-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    margin-top: 2rem;
}

.blog-card {
    background: var(--white);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 3px 15px rgba(0,0,0,0.1);
    transition: var(--transition);
}

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

.blog-image {
    width: 100%;
    height: 200px;
    overflow: hidden;
}

.blog-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

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

.blog-content {
    padding: 1.5rem;
}

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

.blog-content h3 {
    color: var(--text-dark);
    margin-bottom: 1rem;
    font-size: 1.3rem;
}

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

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

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

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

.article-header {
    margin-bottom: 2rem;
}

.article-header h1 {
    font-size: 2.5rem;
    color: var(--text-dark);
    margin-bottom: 1rem;
}

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

.article-image {
    width: 100%;
    height: 400px;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 2rem;
}

.article-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.article-content {
    line-height: 1.8;
}

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

.article-content h3 {
    color: var(--text-dark);
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
}

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

.article-content ul,
.article-content ol {
    margin-bottom: 1.5rem;
    padding-left: 2rem;
}

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

/* Areas Coverage */
.areas-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    margin-top: 2rem;
}

.area-card {
    background: var(--white);
    padding: 1.5rem;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    border-left: 4px solid var(--primary-color);
}

.area-card h4 {
    color: var(--text-dark);
    margin-bottom: 0.5rem;
}

.area-card p {
    color: var(--text-light);
    font-size: 0.95rem;
}

/* Footer */
footer {
    background: var(--text-dark);
    color: var(--white);
    padding: 3rem 0 1rem;
}

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

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

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

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

.footer-section ul li a {
    color: rgba(255,255,255,0.8);
    transition: var(--transition);
}

.footer-section ul li a:hover {
    color: var(--white);
    padding-left: 5px;
}

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

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

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

/* Utility Classes */
.text-center { text-align: center; }
.mt-1 { margin-top: 1rem; }
.mt-2 { margin-top: 2rem; }
.mt-3 { margin-top: 3rem; }
.mb-1 { margin-bottom: 1rem; }
.mb-2 { margin-bottom: 2rem; }
.mb-3 { margin-bottom: 3rem; }
.bg-light { background: var(--bg-light); }

/* Tablet Styles */
@media (min-width: 768px) {
    h1 { font-size: 2.5rem; }
    h2 { font-size: 2rem; }
    
    .hero-text h1 { font-size: 2.5rem; }
    
    .services-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .features-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .team-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .blog-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .areas-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .footer-content {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Desktop Styles */
@media (min-width: 1024px) {
    h1 { font-size: 3rem; }
    h2 { font-size: 2.5rem; }
    
    .nav-toggle { display: none; }
    
    nav {
        position: static;
        width: auto;
        height: auto;
        background: transparent;
    }
    
    nav ul {
        display: flex;
        padding: 0;
        gap: 1rem;
    }
    
    nav ul li {
        margin: 0;
    }
    
    nav ul li a {
        padding: 0.5rem 1rem;
    }
    
    .hero-text h1 { font-size: 3rem; }
    
    .hero-grid {
        grid-template-columns: 1fr 1fr;
        gap: 3rem;
    }
    
    .services-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .features-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .team-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .blog-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .areas-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .footer-content {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Large Desktop */
@media (min-width: 1200px) {
    .container {
        padding: 0 40px;
    }
}

/* Print Styles */
@media print {
    header, footer, .nav-toggle { display: none; }
    .hero { min-height: auto; }
}

/* Mobile-Specific Optimizations */
@media (max-width: 767px) {
    /* Prevent text overflow on small screens */
    h1 {
        font-size: 1.75rem;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
    
    h2 {
        font-size: 1.5rem;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
    
    /* Ensure buttons are touch-friendly */
    button, .cta-button, a.cta-button {
        min-height: 44px;
        padding: 0.875rem 1.5rem;
        font-size: 1rem;
    }
    
    /* Stack grid items on mobile */
    .services-grid,
    .features-grid,
    .team-grid,
    .blog-grid,
    .areas-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    /* Improve table responsiveness */
    table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    /* Optimize images for mobile */
    img {
        width: 100%;
        height: auto;
    }
    
    /* Increase touch target size for navigation */
    nav ul li a {
        padding: 1rem 1.5rem;
        min-height: 48px;
        display: flex;
        align-items: center;
    }
    
    /* Ensure form inputs are mobile-friendly */
    input[type="text"],
    input[type="email"],
    input[type="tel"],
    input[type="url"],
    textarea,
    select {
        font-size: 16px; /* Prevents zoom on iOS */
        min-height: 44px;
    }
    
    /* Optimize hero section for mobile */
    .hero {
        min-height: 100vh;
        padding-top: 70px;
    }
    
    .hero-text h1 {
        font-size: 1.75rem;
        line-height: 1.3;
    }
    
    .hero-text p {
        font-size: 1rem;
    }
    
    /* Improve spacing on mobile */
    section {
        padding: 3rem 0;
    }
    
    .container {
        padding: 0 20px;
    }
    
    /* Optimize footer for mobile */
    .footer-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    /* Better card spacing on mobile */
    .service-card,
    .blog-card,
    .team-member {
        margin-bottom: 1.5rem;
    }
    
    /* Ensure CTA sections are mobile-friendly */
    .cta-section {
        padding: 3rem 0;
        text-align: center;
    }
    
    .cta-section .cta-button {
        display: block;
        margin: 1rem auto;
        width: 100%;
        max-width: 300px;
    }
}

/* Small Mobile Devices */
@media (max-width: 374px) {
    html {
        font-size: 14px;
    }
    
    .logo {
        font-size: 1.25rem;
    }
    
    .hero-text h1 {
        font-size: 1.5rem;
    }
    
    .container {
        padding: 0 15px;
    }
}

/* Landscape Mobile Optimization */
@media (max-width: 767px) and (orientation: landscape) {
    .hero {
        min-height: auto;
        padding: 2rem 0;
    }
    
    nav {
        height: calc(100vh - 60px);
    }
}

/* Touch Device Optimizations */
@media (hover: none) and (pointer: coarse) {
    /* Remove hover effects on touch devices */
    .service-card:hover,
    .blog-card:hover {
        transform: none;
    }
    
    /* Add active states instead */
    .service-card:active,
    .blog-card:active {
        transform: scale(0.98);
    }
    
    /* Improve button feedback on touch */
    .cta-button:active {
        transform: scale(0.95);
    }
}