:root { --primary: #24a803; --primary-dark: #1e7e02; }
body { font-family: 'Inter', sans-serif; }
.whatsapp-float { position: fixed; bottom: 30px; right: 30px; background: #25d366; color: white; width: 60px; height: 60px; border-radius: 50%; text-align: center; font-size: 30px; line-height: 60px; box-shadow: 0 4px 10px rgba(0,0,0,0.2); z-index: 1000; transition: transform 0.3s; }
.whatsapp-float:hover { transform: scale(1.1); color: white; }
.nav-link.active { color: var(--primary) !important; font-weight: 600; }
.btn-success { background-color: var(--primary); border-color: var(--primary); }
.btn-success:hover { background-color: var(--primary-dark); border-color: var(--primary-dark); }
.grayscale { filter: grayscale(100%); opacity: 0.8; transition: all 0.3s; }
.grayscale:hover { filter: grayscale(0); opacity: 1; }
.stats .counter { font-weight: 700; }
@media (max-width: 768px) {
    .hero h1 { font-size: 2.2rem; }
    .whatsapp-float { width: 50px; height: 50px; font-size: 25px; line-height: 50px; bottom: 20px; right: 20px; }
}

/* Blog post tables */
.post-content table,
.blog-post table {
    width: 100%;
    margin: 1rem 0;
    border-collapse: collapse;
}
.post-content th,
.post-content td,
.blog-post th,
.blog-post td {
    border: 1px solid #dee2e6;
    padding: 0.75rem;
}
.post-content thead,
.blog-post thead {
    background-color: #24a803;
    color: white;
}
.post-content blockquote,
.blog-post blockquote {
    border-left: 4px solid #24a803;
    padding-left: 1rem;
    margin: 1.5rem 0;
    font-style: italic;
    background-color: #f8f9fa;
    padding: 1rem;
}

.whatsapp-float {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background-color: #25d366;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    #clientCarousel {
        overflow: visible; /* allow controls to sit outside */
    }
    #clientCarousel .carousel-control-prev,
    #clientCarousel .carousel-control-next {
        width: 56px;
        height: 56px;
        top: 50%;
        transform: translateY(-50%);
        background: transparent;
        border: none;
        z-index: 1200;
    }
    #clientCarousel .carousel-control-prev { left: -36px; }
    #clientCarousel .carousel-control-next { right: -36px; }
    #clientCarousel .carousel-control-prev-icon,
    #clientCarousel .carousel-control-next-icon {
        width: 44px;
        height: 44px;
        border-radius: 999px;
    }

    /* Visible labeled carousel controls */
    #clientCarousel .custom-carousel-btn {
        display: flex;
        align-items: center;
        gap: 8px;
        color: #fff;
        background: rgba(0,0,0,0.45);
        padding: 6px 10px;
        border-radius: 999px;
        backdrop-filter: blur(4px);
    }
    #clientCarousel .carousel-control-label {
        display: inline-block;
        font-size: 14px;
        font-weight: 600;
    }
    #clientCarousel .custom-carousel-btn .carousel-control-prev-icon,
    #clientCarousel .custom-carousel-btn .carousel-control-next-icon {
        filter: none;
        background-size: 18px 18px;
        width: 28px;
        height: 28px;
    }
    width: auto;
    min-width: 60px;
    padding: 12px 16px;
    border-radius: 50px;
    box-shadow: 0 8px 24px rgba(37, 211, 102, 0.4);
    z-index: 1000;
    text-decoration: none;
    transition: all 0.3s ease;
    font-family: 'Inter', sans-serif;
}

.whatsapp-float:hover {
    transform: translateY(-3px);
    background-color: #20b859;
    color: white;
    box-shadow: 0 12px 32px rgba(37, 211, 102, 0.5);
}

.whatsapp-float i {
    font-size: 24px;
    flex-shrink: 0;
}

.whatsapp-float span {
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
}

/* Mobile adjustment */
@media (max-width: 768px) {
    .whatsapp-float {
        bottom: 20px;
        right: 20px;
        padding: 12px 14px;
        min-width: 50px;
    }
    .whatsapp-float i {
        font-size: 20px;
    }
    .whatsapp-float span {
        font-size: 12px;
    }
}

/* Carousel - Client Images Styling */
.carousel-item img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 8px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.carousel-item img:hover {
    box-shadow: 0 12px 20px rgba(36, 168, 3, 0.3);
    transform: translateY(-5px);
}

.carousel-inner {
    padding: 20px 0;
}

@media (max-width: 768px) {
    .carousel-item img {
        height: 150px;
    }
}

/* ========================================
   IMAGE LOADING & VISIBILITY
   ======================================== */

/* Images start hidden, fade in when loaded */
img:not(footer h5 img) {
    opacity: 0;
    transition: opacity 0.6s ease-in-out;
}

img.image-loaded {
    opacity: 1;
}

/* ========================================
   COMPREHENSIVE IMAGE OPTIMIZATION
   ======================================== */

/* Base Image Styling - All Images (excluding footer logos) */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Exclude footer logos from general image rules */
footer h5 img {
    max-width: none;
    display: inline-block;
}

/* Hero Section Images */
.hero img,
.section-hero img {
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    animation: fadeInUp 0.8s ease-out;
}

.hero img:hover,
.section-hero img:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 50px rgba(36, 168, 3, 0.25);
}

/* Section Content Images */
section img:not(.carousel-item img):not(.grayscale):not(.card-img-top):not(.img-fluid.rounded-start) {
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    transition: all 0.4s ease;
}

section img:not(.carousel-item img):not(.grayscale):not(.card-img-top):not(.img-fluid.rounded-start):hover {
    box-shadow: 0 15px 40px rgba(36, 168, 3, 0.2);
    transform: scale(1.02);
}

/* Card Images */
.card-img-top {
    border-radius: 8px 8px 0 0;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: all 0.4s ease;
    animation: fadeIn 0.6s ease-out;
    object-fit: cover;
    height: 200px;
}

.card-img-top:hover {
    transform: scale(1.05);
    box-shadow: inset 0 2px 8px rgba(36, 168, 3, 0.15), 0 8px 20px rgba(0, 0, 0, 0.15);
}

/* Rounded Start Images (Blog List) */
.img-fluid.rounded-start {
    border-radius: 8px 0 0 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: all 0.4s ease;
    object-fit: cover;
    height: auto;
}

.img-fluid.rounded-start:hover {
    box-shadow: 0 8px 24px rgba(36, 168, 3, 0.2);
    transform: scale(1.03);
}

/* Grayscale Client Images (Carousel) */
.grayscale {
    filter: grayscale(100%);
    opacity: 0.75;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 10px;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
}

.grayscale:hover {
    filter: grayscale(0%);
    opacity: 1;
    transform: scale(1.08) translateY(-6px);
    box-shadow: 0 12px 28px rgba(36, 168, 3, 0.3);
}

/* Navigation & Header Images */
.navbar-brand img,
.navbar img {
    transition: all 0.3s ease;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
    height: auto !important;
    max-width: none !important;
    border-radius: 0 !important;
}

.navbar-brand img:hover,
.navbar img:hover {
    filter: drop-shadow(0 4px 8px rgba(36, 168, 3, 0.2));
    transform: scale(1.05);
}

/* Footer Images */
footer img {
    transition: all 0.3s ease;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

/* Footer Logo - Keep original sizing */
footer h5 img {
    border-radius: 0 !important;
    height: 30px !important;
    width: auto !important;
    max-width: none !important;
    display: inline-block;
    vertical-align: middle;
    animation: none !important;
    opacity: 1 !important;
    box-shadow: none !important;
}

footer h5 img:hover {
    transform: scale(1.03);
    filter: brightness(1.1) drop-shadow(0 2px 4px rgba(255, 255, 255, 0.15));
}

/* Blog Post Images - Main Content */
.post-content img,
.blog-post-content img {
    border-radius: 10px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
    margin: 1.5rem 0;
    transition: all 0.4s ease;
    animation: fadeInUp 0.7s ease-out;
}

.post-content img:hover,
.blog-post-content img:hover {
    box-shadow: 0 16px 40px rgba(36, 168, 3, 0.2);
    transform: scale(1.03);
}

/* Responsive Images */
.img-fluid {
    max-width: 100%;
    height: auto;
    display: block;
    border-radius: 8px;
    transition: all 0.3s ease;
}

/* Image Containers */
.image-container,
.img-container {
    position: relative;
    overflow: hidden;
    border-radius: 12px;
    background: linear-gradient(135deg, #f5f5f5 0%, #efefef 100%);
}

.image-container img,
.img-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: all 0.5s ease;
}

.image-container:hover img,
.img-container:hover img {
    transform: scale(1.05);
}

/* ========================================
   ANIMATIONS
   ======================================== */

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* ========================================
   GALLERY: Responsive Animated Grid + Lightbox
   ======================================== */

.gallery-section { background: linear-gradient(180deg, #ffffff 0%, #fbfdfb 100%); }
.gallery-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    justify-content: center;
}
.gallery-item {
    width: 200px;
    height: 200px;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f7f9f7;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    transition: box-shadow 0.3s, transform 0.3s;
}
.gallery-item:not(:last-child) {
    /* extra spacing for clarity, gap handles most */
    /* margin-right: 18px; */
}
.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 0;
    box-shadow: none;
    filter: grayscale(100%);
    transition: box-shadow 0.3s, transform 0.3s, filter 0.3s;
}
.gallery-item:hover {
    box-shadow: 0 12px 20px rgba(36, 168, 3, 0.18);
    transform: translateY(-5px);
}
.gallery-item:hover img {
    filter: grayscale(0%);
}
.gallery-item:hover {
    transform: translateY(-6px);
    box-shadow: 0 18px 48px rgba(36,168,3,0.14);
}
.gallery-item:hover img { transform: scale(1.05); filter: saturate(1.03); }

/* Enlarge when the item scrolls into view (10% = 1.1 scale) */
.gallery-item.in-view img { transform: scale(1.1); }

/* Lightbox overlay */
.tm-lightbox {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.75);
    z-index: 1500;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.28s ease, visibility 0.28s;
}
.tm-lightbox.open { opacity: 1; visibility: visible; }
.tm-lightbox .lb-inner {
    max-width: 95vw;
    max-height: 90vh;
    width: min(1200px, 96%);
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
}
.tm-lightbox img {
    max-width: 100%;
    max-height: 90vh;
    border-radius: 10px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
    transform: translateY(6px);
    animation: fadeInUp 0.32s ease-out;
}
.tm-lightbox .lb-close {
    position: absolute;
    top: 18px;
    right: 20px;
    color: white;
    font-size: 28px;
    background: rgba(0,0,0,0.35);
    border-radius: 8px;
    padding: 6px 10px;
    cursor: pointer;
}
.tm-lightbox .nav-btn { position: absolute; top: 50%; transform: translateY(-50%); color: white; font-size: 36px; cursor: pointer; user-select: none; }
.tm-lightbox .nav-prev { left: 18px; }
.tm-lightbox .nav-next { right: 18px; }

@media (max-width: 576px) {
    .gallery-grid { gap: 10px; }
    .gallery-item { width: 100px; height: 100px; border-radius: 7px; }
    .gallery-item img { width: 100%; height: 100%; }
    .tm-lightbox .nav-btn { font-size: 28px; }
}

/* small fade for image placeholders */
.gallery-item img { opacity: 0; transition: opacity 0.45s ease; }
.gallery-item img.image-loaded { opacity: 1; }

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes floatImage {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
}

@keyframes glowPulse {
    0%, 100% {
        box-shadow: 0 8px 24px rgba(36, 168, 3, 0.2);
    }
    50% {
        box-shadow: 0 12px 32px rgba(36, 168, 3, 0.35);
    }
}

/* Apply animations to specific sections */
.hero img {
    animation: fadeInUp 0.8s ease-out;
}

.row:nth-child(odd) img {
    animation: slideInLeft 0.8s ease-out;
}

.row:nth-child(even) img {
    animation: slideInRight 0.8s ease-out;
}

.card-img-top {
    animation: fadeIn 0.6s ease-out;
}

.carousel-item img {
    animation: fadeIn 0.5s ease-out;
}

/* ========================================
   SHADOW & DEPTH EFFECTS
   ======================================== */

/* Multiple Shadow Layers for Depth */
.shadow-depth-sm {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
    transition: box-shadow 0.3s ease;
}

.shadow-depth-sm:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.shadow-depth-md {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    transition: box-shadow 0.3s ease;
}

.shadow-depth-md:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.16);
}

.shadow-depth-lg {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    transition: box-shadow 0.3s ease;
}

.shadow-depth-lg:hover {
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.2);
}

/* ========================================
   RESPONSIVE ADJUSTMENTS
   ======================================== */

@media (max-width: 768px) {
    /* Adjust border radius for smaller screens */
    img {
        border-radius: 8px;
    }

    .hero img,
    .section-hero img {
        border-radius: 10px;
        box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
    }

    .hero img:hover,
    .section-hero img:hover {
        transform: translateY(-4px);
    }

    section img:not(.carousel-item img):not(.grayscale):not(.card-img-top):not(.img-fluid.rounded-start) {
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    }

    section img:not(.carousel-item img):not(.grayscale):not(.card-img-top):not(.img-fluid.rounded-start):hover {
        transform: scale(1.01);
    }

    .card-img-top {
        height: 150px;
        border-radius: 8px 8px 0 0;
    }

    .carousel-item img {
        height: 150px;
        border-radius: 8px;
    }

    .grayscale:hover {
        transform: scale(1.04) translateY(-3px);
    }

    .post-content img,
    .blog-post-content img {
        margin: 1rem 0;
    }
}

@media (max-width: 480px) {
    /* Extra small screens - minimal animations */
    .hero img:hover,
    .section-hero img:hover {
        transform: translateY(-2px);
    }

    section img:not(.carousel-item img):not(.grayscale):not(.card-img-top):not(.img-fluid.rounded-start):hover {
        transform: scale(1);
    }

    .grayscale:hover {
        transform: scale(1.02) translateY(-2px);
    }

    .card-img-top {
        height: 120px;
    }

    .carousel-item img {
        height: 120px;
    }
}