/* ==========================================================================
   MAS Marine Services (India) Pvt. Ltd.
   Mobile & Tablet Optimized Styles Complementary to Tailwind CSS
   ========================================================================== */

/* Custom Smooth Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: #f1f3f7;
}

::-webkit-scrollbar-thumb {
    background: #8195ab;
    border-radius: 9999px;
}

::-webkit-scrollbar-thumb:hover {
    background: #008ecb;
}

/* Hide scrollbar for clean horizontal swipe containers */
.no-scrollbar::-webkit-scrollbar {
    display: none;
}

.no-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* Glassmorphism utility helpers */
.glass-effect {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.glass-badge {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

/* Subtle maritime card hover elevation */
.card-hover-marine {
    transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

@media (hover: hover) and (pointer: fine) {
    .card-hover-marine:hover {
        transform: translateY(-4px);
    }
}

/* Touch Momentum & Mobile Optimizations */
.touch-pan-x {
    -webkit-overflow-scrolling: touch;
    touch-action: pan-x;
    overscroll-behavior-x: contain;
}

a,
button,
input,
select,
textarea {
    -webkit-tap-highlight-color: transparent;
}

/* iOS Safari prevent zoom on focus */
@media screen and (max-width: 767px) {

    input,
    select,
    textarea {
        font-size: 16px !important;
    }
}

/* Safe area padding for mobile notches and gesture bars */
.safe-bottom {
    padding-bottom: max(1rem, env(safe-area-inset-bottom));
}

.safe-bottom-dock {
    bottom: max(0.75rem, env(safe-area-inset-bottom));
}

/* Ensure footer content clears fixed mobile bottom action dock and WhatsApp button */
.footer-bottom-bar {
    padding-bottom: calc(7.5rem + env(safe-area-inset-bottom, 0px)) !important;
}

@media (min-width: 768px) {
    .footer-bottom-bar {
        padding-bottom: 0 !important;
    }
}

/* Scroll Fade Masks for Horizontal Strips */
.scroll-mask-edges {
    mask-image: linear-gradient(to right, transparent, black 24px, black calc(100% - 24px), transparent);
    -webkit-mask-image: linear-gradient(to right, transparent, black 24px, black calc(100% - 24px), transparent);
}

/* Off-Canvas Mobile Navigation Drawer & Backdrop */
#mobileDrawerBackdrop {
    position: fixed;
    inset: 0;
    background-color: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 99998;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

#mobileDrawerBackdrop.drawer-open {
    opacity: 1;
    pointer-events: auto;
}

#mobileDrawer {
    position: fixed;
    top: 0;
    bottom: 0;
    right: 0;
    width: 320px;
    max-width: 86vw;
    height: 100%;
    background-color: #ffffff;
    z-index: 99999;
    box-shadow: -6px 0 35px rgba(15, 23, 42, 0.25);
    transform: translateX(100%);
    transition: transform 0.32s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.32s;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    overflow: hidden;
    visibility: hidden;
}

#mobileDrawer.drawer-open {
    transform: translateX(0);
    visibility: visible;
}

@media (min-width: 1024px) {
    #mobileDrawer, #mobileDrawerBackdrop {
        display: none !important;
    }
}

/* Hamburger Icon Animation to X */
.hamburger-line {
    transition: transform 0.24s ease-in-out, opacity 0.2s ease-in-out;
    transform-origin: center;
}

.menu-open .hamburger-line-1 {
    transform: translateY(6px) rotate(45deg);
}

.menu-open .hamburger-line-2 {
    opacity: 0;
}

.menu-open .hamburger-line-3 {
    transform: translateY(-6px) rotate(-45deg);
}

/* Mobile Carousel Indicator Dots */
.carousel-dot {
    transition: width 0.3s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.3s ease;
}

.carousel-dot.active {
    width: 24px;
    background-color: #008ecb;
}

/* Mobile Floating Action Dock */
.mobile-action-dock {
    box-shadow: 0 10px 30px -5px rgba(10, 16, 27, 0.35), 0 0 1px 1px rgba(255, 255, 255, 0.2) inset;
}

/* WhatsApp Floating Action Button */
#whatsappFloatingBtn {
    box-shadow: 0 10px 25px -4px rgba(37, 211, 102, 0.45), 0 4px 8px -2px rgba(37, 211, 102, 0.25);
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s ease;
}

#whatsappFloatingBtn:hover {
    box-shadow: 0 16px 32px -4px rgba(37, 211, 102, 0.55), 0 6px 12px -2px rgba(37, 211, 102, 0.35);
}

/* ==========================================================================
   Corporate Services Mega-Dropdown Animations & Positioning
   ========================================================================== */
.services-dropdown {
    opacity: 0;
    visibility: hidden;
    transform: translateX(-50%) translateY(8px);
    transition: opacity 0.22s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.22s cubic-bezier(0.16, 1, 0.3, 1),
                visibility 0.22s ease-in-out;
    pointer-events: none;
    will-change: opacity, transform;
}

.services-dropdown-trigger:hover .services-dropdown,
.services-dropdown-trigger:focus-within .services-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
    pointer-events: auto;
}

/* Small Laptop / Compact Desktop Screen Optimization (1024px to 1279px) */
@media (min-width: 1024px) and (max-width: 1279px) {
    .services-dropdown {
        left: 50% !important;
        transform: translateX(-58%) translateY(8px) !important;
    }

    .services-dropdown-trigger:hover .services-dropdown,
    .services-dropdown-trigger:focus-within .services-dropdown {
        transform: translateX(-58%) translateY(0) !important;
    }
}

/* Micro-interaction for dropdown items */
.service-item-card {
    transition: background-color 0.18s ease, transform 0.18s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.18s ease;
}

.service-item-card:hover {
    transform: translateX(2px);
}