/* Custom CSS for Guildford Surveyors */

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

body {
    font-family: 'Inter', sans-serif;
    line-height: 1.6;
    color: #333;
}

/* Hero Section with Dynamic Background */
.hero-section {
    position: relative;
    background: linear-gradient(135deg, #1e40af, #1e3a8a);
    overflow: hidden;
}

.hero-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('../images/hero-surveyor-technology.jpg');
    background-size: cover;
    background-position: center;
    opacity: 0.3;
    animation: subtle-zoom 20s ease-in-out infinite alternate;
}

@keyframes subtle-zoom {
    0% {
        transform: scale(1);
    }
    100% {
        transform: scale(1.05);
    }
}

/* Floating Animation for Contact Form */
.hero-section .bg-white\/95 {
    animation: float 6s ease-in-out infinite;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
}

/* Service Cards Hover Effects */
.service-card {
    transition: all 0.3s ease;
    transform: translateY(0);
}

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

/* Testimonial Cards Animation */
.testimonial-card {
    transition: all 0.3s ease;
    transform: scale(1);
}

.testimonial-card:hover {
    transform: scale(1.02);
}

/* Navigation Transitions */
nav a {
    transition: all 0.3s ease;
    position: relative;
}

nav a:hover {
    color: #1e40af;
}

nav a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -2px;
    left: 50%;
    background-color: #1e40af;
    transition: all 0.3s ease;
}

nav a:hover::after {
    width: 100%;
    left: 0;
}

/* Button Animations */
.btn-primary {
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.btn-primary:hover::before {
    left: 100%;
}

/* Video Container Styling */
.video-container {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.video-container video {
    width: 100%;
    height: auto;
    display: block;
}

/* FAQ Animations */
.faq-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
}

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

.faq-icon {
    transition: transform 0.3s ease;
}

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

/* Mobile Menu Animations */
.mobile-menu {
    transition: all 0.3s ease;
    max-height: 0;
    overflow: hidden;
}

.mobile-menu.active {
    max-height: 400px;
}

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

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

/* Image Hover Effects */
.image-hover {
    transition: all 0.3s ease;
    overflow: hidden;
}

.image-hover img {
    transition: transform 0.3s ease;
}

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

/* Team Member Cards */
.team-card {
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.team-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(59, 130, 246, 0.1), transparent);
    transition: left 0.6s;
}

.team-card:hover::before {
    left: 100%;
}

.team-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

/* Statistics Counter Animation */
.stat-number {
    font-size: 3rem;
    font-weight: 700;
    color: #1e40af;
    animation: countUp 2s ease-out forwards;
}

@keyframes countUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Blog Card Styling */
.blog-card {
    transition: all 0.3s ease;
    border-radius: 16px;
    overflow: hidden;
    background: white;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.blog-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

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

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

/* Loading Animation */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #1e40af;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Responsive Design Enhancements */
@media (max-width: 768px) {
    .hero-section h1 {
        font-size: 2.5rem;
    }
    
    .hero-section .grid {
        gap: 2rem;
    }
    
    .service-card {
        margin-bottom: 1.5rem;
    }
    
    .testimonial-card {
        margin-bottom: 1.5rem;
    }
}

@media (max-width: 640px) {
    .hero-section h1 {
        font-size: 2rem;
    }
    
    .hero-section p {
        font-size: 1rem;
    }
    
    .stat-number {
        font-size: 2rem;
    }
}

/* Dark Mode Support (Optional) */
@media (prefers-color-scheme: dark) {
    .bg-white {
        background-color: #1f2937;
        color: #f9fafb;
    }
    
    .text-gray-900 {
        color: #f9fafb;
    }
    
    .text-gray-600 {
        color: #d1d5db;
    }
}

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

/* Focus States */
button:focus,
a:focus,
input:focus,
textarea:focus,
select:focus {
    outline: 2px solid #1e40af;
    outline-offset: 2px;
}

/* Print Styles */
@media print {
    .mobile-menu,
    nav,
    footer {
        display: none;
    }
    
    .hero-section {
        background: white;
        color: black;
    }
    
    a::after {
        content: " (" attr(href) ")";
        font-size: 0.8em;
        color: #666;
    }
}

/* HubSpot Form Styling */
#contact-form,
.hs-form {
    width: 100% !important;
    max-width: 100% !important;
    overflow: visible !important;
}

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

.hs-form .hs-input {
    width: 100% !important;
    padding: 0.75rem !important;
    border: 1px solid #d1d5db !important;
    border-radius: 0.5rem !important;
    font-size: 1rem !important;
}

.hs-form .hs-button {
    background-color: #1e40af !important;
    color: white !important;
    padding: 0.75rem 2rem !important;
    border-radius: 0.5rem !important;
    border: none !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    transition: background-color 0.3s ease !important;
}

.hs-form .hs-button:hover {
    background-color: #1e3a8a !important;
}

.hs-form .hs-error-msgs {
    color: #dc2626 !important;
    font-size: 0.875rem !important;
    margin-top: 0.25rem !important;
}

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

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

::-webkit-scrollbar-thumb {
    background: #1e40af;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #1e3a8a;
}

/* Page Transitions */
.page-transition {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.5s ease;
}

.page-transition.loaded {
    opacity: 1;
    transform: translateY(0);
}

/* Interactive Elements */
.interactive-element {
    cursor: pointer;
    user-select: none;
}

.interactive-element:active {
    transform: scale(0.98);
}

/* Gradient Text */
.gradient-text {
    background: linear-gradient(135deg, #1e40af, #3b82f6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Card Stack Effect */
.card-stack {
    position: relative;
}

.card-stack::before,
.card-stack::after {
    content: '';
    position: absolute;
    top: 4px;
    left: 4px;
    right: -4px;
    bottom: -4px;
    background: white;
    border-radius: inherit;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    z-index: -1;
}

.card-stack::after {
    top: 8px;
    left: 8px;
    right: -8px;
    bottom: -8px;
    z-index: -2;
}

/* Pulse Animation for CTA Buttons */
.pulse-cta {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(59, 130, 246, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(59, 130, 246, 0);
    }
}

/* Professional Badge Styling */
.professional-badge {
    position: relative;
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 1rem;
    background: linear-gradient(135deg, #1e40af, #3b82f6);
    color: white;
    border-radius: 25px;
    font-weight: 600;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    box-shadow: 0 4px 14px 0 rgba(30, 64, 175, 0.39);
}

.professional-badge::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 25px;
    padding: 2px;
    background: linear-gradient(135deg, #60a5fa, #3b82f6);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask-composite: exclude;
}