/* ==========================================================================
   Portal Layanan SDMK Tangsel - Custom Styles
   ========================================================================== */

/* Glassmorphism Effect */
.glassmorphism {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
}

/* Mobile & Tablet Performance Optimization:
   Disable expensive real-time backdrop blur during scrolling on mobile and tablet devices
   (screens <= 1024px or touch/coarse pointers) to eliminate GPU lag and stutter */
@media (max-width: 1024px), (hover: none) and (pointer: coarse) {
    .glassmorphism {
        background: rgba(255, 255, 255, 0.98) !important;
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
        border-bottom: 1px solid rgba(0, 0, 0, 0.06) !important;
    }
}

/* Dropdown Menu Transition */
.dropdown-menu {
    visibility: hidden;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease;
}

.group:hover .dropdown-menu {
    visibility: visible;
    opacity: 1;
    transform: translateY(0);
}

/* Swiper Tautan Terkait */
.tautan-swiper {
    width: 100%;
    padding-top: 0.5rem !important;
    padding-bottom: 0.75rem !important;
}

/* Mobile: 1 card centered per view with symmetrical proportions */
@media (max-width: 767.98px) {
    .tautan-swiper .swiper-slide {
        width: 100% !important;
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
    }
}

/* Desktop & Tablet: continuous auto-width slides */
@media (min-width: 768px) {
    .tautan-swiper .swiper-slide {
        width: 16rem !important; /* w-64 = 256px */
        flex-shrink: 0;
    }
}

.tautan-pagination .swiper-pagination-bullet {
    background-color: #cbd5e1;
    opacity: 0.8;
    width: 8px;
    height: 8px;
    margin: 0 4px;
    border-radius: 9999px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.tautan-pagination .swiper-pagination-bullet-active {
    background-color: #0d9488;
    width: 24px;
    opacity: 1;
}

/* Floating / Flying Looping Animation */
@keyframes floatAnimation {
    0%,
    100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-22px);
    }
}

@keyframes floatShadow {
    0%,
    100% {
        transform: scale(1);
        opacity: 0.25;
    }
    50% {
        transform: scale(0.72);
        opacity: 0.10;
    }
}

.animate-float {
    animation: floatAnimation 3.5s ease-in-out infinite;
    will-change: transform;
}

.animate-float-shadow {
    animation: floatShadow 3.5s ease-in-out infinite;
}

/* Mobile & Tablet GPU & Battery Optimizations:
   Disable heavy continuous keyframe animations, drop-shadow filters, and multi-layer Gaussian blurs */
@media (max-width: 1024px), (hover: none) and (pointer: coarse), (prefers-reduced-motion: reduce) {
    .animate-float {
        animation: none !important;
        transform: none !important;
        will-change: auto !important;
    }
    .animate-float-shadow {
        animation: none !important;
        opacity: 0.18 !important;
        transform: none !important;
    }
    .hero-blur-orb {
        display: none !important;
    }
}

/* Touch responsiveness: eliminate 300ms mobile tap delay */
button, a, input, select, textarea, summary, [role="button"], .cursor-pointer {
    touch-action: manipulation;
}

/* Button Arrow Continuous Loop Bounce Down */
@keyframes bounceDown {
    0%,
    100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(6px);
    }
}

.animate-arrow-bounce {
    animation: bounceDown 1.2s ease-in-out infinite;
    will-change: transform;
}

/* Mobile Footer Accordion */
@media (max-width: 767px) {
    .footer-accordion-content {
        max-height: 0;
        overflow: hidden;
        opacity: 0;
        transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.25s ease;
    }

    .footer-accordion-content.is-open {
        max-height: 450px;
        opacity: 1;
        transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.35s ease;
    }
}

@media (min-width: 768px) {
    .footer-accordion-content {
        max-height: none !important;
        overflow: visible !important;
        opacity: 1 !important;
        display: block !important;
    }
}

/* Hide scrollbar for Chrome, Safari, and Opera */
.no-scrollbar::-webkit-scrollbar {
    display: none;
}
/* Hide scrollbar for IE, Edge, and Firefox */
.no-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* ==========================================================================
   YouTube Video Facade Player (Lazy Loading & Custom Play Button)
   ========================================================================== */
.video-facade {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background-color: #020617; /* slate-950 */
    overflow: hidden;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
}

.video-facade-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1), filter 0.3s ease;
}

.video-facade:hover .video-facade-thumb {
    transform: scale(1.05);
}

.video-facade-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.1) 0%, rgba(15, 23, 42, 0.35) 100%);
    transition: background 0.3s ease;
    pointer-events: none;
    z-index: 2;
}

.video-facade:hover .video-facade-overlay {
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.05) 0%, rgba(15, 23, 42, 0.2) 100%);
}

.video-facade-btn-wrapper {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    z-index: 10;
}

/* Play Button Circle (Tosca themed to match Dinkes Tangsel site) */
.video-play-btn {
    position: relative;
    width: 3.75rem; /* 60px */
    height: 3.75rem;
    border-radius: 9999px;
    background-color: #0d9488 !important; /* tosca-600 */
    color: #ffffff !important;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 25px -4px rgba(13, 148, 136, 0.65), 0 4px 12px rgba(0, 0, 0, 0.3) !important;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), background-color 0.25s ease, box-shadow 0.3s ease;
    border: 3px solid rgba(255, 255, 255, 0.4) !important;
}

@media (min-width: 640px) {
    .video-play-btn {
        width: 4.25rem; /* 68px */
        height: 4.25rem;
    }
}

.video-facade:hover .video-play-btn {
    transform: scale(1.12);
    background-color: #0f766e !important; /* tosca-700 */
    box-shadow: 0 14px 30px -4px rgba(13, 148, 136, 0.8), 0 6px 16px rgba(0, 0, 0, 0.35) !important;
    border-color: rgba(255, 255, 255, 0.8) !important;
}

.video-play-icon {
    font-size: 1.35rem;
    margin-left: 3px; /* Optically centers the right-pointing triangle */
    color: #ffffff !important;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.3));
    transition: transform 0.3s ease;
}

@media (min-width: 640px) {
    .video-play-icon {
        font-size: 1.55rem;
        margin-left: 4px;
    }
}

.video-facade:hover .video-play-icon {
    transform: scale(1.08);
}

/* Ambient glow behind play button */
.video-play-btn-glow {
    position: absolute;
    width: 4.5rem;
    height: 4.5rem;
    border-radius: 9999px;
    background: radial-gradient(circle, rgba(13, 148, 136, 0.6) 0%, rgba(13, 148, 136, 0) 70%);
    transition: transform 0.3s ease, opacity 0.3s ease;
    opacity: 0.7;
    pointer-events: none;
    z-index: 5;
}

@media (min-width: 640px) {
    .video-play-btn-glow {
        width: 5.25rem;
        height: 5.25rem;
    }
}

.video-facade:hover .video-play-btn-glow {
    transform: scale(1.25);
    opacity: 1;
}

/* ==========================================================================
   Video Panduan Category Filter Tabs
   ========================================================================== */
.video-filter-btn {
    transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
}

.video-filter-btn:hover {
    transform: translateY(-1px);
}

.video-filter-btn:active {
    transform: translateY(0) scale(0.97);
}

.video-filter-btn.active-filter {
    background-color: #0d9488 !important; /* tosca-600 */
    border-color: #0d9488 !important;
    color: #ffffff !important;
    box-shadow: 0 4px 14px 0 rgba(13, 148, 136, 0.35) !important;
}

.video-filter-btn.active-filter i {
    color: #ffffff !important;
}

@keyframes videoCategoryFadeIn {
    0% {
        opacity: 0;
        transform: translateY(8px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.video-category-animate {
    animation: videoCategoryFadeIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Custom Spacing Helpers for Layout Containers */
.space-y-10 > :not([hidden]) ~ :not([hidden]) {
    margin-top: 2.5rem !important;
}

.space-y-12 > :not([hidden]) ~ :not([hidden]) {
    margin-top: 3rem !important;
}

/* ==========================================================================
   Responsive Layout & Overflow Safety Helpers
   ========================================================================== */
.max-w-full {
    max-width: 100% !important;
}

.break-words {
    overflow-wrap: break-word !important;
    word-break: break-word !important;
}
