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

body {
    font-family: 'Open Sans', sans-serif;
    font-weight: 400;
}

:root {
    --primary-color: #1e40af;
    --secondary-color: #3b82f6;
    --accent-color: #60a5fa;
    --dark-color: #1e293b;
    --light-color: #f8fafc;
    --text-color: #334155;
    --white: #ffffff;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);

    /* Hero overlay tuning: reduce these to tone down the blue tint */
    --hero-overlay-start: rgba(30, 64, 175, 0.15);
    --hero-overlay-end: rgba(59, 130, 246, 0.08);
    /* Fallback animated water tints (low alpha to keep effect subtle) */
    --water-radial-a: rgba(96, 165, 250, 0.08);
    --water-radial-b: rgba(59, 130, 246, 0.06);
    --water-center-start: rgba(59, 130, 246, 0.06);
    --water-center-end: rgba(30, 64, 175, 0.04);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--light-color);
}

/* Default link styling */
a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.3s, opacity 0.3s;
}

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

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

/* Header and Navigation */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: var(--white);
    box-shadow: var(--shadow);
    z-index: 1000;
}

.nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
}

.logo {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    font-family: 'Montserrat', sans-serif;
    font-weight: bold;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo img {
    height: 44px;
    max-height: 44px;
    width: auto;
    max-width: 200px;
    display: block;
    object-fit: contain;
}

/* Responsive logo sizing: smaller on mobile, larger on desktop */
@media (max-width: 767px) {
    .logo img {
        height: 36px;
        max-height: 36px;
    }
}

@media (min-width: 1024px) {
    .logo img {
        height: 56px;
        max-height: 56px;
    }
}

.nav-menu {
    display: none;
    list-style: none;
}

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

.nav-menu li {
    margin-left: 2rem;
}

.nav-menu a {
    color: var(--text-color);
    text-decoration: none;
    transition: color 0.3s;
}

.nav-menu a:hover,
.nav-menu a.active {
    color: var(--primary-color);
}

.nav-toggle {
    display: flex;
    flex-direction: column;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
}

.nav-toggle span {
    width: 25px;
    height: 3px;
    background: var(--dark-color);
    margin: 3px 0;
    transition: 0.3s;
}

/* Hero Section with Video Background */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    overflow: hidden;
    margin-top: 60px;
}

/* Video Background - Cloudinary hosted video */
.hero-video {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    object-fit: cover;
    transform: scale(1.1);
    z-index: -1;
}

/* Animated water effect fallback when video is not available */
.hero::before {
    content: '';
    position: fixed;
    top: 60px;
    left: 0;
    width: 100%;
    height: calc(100vh - 60px);
    background: transparent;
    z-index: -2;
    animation: none;
}

@keyframes waterFlow {
    0%, 100% {
        background-position: 0% 50%, 100% 50%, 50% 50%;
    }
    25% {
        background-position: 20% 60%, 80% 40%, 50% 50%;
    }
    50% {
        background-position: 10% 70%, 90% 30%, 50% 50%;
    }
    75% {
        background-position: 30% 40%, 70% 60%, 50% 50%;
    }
}

.hero-overlay {
    position: fixed;
    top: 60px;
    left: 0;
    width: 100%;
    height: calc(100vh - 60px);
    /* Use CSS variables so the tint is easy to tweak */
    background: transparent;
    z-index: 0;
    pointer-events: none;
}

.hero-content {
    position: relative;
    z-index: 1;
    padding: 2rem;
    max-width: 800px;
}

.hero-title {
    font-family: 'Montserrat', sans-serif;
    font-weight: 800;
    font-size: 2.5rem; /* Starting size - will be dynamically adjusted */
    color: var(--white);
    margin-bottom: 2rem;
    text-shadow: 
        2px 2px 6px rgba(0, 0, 0, 0.9),
        0px 0px 15px rgba(0, 0, 0, 0.7);
    background: rgba(0, 0, 0, 0.4);
    padding: 1rem 2rem;
    border-radius: 8px;
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    text-align: center;
    max-width: 90vw;
    margin-left: auto;
    margin-right: auto;
    white-space: nowrap;
    line-height: 1.2;
    overflow: hidden;
    box-sizing: border-box;
    min-font-size: 1rem;
    max-font-size: 3rem;
}

.scripture {
    font-family: 'Montserrat', sans-serif;
    font-weight: 300;
    font-style: italic;
    color: var(--white);
    font-size: 1.5rem; /* Starting size - will be dynamically adjusted */
    margin: 2rem auto;
    line-height: 1.4;
    text-align: center;
    max-width: 90vw;
    white-space: normal;
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
    box-sizing: border-box;
    text-shadow: 
        2px 2px 4px rgba(0, 0, 0, 0.8),
        0px 0px 8px rgba(0, 0, 0, 0.6),
        1px 1px 2px rgba(0, 0, 0, 0.9);
    background: rgba(0, 0, 0, 0.3);
    padding: 1rem 1.5rem;
    border-radius: 8px;
    backdrop-filter: blur(3px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.scripture-ref {
    margin-top: 1rem;
    font-size: 1rem;
    font-weight: 600;
}

/* Shimmer Effect */
.shimmer {
    position: relative;
    overflow: hidden;
}

.shimmer::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.3) 50%,
        transparent 100%
    );
    animation: shimmer 3s infinite;
}

@keyframes shimmer {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}

/* CTA Buttons */
.hero-cta {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 2rem;
}

.btn {
    display: inline-block;
    padding: 1rem 2rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s;
    cursor: pointer;
    border: 2px solid transparent;
    text-align: center;
}

.btn-primary {
    background: var(--white);
    color: var(--primary-color);
    box-shadow: var(--shadow-lg);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 20px rgba(0, 0, 0, 0.15);
}

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

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

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

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

.btn-large {
    padding: 1.25rem 3rem;
    font-size: 1.125rem;
}

/* Mission Section */
.mission {
    padding: 4rem 0;
    background: var(--white);
}

.mission h2 {
    font-size: 2rem;
    color: var(--dark-color);
    text-align: center;
    margin-bottom: 2rem;
}

.mission-text {
    max-width: 800px;
    margin: 0 auto;
    font-size: 1.125rem;
    line-height: 1.8;
    color: var(--text-color);
    text-align: center;
}

/* Services Section */
.services {
    padding: 6rem 0;
    background: transparent;
}

.services h2 {
    font-size: 2rem;
    color: var(--white);
    text-align: center;
    margin-bottom: 3rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
    background: rgba(0, 0, 0, 0.3);
    padding: 1rem;
    border-radius: 8px;
    backdrop-filter: blur(4px);
}

.services-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

.service-card {
    background: var(--white);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: var(--shadow);
    text-align: center;
    transition: transform 0.3s, box-shadow 0.3s;
}

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

.service-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.service-card h3 {
    font-size: 1.5rem;
    color: var(--dark-color);
    margin-bottom: 1rem;
}

.service-card p {
    color: var(--text-color);
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

/* Service Details Section */
.service-details {
    padding: 4rem 0;
    background: transparent;
    position: relative;
    z-index: 2;
}

.service-details h2 {
    font-size: 2rem;
    color: var(--white);
    text-align: center;
    margin-bottom: 3rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
    background: rgba(0, 0, 0, 0.3);
    padding: 1rem;
    border-radius: 8px;
    backdrop-filter: blur(4px);
}

.service-detail {
    background: var(--white);
    padding: 2.5rem;
    margin-bottom: 2rem;
    border-radius: 12px;
    box-shadow: var(--shadow);
    border-left: 4px solid var(--primary-color);
}

.service-detail h3 {
    font-size: 1.5rem;
    color: var(--dark-color);
    margin-bottom: 1rem;
    border-bottom: 2px solid var(--accent-color);
    padding-bottom: 0.5rem;
}

.service-detail p {
    color: var(--text-color);
    margin-bottom: 1.5rem;
    line-height: 1.7;
    font-size: 1.1rem;
}

.service-detail ul {
    list-style: none;
    padding: 0;
    margin-bottom: 2rem;
}

.service-detail ul li {
    padding: 0.5rem 0;
    color: var(--text-color);
    position: relative;
    padding-left: 1.5rem;
}

.service-detail ul li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--primary-color);
    font-weight: bold;
}

.service-detail .btn {
    margin-top: 1rem;
}

/* Testimonials Section */
.testimonials {
    padding: 4rem 0;
    background: var(--white);
}

.testimonials h2 {
    font-size: 2rem;
    color: var(--dark-color);
    text-align: center;
    margin-bottom: 3rem;
}

.testimonials-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

.testimonial-card {
    background: var(--light-color);
    padding: 2rem;
    border-radius: 12px;
    border-left: 4px solid var(--primary-color);
}

.testimonial-stars {
    color: #fbbf24;
    font-size: 1.25rem;
    margin-bottom: 1rem;
}

.testimonial-text {
    font-style: italic;
    color: var(--text-color);
    margin-bottom: 1rem;
    line-height: 1.6;
}

.testimonial-author {
    font-weight: 600;
    color: var(--dark-color);
}

/* Contact CTA Section */
.contact-cta {
    padding: 4rem 0;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: var(--white);
    text-align: center;
}

.contact-cta h2 {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.contact-cta > .container > p {
    font-size: 1.125rem;
    margin-bottom: 2rem;
}

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

.contact-item h3 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

.contact-item a {
    color: var(--white);
    text-decoration: none;
    transition: opacity 0.3s;
}

.contact-item a:hover {
    opacity: 0.8;
}

/* Footer */
.footer {
    background: var(--dark-color);
    color: var(--light-color);
    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 a {
    color: var(--light-color);
    text-decoration: none;
    transition: color 0.3s;
}

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

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

.footer-license {
    margin-top: 1rem;
    font-size: 0.875rem;
    font-style: italic;
    opacity: 0.8;
    line-height: 1.6;
}

.footer-license em {
    display: block;
    margin-top: 0.5rem;
}

.footer-attribution {
    margin-top: 1rem;
    font-size: 0.875rem;
    opacity: 0.7;
}

.footer-attribution a {
    color: var(--accent-color);
    text-decoration: underline;
}

/* Mobile Menu Styles */
@media (max-width: 767px) {
    .hero-title {
        max-width: 95%;
        padding: 0.6rem 1rem;
        font-size: 1.5rem !important; /* Override JS if needed */
        max-font-size: 1.8rem;
        line-height: 1.1;
    }
    
    .scripture {
        font-size: 0.9rem !important; /* Override JS if needed */
        max-width: 90%;
        line-height: 1.3;
        white-space: normal;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
    
    .nav-menu.open {
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: white;
        padding: 1rem;
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    }
    
    .nav-menu.open li {
        margin-left: 0;
        margin-bottom: 0.5rem;
    }
    
    /* Mobile video optimization */
    .hero-video {
        /* On mobile, use poster image more prominently as videos can be bandwidth-intensive */
        min-width: 100%;
        min-height: 100%;
    }
}

/* Medium to Large Screens - Critical breakpoint around 760px */
@media (min-width: 768px) and (max-width: 1199px) {
    .hero-title {
        max-width: 85vw;
    }
}

/* Large Screens */
@media (min-width: 1200px) {
    .hero-title {
        max-width: 75vw;
    }
}

@media (min-width: 1400px) {
    .hero-title {
        max-width: 70vw;
    }
}

/* Very Small Screens */
@media (max-width: 480px) {
    .hero-title {
        max-width: 95%;
        padding: 0.5rem 0.8rem;
        font-size: 1.3rem !important; /* Smaller for very small screens */
        line-height: 1.0;
    }
    
    .scripture {
        font-size: 0.8rem !important; /* Smaller for very small screens */
        max-width: 95%;
        line-height: 1.2;
        white-space: normal;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
}

/* Tablet Styles */
@media (min-width: 768px) {
    .nav-menu {
        display: flex;
    }

    .nav-toggle {
        display: none;
    }

    .hero-title {
        font-size: 3.5rem;
    }

    .scripture {
        font-size: 1.5rem;
    }

    .services-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .testimonials-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .contact-info {
        grid-template-columns: repeat(3, 1fr);
    }

    .footer-content {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Desktop Styles */
@media (min-width: 1024px) {
    .hero-title {
        font-size: 4rem;
    }

    .container {
        padding: 0 2rem;
    }

    .mission,
    .services,
    .testimonials,
    .contact-cta {
        padding: 6rem 0;
    }
}

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

/* Gallery Section */
.gallery {
    padding: 4rem 0;
    background: var(--white);
}

.gallery h2 {
    font-size: 2rem;
    color: var(--dark-color);
    text-align: center;
    margin-bottom: 1rem;
}

.gallery-description {
    text-align: center;
    color: var(--text-color);
    font-size: 1.125rem;
    margin-bottom: 3rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

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

.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 12px;
    box-shadow: var(--shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    background: var(--white);
}

.gallery-item:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.gallery-item img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    transition: transform 0.3s ease;
}

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

.gallery-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(30, 64, 175, 0.9) 0%, rgba(59, 130, 246, 0.8) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.gallery-item:hover .gallery-overlay {
    opacity: 1;
}

.gallery-content {
    text-align: center;
    color: var(--white);
    padding: 1rem;
}

.gallery-content h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.gallery-content p {
    font-size: 1rem;
    line-height: 1.4;
}

/* Responsive Gallery */
@media (max-width: 768px) {
    .gallery-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 1.5rem;
    }
    
    .gallery-item img {
        height: 200px;
    }
}

@media (max-width: 480px) {
    .gallery-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}

/* Phone Display Toggle */
.phone-hidden {
    cursor: pointer;
    color: #ffffff;
}

.phone-number {
    display: none;
}

.phone-number.show {
    display: inline;
}

.email-protected {
    font-size: 0;
    display: inline;
}

.email-protected::before {
    content: "getrdonewellservice@gmail.com";
    font-size: 1rem;
}

.btn .phone-protected::before,
.btn .phone-protected::after,
.btn .email-protected::before,
a .phone-protected::before,
a .phone-protected::after,
a .email-protected::before {
    font-size: inherit;
}

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

    .hero {
        background-attachment: scroll;
    }
}
