/* Chester Surveyors - Professional Website CSS */

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #fff;
}

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

h1 {
    font-size: 2.5rem;
    color: #1a365d;
}

h2 {
    font-size: 2rem;
    color: #2d3748;
}

h3 {
    font-size: 1.5rem;
    color: #4a5568;
}

p {
    margin-bottom: 1rem;
    font-size: 1rem;
}

/* Header and Navigation */
.header {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: 1rem 0;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

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

.logo {
    font-size: 1.8rem;
    font-weight: 700;
    color: #1a365d;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo i {
    color: #3182ce;
}

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

.nav-link {
    text-decoration: none;
    color: #4a5568;
    font-weight: 500;
    transition: color 0.3s ease;
    position: relative;
}

.nav-link:hover {
    color: #3182ce;
}

.nav-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -5px;
    left: 50%;
    background-color: #3182ce;
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

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

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

.nav-toggle span {
    width: 25px;
    height: 3px;
    background: #4a5568;
    margin: 3px 0;
    transition: 0.3s;
}

/* Hero Section */
.hero {
    min-height: 100vh;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: linear-gradient(135deg, #1a365d 0%, #2d3748 100%);
    padding-top: 80px;
    box-sizing: border-box;
}

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

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(26, 54, 93, 0.8);
    z-index: 2;
}

.hero-content {
    max-width: 1100px;
    width: 100%;
    margin: 0 auto;
    padding: 2rem 2rem;
    position: relative;
    z-index: 3;
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: calc(100vh - 160px);
    box-sizing: border-box;
}

.hero-text {
    flex: 1;
    max-width: 60%;
    text-align: left;
    margin-right: 2rem;
    margin-top: -1rem;
    align-self: flex-start;
}

.hero-text h1 {
    font-size: 2.5rem;
    color: white;
    margin-bottom: 1rem;
    animation: fadeInUp 1s ease-out;
    line-height: 1.2;
    word-wrap: break-word;
    max-width: 100%;
}

.hero-text .subtitle {
    font-size: 1.1rem;
    margin-bottom: 2rem;
    opacity: 0.9;
    animation: fadeInUp 1s ease-out 0.2s both;
    line-height: 1.5;
    max-width: 100%;
    word-wrap: break-word;
}

.cta-button {
    display: inline-block;
    background: #3182ce;
    color: white;
    padding: 1rem 2rem;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s ease;
    animation: fadeInUp 1s ease-out 0.4s both;
}

.cta-button:hover {
    background: #2c5aa0;
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(49, 130, 206, 0.3);
}

/* Contact Form in Hero */
.hero-form {
    flex: 0 0 350px;
    max-width: 350px;
    width: 350px;
    background: rgba(255, 255, 255, 0.95);
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    animation: fadeInUp 1s ease-out 0.6s both;
    border: 2px solid rgba(49, 130, 206, 0.2);
    box-sizing: border-box;
    align-self: flex-start;
}

/* Desktop - side by side layout */
@media (min-width: 1025px) {
    .hero-content {
        flex-direction: row;
        justify-content: space-between;
        align-items: flex-start;
        text-align: left;
        padding: 2rem;
    }
    
    .hero-text {
        text-align: left;
        margin-right: 2rem;
        margin-bottom: 0;
        flex: 1;
        max-width: 60%;
        margin-top: -1rem;
    }
}

.hero-form h3 {
    color: #1a365d;
    margin-bottom: 1.5rem;
    text-align: center;
}

/* HubSpot Form Container Styling - No changes to HubSpot code */

.hero-form .hs-form .hs-form-field {
    margin-bottom: 1rem !important;
}

.hero-form .hs-form .hs-input {
    width: 100% !important;
    padding: 0.75rem !important;
    border: 2px solid #e2e8f0 !important;
    border-radius: 8px !important;
    font-size: 1rem !important;
    font-family: inherit !important;
}

.hero-form .hs-form .hs-input:focus {
    border-color: #3182ce !important;
    box-shadow: 0 0 0 3px rgba(49, 130, 206, 0.1) !important;
    outline: none !important;
}

.hero-form .hs-form .hs-button {
    background: #3182ce !important;
    color: white !important;
    border: none !important;
    padding: 0.75rem 1.5rem !important;
    border-radius: 8px !important;
    font-weight: 600 !important;
    font-size: 1rem !important;
    cursor: pointer !important;
    width: 100% !important;
    margin-top: 1rem !important;
}

.hero-form .hs-form .hs-button:hover {
    background: #2c5aa0 !important;
    transform: translateY(-1px);
}

/* Additional HubSpot Form Visibility Fixes */
.hero-form .hs-form .hs-form-field label {
    color: #1a365d !important;
    font-weight: 500 !important;
    margin-bottom: 0.5rem !important;
    display: block !important;
}

.hero-form .hs-form .hs-error-msgs {
    color: #e53e3e !important;
    font-size: 0.875rem !important;
}

.hero-form .hs-form .hs-submit {
    text-align: center !important;
}

/* Ensure form container is properly sized without modifying HubSpot */
#hero-hubspot-form {
    width: 100%;
    position: relative;
    z-index: 10;
}

/* Tablet and below - stack vertically */
@media (max-width: 1024px) {
    .hero-content {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    
    .hero-text {
        max-width: 100%;
        margin-right: 0;
        margin-bottom: 2rem;
    }
    
    .hero-form {
        flex: none;
        width: 100%;
        max-width: 450px;
    }
}

/* Large screen adjustments */
@media (min-width: 1400px) {
    .hero-content {
        max-width: 1200px;
        padding: 3rem;
    }
    
    .hero-text h1 {
        font-size: 3.2rem;
    }
    
    .hero-text .subtitle {
        font-size: 1.3rem;
    }
}

/* Viewport height constraints */
@media (max-height: 700px) {
    .hero-content {
        padding-top: 110px;
        padding-bottom: 2rem;
        min-height: auto;
    }
}

/* Extra small screen adjustments */
@media (max-width: 480px) {
    .hero-content {
        padding: 110px 1rem 3rem 1rem;
        min-height: calc(100vh - 120px);
    }
    
    .hero-text h1 {
        font-size: 1.6rem;
        line-height: 1.2;
        margin-bottom: 0.8rem;
    }
    
    .hero-text .subtitle {
        font-size: 0.9rem;
        margin-bottom: 1.5rem;
    }
    
    .hero-form {
        width: 100%;
        max-width: 100%;
        padding: 1rem;
    }
}

/* Medium tablet screens */
@media (max-width: 768px) and (min-width: 481px) {
    .hero-content {
        padding: 110px 1rem 3rem 1rem;
    }
    
    .hero-form {
        width: 100%;
        max-width: 450px;
    }
}

/* Container and Layout */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.section {
    padding: 5rem 0;
}

.section-dark {
    background: #f7fafc;
}

/* Grid Systems */
.grid {
    display: grid;
    gap: 2rem;
}

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

.grid-3 {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.grid-4 {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

/* Cards and Components */
.card {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    border: 1px solid #e2e8f0;
}

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

.service-card {
    text-align: center;
    position: relative;
    overflow: hidden;
}

.service-card i {
    font-size: 3rem;
    color: #3182ce;
    margin-bottom: 1rem;
}

.service-card h3 {
    color: #1a365d;
    margin-bottom: 1rem;
}

/* Team Member Cards */
.team-member {
    text-align: center;
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

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

.team-photo {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
    margin: 0 auto 1.5rem;
    border: 4px solid #e2e8f0;
}

.team-member h3 {
    color: #1a365d;
    margin-bottom: 0.5rem;
}

.team-role {
    color: #3182ce;
    font-weight: 500;
    margin-bottom: 1rem;
}

.team-bio {
    color: #4a5568;
    font-size: 0.9rem;
    line-height: 1.6;
}

/* Reviews and Testimonials */
.review {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    position: relative;
    border-left: 4px solid #3182ce;
}

.review-content {
    font-style: italic;
    margin-bottom: 1rem;
    color: #4a5568;
}

.review-author {
    font-weight: 600;
    color: #1a365d;
}

.review-rating {
    color: #fbb040;
    margin-bottom: 1rem;
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    color: #4a5568;
    font-weight: 500;
}

.form-input {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.form-input:focus {
    outline: none;
    border-color: #3182ce;
    box-shadow: 0 0 0 3px rgba(49, 130, 206, 0.1);
}

.form-textarea {
    min-height: 120px;
    resize: vertical;
}

.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background: #3182ce;
    color: white;
    text-decoration: none;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
}

.btn:hover {
    background: #2c5aa0;
    transform: translateY(-1px);
}

.btn-secondary {
    background: #4a5568;
}

.btn-secondary:hover {
    background: #2d3748;
}

/* Blog Styles */
.blog-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    cursor: pointer;
}

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

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

.blog-content {
    padding: 1.5rem;
}

.blog-meta {
    color: #718096;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.blog-title {
    color: #1a365d;
    margin-bottom: 1rem;
    font-size: 1.25rem;
}

.blog-excerpt {
    color: #4a5568;
    line-height: 1.6;
}

.read-more {
    color: #3182ce;
    font-weight: 500;
    text-decoration: none;
    margin-top: 1rem;
    display: inline-block;
}

.read-more:hover {
    text-decoration: underline;
}

/* FAQ Section */
.faq-item {
    background: white;
    margin-bottom: 1rem;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.faq-question {
    background: #f7fafc;
    padding: 1.5rem;
    cursor: pointer;
    font-weight: 600;
    color: #1a365d;
    border: none;
    width: 100%;
    text-align: left;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.3s ease;
}

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

.faq-answer {
    padding: 0 1.5rem;
    max-height: 0;
    overflow: hidden;
    transition: all 0.3s ease;
    background: white;
}

.faq-answer.active {
    padding: 1.5rem;
    max-height: 300px;
}

.faq-answer p {
    color: #4a5568;
    margin: 0;
}

/* Statistics */
.stats {
    background: #1a365d;
    color: white;
    text-align: center;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
}

.stat-item h3 {
    font-size: 3rem;
    color: #3182ce;
    margin-bottom: 0.5rem;
}

.stat-item p {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* Footer */
.footer {
    background: #1a365d;
    color: white;
    padding: 3rem 0 2rem;
}

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

.footer-section h3 {
    color: white;
    margin-bottom: 1rem;
}

.footer-section p,
.footer-section a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    line-height: 1.8;
}

.footer-section a:hover {
    color: white;
}

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

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

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

/* Utility Classes */
.text-center {
    text-align: center;
}

.text-primary {
    color: #3182ce;
}

.bg-primary {
    background: #3182ce;
}

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.p-1 { padding: 0.5rem; }
.p-2 { padding: 1rem; }
.p-3 { padding: 1.5rem; }
.p-4 { padding: 2rem; }

/* Mobile Responsive Design */
@media (max-width: 768px) {
    .nav-menu {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(10px);
        flex-direction: column;
        padding: 2rem;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    }

    .nav-menu.active {
        display: flex;
    }

    .nav-toggle {
        display: flex;
    }

    .hero-content {
        flex-direction: column;
        align-items: center;
        justify-content: center;
        text-align: center;
        padding: 1rem;
        min-height: calc(100vh - 160px);
    }

    .hero-text {
        max-width: 100%;
        width: 100%;
        margin-right: 0;
        margin-bottom: 2rem;
        text-align: center;
    }

    .hero-text h1 {
        font-size: 2rem;
        line-height: 1.2;
    }

    .hero-text .subtitle {
        font-size: 1rem;
    }

    .hero-form {
        flex: none;
        width: 100%;
        max-width: 400px;
    }

    .container {
        padding: 0 1rem;
    }

    .section {
        padding: 3rem 0;
    }

    h1 {
        font-size: 2rem;
    }

    h2 {
        font-size: 1.5rem;
    }

    .grid-2,
    .grid-3,
    .grid-4 {
        grid-template-columns: 1fr;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

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

    .hero-text .subtitle {
        font-size: 1.1rem;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .nav-container {
        padding: 0 1rem;
    }
}

/* Print Styles */
@media print {
    .header,
    .nav-toggle,
    .hero-video,
    .cta-button,
    .btn {
        display: none;
    }

    .hero {
        height: auto;
        background: white;
        color: black;
    }

    .hero-content {
        position: static;
    }

    .section {
        padding: 2rem 0;
    }

    a {
        color: black;
        text-decoration: underline;
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .card {
        border: 2px solid #000;
    }

    .btn {
        border: 2px solid #000;
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}