/* Custom CSS for Chelmsford Surveyors */

.font-inter {
    font-family: 'Inter', sans-serif;
}

/* Hero Video Background */
.hero-video-bg {
    z-index: 1;
    transition: opacity 1s ease-in-out;
}

.hero-video-bg video {
    filter: brightness(0.7);
}

#hero-fallback {
    z-index: 0;
}

#hero-fallback img {
    filter: brightness(0.7);
}

/* Ensure background image loads immediately */
#hero-fallback img {
    will-change: transform;
    backface-visibility: hidden;
}

/* Hero Animation */
@keyframes heroSlideIn {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.hero-content {
    animation: heroSlideIn 1s ease-out;
}

/* Animated Background - Starts Immediately */
.animated-bg {
    animation: slowZoom 20s ease-in-out infinite alternate;
    animation-play-state: running;
    transform: scale(1);
}

@keyframes slowZoom {
    0% {
        transform: scale(1);
    }
    100% {
        transform: scale(1.05);
    }
}

/* Geometric Shapes Animation - Immediate Start */
.geometric-shapes {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.geometric-overlay {
    pointer-events: none;
}

.shape {
    position: absolute;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.4), rgba(147, 197, 253, 0.3));
    border-radius: 50%;
    opacity: 0.6;
    will-change: transform, opacity;
}

.animate-immediate {
    animation: float 15s ease-in-out infinite;
    animation-play-state: running;
}

.shape-1 {
    width: 100px;
    height: 100px;
    top: 10%;
    left: 10%;
    animation-delay: 0s;
}

.shape-2 {
    width: 150px;
    height: 150px;
    top: 60%;
    right: 15%;
    animation-delay: -5s;
}

.shape-3 {
    width: 80px;
    height: 80px;
    bottom: 20%;
    left: 20%;
    animation-delay: -10s;
}

.shape-4 {
    width: 120px;
    height: 120px;
    top: 30%;
    right: 30%;
    animation-delay: -7s;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px) rotate(0deg);
        opacity: 0.3;
    }
    25% {
        transform: translateY(-20px) rotate(90deg);
        opacity: 0.5;
    }
    50% {
        transform: translateY(0px) rotate(180deg);
        opacity: 0.3;
    }
    75% {
        transform: translateY(20px) rotate(270deg);
        opacity: 0.4;
    }
}

/* Hero Section Background Animation - Immediate Start */
.hero-section {
    background: linear-gradient(-45deg, #1e40af, #3b82f6, #1e3a8a, #2563eb, #1e40af);
    background-size: 400% 400%;
    animation: gradientShift 8s ease infinite;
    animation-play-state: running;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, 
        rgba(30, 64, 175, 0.8) 0%, 
        rgba(59, 130, 246, 0.6) 25%, 
        rgba(147, 197, 253, 0.4) 50%, 
        rgba(59, 130, 246, 0.6) 75%, 
        rgba(30, 64, 175, 0.8) 100%);
    background-size: 200% 200%;
    animation: overlayShift 12s ease-in-out infinite;
    z-index: 5;
    pointer-events: none;
}

@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

@keyframes overlayShift {
    0%, 100% {
        background-position: 0% 0%;
    }
    50% {
        background-position: 100% 100%;
    }
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

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

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

/* Hover effects */
.hover-scale {
    transition: transform 0.3s ease;
}

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

/* Custom button styles */
.btn-primary {
    background: linear-gradient(135deg, #1e40af, #3b82f6);
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #1e3a8a, #2563eb);
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(59, 130, 246, 0.3);
}

/* Card shadows */
.card {
    transition: box-shadow 0.3s ease;
}

.card:hover {
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

/* Navigation active state */
.nav-active {
    color: #2563eb !important;
    font-weight: 600;
}

/* Mobile menu transition */
#mobile-menu {
    transition: all 0.3s ease;
}

/* Form styling */
.form-input {
    border: 2px solid #e5e7eb;
    transition: border-color 0.3s ease;
}

.form-input:focus {
    border-color: #3b82f6;
    outline: none;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Video overlay */
.video-overlay {
    background: linear-gradient(45deg, rgba(30, 64, 175, 0.8), rgba(59, 130, 246, 0.6));
}

/* Responsive video */
.responsive-video {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
}

.responsive-video video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Technology showcase */
.tech-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

/* Testimonials */
.testimonial-card {
    background: linear-gradient(135deg, #ffffff, #f8fafc);
    border: 1px solid #e2e8f0;
}

/* Loading animation for HubSpot forms */
.hubspot-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 200px;
}

.spinner {
    border: 4px solid #f3f4f6;
    border-top: 4px solid #3b82f6;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Blog post styles */
.blog-post {
    line-height: 1.8;
}

.blog-post h2 {
    font-size: 1.75rem;
    font-weight: 700;
    margin: 2rem 0 1rem;
    color: #1f2937;
}

.blog-post h3 {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 1.5rem 0 0.75rem;
    color: #374151;
}

.blog-post p {
    margin-bottom: 1.25rem;
    color: #4b5563;
}

.blog-post ul, .blog-post ol {
    margin: 1rem 0;
    padding-left: 1.5rem;
}

.blog-post li {
    margin-bottom: 0.5rem;
}

.blog-post blockquote {
    border-left: 4px solid #3b82f6;
    background: #f8fafc;
    padding: 1rem 1.5rem;
    margin: 1.5rem 0;
    font-style: italic;
}

/* FAQ Accordion */
.faq-item {
    border-bottom: 1px solid #e5e7eb;
}

.faq-question {
    cursor: pointer;
    transition: all 0.3s ease;
}

.faq-question:hover {
    background-color: #f9fafb;
}

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

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

/* Service cards */
.service-card {
    background: linear-gradient(135deg, #ffffff, #f8fafc);
    border: 1px solid #e2e8f0;
    transition: all 0.3s ease;
}

.service-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    border-color: #3b82f6;
}

/* Team member cards */
.team-card {
    background: #ffffff;
    border-radius: 1rem;
    overflow: hidden;
    transition: all 0.3s ease;
}

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

.team-card img {
    transition: transform 0.3s ease;
}

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

/* Areas map styling */
.areas-map {
    background: linear-gradient(135deg, #eff6ff, #dbeafe);
    border: 2px solid #3b82f6;
}

/* Contact form enhancements */
.contact-form {
    background: linear-gradient(135deg, #ffffff, #f8fafc);
}

/* Stats counter */
.stats-counter {
    font-size: 3rem;
    font-weight: 800;
    color: #1e40af;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
}

::-webkit-scrollbar-thumb {
    background: #3b82f6;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #2563eb;
}

/* Print styles */
@media print {
    .no-print {
        display: none !important;
    }
    
    body {
        font-size: 12pt;
        line-height: 1.4;
    }
    
    h1, h2, h3 {
        page-break-after: avoid;
    }
}