/* ============================================================
   JAYAM CRACKERS — FINAL FIX LAYER v5
   Loaded LAST — highest specificity wins.
   Targets:
   1. service-item hover overlay bug (text becoming invisible)
   2. Trending Picks card premium hover
   3. Testimonial section contrast/visibility
   4. Global button shine + glow
   5. Premium animation upgrades
   6. Admin dark theme overrides
   ============================================================ */

/* ===== SECTION A: ROOT CAUSE FIX — HOVER OVERLAY =========
   style.css lines 527-553 expand .service-content::before to
   height:100% with rgba(123,48,38,0.5) which COVERS all text.
   We neutralize it here with !important and z-index layering.
   =========================================================== */

/* Neutralize the opaque overlay that covers Trending Picks text */
.service .service-item .service-content::before,
.service-item .service-content::before {
    display: none !important;               /* kill the overlay entirely */
    height: 0 !important;
    background: none !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

.service .service-item:hover .service-content::before,
.service-item:hover .service-content::before {
    display: none !important;               /* stays gone on hover too */
    height: 0 !important;
    background: none !important;
}

/* Also neutralize the img overlay that dims the image */
.service .service-item .service-img::before {
    display: none !important;
    background: none !important;
}

/* Reset service-content-inner to always be visible */
.service .service-item .service-content .service-content-inner,
.service-item .service-content .service-content-inner {
    position: relative !important;
    z-index: 5 !important;
    color: inherit !important;
}

/* ===== SECTION B: TRENDING PICKS — PREMIUM HOVER =========
   The "Trending Picks" cards use .service-item > .service-content.bg-light
   We replace the broken hover with a clean lift + glow border effect.
   =========================================================== */

/* Base card state */
.service-item {
    border-radius: 18px !important;
    transition:
        transform     0.38s cubic-bezier(0.22,1,0.36,1),
        box-shadow    0.38s ease,
        border-color  0.3s ease !important;
    will-change: transform;
    border: 1px solid rgba(196,0,0,0.08) !important;
    overflow: hidden;
}

/* The inner content card (bg-light) */
.service-item .service-content {
    border-radius: 18px !important;
    transition:
        background    0.35s ease,
        border-color  0.3s ease !important;
    position: relative;
    overflow: hidden;
}

/* Elegant shine-sweep on hover instead of opaque overlay */
.service-item .service-content::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    border-radius: 18px;
    background: linear-gradient(
        135deg,
        rgba(196,0,0,0.0) 0%,
        rgba(196,0,0,0.055) 40%,
        rgba(232,197,71,0.04) 100%
    );
    opacity: 0;
    transition: opacity 0.35s ease;
    pointer-events: none;
    z-index: 0;
}
.service-item:hover .service-content::after { opacity: 1; }

/* Hover: lift + glow border + shadow */
.service-item:hover {
    transform: translateY(-10px) !important;
    box-shadow:
        0 24px 64px rgba(196,0,0,0.18),
        0 8px 24px rgba(0,0,0,0.1),
        0 0 0 1.5px rgba(196,0,0,0.22) !important;
    border-color: rgba(196,0,0,0.22) !important;
}

/* Text always visible — guaranteed */
.service-item .service-content h5,
.service-item .service-content h4,
.service-item .service-content .h5,
.service-item:hover .service-content h5,
.service-item:hover .service-content h4 {
    color: #1e1e2e !important;
    position: relative;
    z-index: 2;
}

.service-item .service-content p,
.service-item .service-content .text-muted,
.service-item:hover .service-content p,
.service-item:hover .service-content .text-muted {
    color: #5c5c66 !important;
    position: relative;
    z-index: 2;
}

.service-item .service-content .btn,
.service-item:hover .service-content .btn {
    position: relative;
    z-index: 2;
    color: #fff !important;
}

/* Badge visibility */
.service-item .jayam-offer-badge,
.service-item:hover .jayam-offer-badge {
    position: relative;
    z-index: 3;
    color: #1e1e2e !important;
}

/* ===== SECTION C: WHY-CHOOSE CARDS ======================== */
.jayam-why-card {
    position: relative;
    background: #ffffff !important;
    border: 1px solid rgba(196, 0, 0, 0.08) !important;
    border-radius: 18px !important;
    padding: 2rem !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.02) !important;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1) !important;
    overflow: hidden !important;
    z-index: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
}
.jayam-why-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 100% 100%, rgba(196, 0, 0, 0.05) 0%, transparent 60%) !important;
    opacity: 0 !important;
    transition: opacity 0.4s ease !important;
    backdrop-filter: none !important;
    z-index: 0;
    pointer-events: none;
}
.jayam-why-card::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, #c40000, #ff1a1a);
    transform: scaleX(0);
    transition: transform 0.35s ease;
    transform-origin: left;
    z-index: 2;
}
.jayam-why-card:hover {
    transform: translateY(-8px) !important;
    border-color: rgba(196, 0, 0, 0.25) !important;
    box-shadow: 0 20px 40px rgba(196, 0, 0, 0.08), 0 5px 15px rgba(0, 0, 0, 0.05) !important;
}
.jayam-why-card:hover::before {
    opacity: 1 !important;
}
.jayam-why-card:hover::after {
    transform: scaleX(1);
}
.jayam-why-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(196, 0, 0, 0.06) !important;
    color: #c40000 !important;
    font-size: 1.35rem;
    margin-bottom: 1.2rem;
    transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1) !important;
    position: relative;
    z-index: 2;
}
.jayam-why-card:hover .jayam-why-icon {
    background: linear-gradient(135deg, #c40000 0%, #ff1a1a 100%) !important;
    color: #ffffff !important;
    transform: scale(1.1) rotate(4deg) !important;
    box-shadow: 0 8px 20px rgba(196, 0, 0, 0.3), 0 0 0 4px rgba(196, 0, 0, 0.1) !important;
}
.jayam-why-card h5 {
    font-family: var(--jayam-font-display);
    font-weight: 700;
    font-size: 1.05rem;
    margin-bottom: 0.5rem;
    color: #1e1e2e !important;
    position: relative;
    z-index: 2;
}
.jayam-why-card p {
    font-size: 0.875rem;
    line-height: 1.5;
    color: #5c5c66 !important;
    position: relative;
    z-index: 2;
}
.jayam-why-card:hover h5 { color: #1e1e2e !important; }
.jayam-why-card:hover p  { color: #5c5c66 !important; }

/* ===== SECTION D: TESTIMONIAL SECTION VISIBILITY =========
   Section is on a red gradient bg (.jayam-section-dark)
   Text must always remain white and readable.
   =========================================================== */
.jayam-section-dark {
    background:
        radial-gradient(ellipse at 0% 0%, rgba(255,60,60,0.18) 0%, transparent 50%),
        radial-gradient(ellipse at 100% 100%, rgba(180,0,0,0.18) 0%, transparent 50%),
        linear-gradient(135deg, #8b0000 0%, #c40000 45%, #a00000 100%) !important;
    position: relative;
    overflow: hidden;
}
/* Subtle texture overlay */
.jayam-section-dark::before {
    opacity: 0.3 !important;
}

.jayam-testimonial-card {
    background: rgba(255,255,255,0.1) !important;
    border: 1px solid rgba(255,255,255,0.18) !important;
    border-radius: 20px !important;
    padding: 2rem !important;
    backdrop-filter: blur(16px) !important;
    -webkit-backdrop-filter: blur(16px) !important;
    box-shadow:
        0 8px 32px rgba(0,0,0,0.25),
        inset 0 1px 0 rgba(255,255,255,0.12) !important;
    transition:
        transform     0.38s cubic-bezier(0.22,1,0.36,1),
        box-shadow    0.38s ease,
        background    0.3s ease,
        border-color  0.3s ease !important;
    will-change: transform;
}
.jayam-testimonial-card:hover {
    transform: translateY(-8px) !important;
    background: rgba(255,255,255,0.15) !important;
    border-color: rgba(232,197,71,0.45) !important;
    box-shadow:
        0 24px 64px rgba(0,0,0,0.35),
        0 0 0 1px rgba(232,197,71,0.3),
        inset 0 1px 0 rgba(255,255,255,0.18) !important;
}
.jayam-testimonial-card .stars,
.jayam-testimonial-card:hover .stars {
    color: #e8c547 !important;
    font-size: 1.1rem;
    letter-spacing: 3px;
}
.jayam-testimonial-card p,
.jayam-testimonial-card:hover p {
    color: rgba(255,255,255,0.92) !important;
    font-size: 0.95rem !important;
    line-height: 1.7 !important;
}
.jayam-testimonial-card .name,
.jayam-testimonial-card:hover .name {
    color: #fff !important;
    font-weight: 700 !important;
}
.jayam-testimonial-card .meta,
.jayam-testimonial-card:hover .meta {
    color: rgba(232,197,71,0.9) !important;
    font-size: 0.8rem !important;
}
/* Section heading on dark bg */
.jayam-section-dark .sub-title { color: #e8c547 !important; }
.jayam-section-dark .section-title p,
.jayam-section-dark p { color: rgba(255,255,255,0.78) !important; }

/* ===== SECTION E: GLOBAL BUTTON SYSTEM (definitive) ====== */

/* Base — all buttons */
.btn {
    position: relative !important;
    overflow: hidden !important;
    transform: translateZ(0);
    backface-visibility: hidden;
    -webkit-font-smoothing: antialiased;
    transition:
        transform     0.32s cubic-bezier(0.25,0.8,0.25,1),
        box-shadow    0.32s ease,
        filter        0.26s ease,
        background    0.26s ease !important;
}
/* Shine sweep */
.btn::before {
    content: '' !important;
    position: absolute !important;
    top: -60%; left: -90% !important;
    width: 60%; height: 220% !important;
    background: linear-gradient(
        108deg,
        transparent 15%,
        rgba(255,255,255,0.22) 50%,
        transparent 85%
    ) !important;
    transform: skewX(-18deg) !important;
    transition: left 0.7s ease !important;
    pointer-events: none !important;
    z-index: 2 !important;
}
.btn:hover::before { left: 160% !important; }
.btn:active { transform: scale(0.963) translateZ(0) !important; }

/* btn-primary */
.btn-primary,
.jayam-site .btn-primary {
    background: linear-gradient(135deg, #c40000 0%, #ff1a1a 100%) !important;
    border-color: transparent !important;
    color: #fff !important;
    box-shadow: 0 6px 22px rgba(196,0,0,0.35) !important;
    text-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.btn-primary:hover,
.jayam-site .btn-primary:hover {
    transform: translateY(-3px) translateZ(0) !important;
    box-shadow: 0 14px 36px rgba(196,0,0,0.5) !important;
    filter: brightness(1.07) !important;
    color: #fff !important;
}
.btn-primary:focus,
.btn-primary:active,
.btn-primary:visited { color: #fff !important; }

/* btn-light */
.btn-light { color: #1e1e2e !important; }
.btn-light:hover {
    color: #c40000 !important;
    background: #fff !important;
    transform: translateY(-2.5px) translateZ(0) !important;
    box-shadow: 0 10px 28px rgba(0,0,0,0.14) !important;
}

/* btn-outline-light */
.btn-outline-light:hover {
    color: #1e1e2e !important;
    background: #fff !important;
    transform: translateY(-2.5px) translateZ(0) !important;
}

/* WhatsApp */
a[href*="wa.me"]:hover,
a[href*="whatsapp"]:hover {
    transform: translateY(-4px) scale(1.06) !important;
    box-shadow: 0 14px 38px rgba(37,211,102,0.5) !important;
}

/* ===== SECTION F: FEATURE / WHY CARDS ==================== */
.feature-item,
.jayam-site .feature-item {
    transition:
        transform     0.36s cubic-bezier(0.22,1,0.36,1),
        box-shadow    0.36s ease,
        border-color  0.3s ease !important;
    will-change: transform;
}
.feature-item:hover,
.jayam-site .feature-item:hover {
    transform: translateY(-8px) !important;
    box-shadow: 0 20px 56px rgba(196,0,0,0.18) !important;
    border-color: rgba(196,0,0,0.22) !important;
}
/* Feature hover text always visible */
.feature-item:hover .feature-content,
.feature-item:hover .feature-content h5,
.feature-item:hover .feature-content p,
.feature-item:hover .feature-content .text-muted,
.feature .feature-item:hover .feature-content,
.feature .feature-item:hover .feature-content h5 {
    color: #1e1e2e !important;
}

/* ===== SECTION G: NAVBAR POLISH ========================== */
body.scrolled .navbar-light.sticky-top,
body.scrolled .navbar.sticky-top {
    background: rgba(255,255,255,0.98) !important;
    backdrop-filter: blur(24px) saturate(180%) !important;
    -webkit-backdrop-filter: blur(24px) saturate(180%) !important;
    box-shadow: 0 4px 28px rgba(0,0,0,0.1) !important;
}
/* Animated underline on desktop nav links */
@media (min-width: 992px) {
    .navbar-light .navbar-nav .nav-link {
        position: relative;
    }
    .navbar-light .navbar-nav .nav-link::after {
        content: '';
        position: absolute;
        bottom: 6px; left: 50%;
        width: 0; height: 2px;
        background: #c40000;
        border-radius: 2px;
        transition:
            width 0.38s cubic-bezier(0.22,1,0.36,1),
            left  0.38s cubic-bezier(0.22,1,0.36,1);
        pointer-events: none;
    }
    .navbar-light .navbar-nav .nav-link:hover::after,
    .navbar-light .navbar-nav .nav-link.active::after {
        width: 55%;
        left: 22.5%;
    }
}

/* ===== SECTION H: HERO SECTION PREMIUM ================== */
.header-carousel .owl-carousel-item,
.header-carousel-item {
    position: relative;
    overflow: hidden;
}
/* Breathing ambient glow */
.header-carousel .owl-carousel-item::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(
        ellipse at 50% 80%,
        rgba(196,0,0,0.2) 0%,
        transparent 58%
    );
    pointer-events: none;
    z-index: 1;
    animation: hero-breathe 9s ease-in-out infinite;
}
@keyframes hero-breathe {
    0%,100% { opacity: 0.5; }
    50%      { opacity: 1; }
}

/* ===== SECTION I: FOOTER ENHANCEMENTS ==================== */
.footer .footer-item a:hover,
.footer a:hover {
    color: #c40000 !important;
}

/* Social icon hover glow */
.footer .btn-square:hover,
.footer [class*="btn-square"]:hover {
    transform: translateY(-4px) scale(1.12) !important;
    box-shadow: 0 10px 28px rgba(196,0,0,0.35) !important;
}

/* ===== SECTION J: SCROLL-REVEAL (ensure classes work) ==== */
.jayam-fade-up {
    opacity: 0;
    transform: translateY(38px);
    transition:
        opacity   0.75s cubic-bezier(0.22,1,0.36,1),
        transform 0.75s cubic-bezier(0.22,1,0.36,1);
    will-change: opacity, transform;
    backface-visibility: hidden;
}
.jayam-fade-up.jayam-visible {
    opacity: 1 !important;
    transform: translateY(0) !important;
}
.jayam-d1 { transition-delay: 0.07s !important; }
.jayam-d2 { transition-delay: 0.17s !important; }
.jayam-d3 { transition-delay: 0.27s !important; }
.jayam-d4 { transition-delay: 0.37s !important; }
.jayam-d5 { transition-delay: 0.47s !important; }

/* ===== SECTION K: PAGE LOAD FADE ========================= */
body { animation: jc-page-in 0.45s cubic-bezier(0.22,1,0.36,1) both; }
@keyframes jc-page-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* ===== SECTION L: FLOATING BUTTONS ======================= */
a.jayam-float-wa {
    position: fixed !important;
    bottom: 5.8rem !important;
    right: 1.6rem !important;
    left: auto !important;
    width: 54px !important; height: 54px !important;
    border-radius: 50% !important;
    background: linear-gradient(145deg, #25D366, #128C7E) !important;
    box-shadow: 0 6px 26px rgba(37,211,102,0.5) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 1.55rem !important;
    color: #fff !important;
    text-decoration: none !important;
    z-index: 1050 !important;
    transition:
        transform 0.34s cubic-bezier(0.25,0.8,0.25,1),
        box-shadow 0.34s ease !important;
    will-change: transform;
    animation: wa-bounce 3s ease-in-out infinite;
}
@keyframes wa-bounce {
    0%,100% { transform: translateY(0); }
    50%      { transform: translateY(-5px); }
}
a.jayam-float-wa:hover {
    transform: translateY(-6px) scale(1.1) !important;
    box-shadow: 0 20px 50px rgba(37,211,102,0.6) !important;
    color: #fff !important;
    animation: none !important;
}

.back-to-top {
    position: fixed !important;
    right: 1.6rem !important;
    bottom: 1.6rem !important;
    left: auto !important;
    width: 46px !important; height: 46px !important;
    border-radius: 50% !important;
    background: linear-gradient(135deg, #c40000, #ff1a1a) !important;
    box-shadow: 0 6px 24px rgba(196,0,0,0.4) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 !important;
    z-index: 1049 !important;
    transition:
        transform 0.3s cubic-bezier(0.25,0.8,0.25,1),
        box-shadow 0.3s ease !important;
    will-change: transform;
}
.back-to-top i { color: #fff !important; }
.back-to-top:hover {
    transform: translateY(-5px) !important;
    box-shadow: 0 18px 42px rgba(196,0,0,0.58) !important;
}

/* ===== SECTION M: MOBILE RESPONSIVE ====================== */
@media (max-width: 575.98px) {
    a.jayam-float-wa {
        right: 1rem !important;
        bottom: 5.75rem !important;
        width: 48px !important; height: 48px !important;
        font-size: 1.35rem !important;
    }
    .back-to-top {
        right: 1rem !important;
        bottom: 1.25rem !important;
        width: 42px !important; height: 42px !important;
    }
    .service-item:hover { transform: translateY(-5px) !important; }
    .jayam-fade-up { transform: translateY(22px); }
}

/* ===== SECTION N: ACCESSIBILITY ========================== */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    .jayam-fade-up { opacity: 1 !important; transform: none !important; }
    a.jayam-float-wa { animation: none !important; }
}
