@tailwind base;
@tailwind components;
@tailwind utilities;

html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px;
    width: 100%;
    overflow-x: hidden;
    /* Header height offset */
}

body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    width: 100%;
    overflow-x: hidden;
    /* Disable text selection */
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* Scroll Animation revealed classes */
.rv-reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s cubic-bezier(0.2, 1, 0.3, 1);
}

.rv-reveal-active {
    opacity: 1;
    transform: translateY(0);
}

.rv-delay-100 {
    transition-delay: 0.1s;
}

.rv-delay-200 {
    transition-delay: 0.2s;
}

.rv-delay-300 {
    transition-delay: 0.3s;
}

/* Swiper Fade Effect Fix */
.swiper-slide {
    height: auto;
}

.swiper-fade .swiper-slide {
    opacity: 0 !important;
}

.swiper-fade .swiper-slide-active {
    opacity: 1 !important;
}

/* Prevent bottom gap in FV images */
picture img {
    vertical-align: bottom;
}

/* Mobile Menu Animation */
#sp-menu {
    transition: opacity 0.3s ease-in-out, visibility 0.3s;
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
}

#sp-menu.active {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
}

/* Scroll Top Button Visibility */
#scrollTop {
    transition: opacity 0.3s, transform 0.3s;
}

#scrollTop.show {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

/* Gallery PC Grid Overrides when Swiper is disabled */
@media (min-width: 768px) {

    /* Force grid layout for gallery wrapper on PC */
    .gallery-swiper .swiper-wrapper {
        display: grid !important;
        grid-template-columns: repeat(3, 1fr);
        gap: 1rem;
        transform: none !important;
        /* Remove swiper transform */
        width: 100% !important;
        height: auto !important;
    }

    .gallery-swiper .swiper-slide {
        width: auto !important;
        height: 16rem !important;
        /* h-64 equivalent */
        margin-right: 0 !important;
        opacity: 1 !important;
    }
}

/* Sticky Bottom Button Fix */
.sticky-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    z-index: 50;
    /* Ensure strictly above other elements */
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
}

/* SP Alignment Fix for Paragraph Titles in About & Service */
@media (max-width: 768px) {

    #about h3 {
        text-align: center;
        width: 100%;
        line-height: 1.6;
        word-break: auto-phrase;
        overflow-wrap: break-word;
    }

    #service h3 {
        line-height: 1.6;
        word-break: auto-phrase;
        overflow-wrap: break-word;
    }
}

@media screen and (max-width: 767px) {
    .sp-break {
        display: block;
    }

    .sp-no-break {
        display: inline;
    }

    .mobile-only {
        display: inline;
    }
}

@media screen and (min-width: 768px) {
    .mobile-only {
        display: none;
    }
}

/* Premium UI Utilities */
.card-premium {
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.1);
    transition: all 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.card-premium:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px -15px rgba(217, 30, 24, 0.15);
}

.text-glow {
    text-shadow: 0 0 15px rgba(217, 30, 24, 0.3);
}

.bg-pattern {
    background-image: radial-gradient(#d91e18 0.5px, transparent 0.5px);
    background-size: 10px 10px;
}

.cta-glass {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.cta-gradient-glow {
    background: linear-gradient(135deg, #D91E18 0%, #b01813 100%);
    position: relative;
    z-index: 1;
}

.cta-gradient-glow::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at center, rgba(255, 255, 255, 0.15) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.5s ease;
    z-index: -1;
}

.cta-gradient-glow:hover::after {
    opacity: 1;
}

@media (min-width: 768px) {
    .md\:text-2xl {
        font-size: 1.3rem;
        line-height: 2rem;
    }
}

#service h3 {
    font-size: 1.3rem;
}

/* SP only heading size */
@media (max-width: 767px) {
    .sp-text-1_6rem {
        font-size: 1.6rem !important;
    }
}