/**
 * WDP OPN Frontend Styles
 *
 * Styles for the one-page navigation widget.
 * Note: Color values are controlled via Elementor widget controls.
 * Only structural/layout styles are defined here.
 */

/* ==========================================
   Wrapper
   ========================================== */

.wdpopn-wrapper {
    position: relative;
    width: 100%;
    overflow: hidden;
}

/* ==========================================
   Sections Content
   ========================================== */

.wdpopn-sections-content {
    position: relative;
    width: 100%;
    gap: 0 !important;
    /* No gap between sections */
}

.wdpopn-section {
    display: none;
    width: 100%;
    min-height: 100vh;
    min-height: 100dvh;
    position: relative;
    overflow-y: auto;
    overflow-x: hidden;
}

.wdpopn-section-active {
    display: block;
}

/* When .wdpopn-section IS the .e-con, keep flex display */
.e-con.wdpopn-section {
    min-height: 100vh;
    min-height: 100dvh;
}

.e-con.wdpopn-section:not(.wdpopn-section-active):not(.wdpopn-section-editor-visible) {
    display: none;
}

/* FOUC Prevention — ensures sections stay hidden when JS is delayed by cache plugins */
.wdpopn-locked .wdpopn-section:not(.wdpopn-section-active) {
    display: none !important;
}

.e-con.wdpopn-section-active {
    display: flex !important;
    flex-direction: column !important;
    height: 100vh !important;
    height: 100dvh !important;
    max-height: 100vh !important;
    max-height: 100dvh !important;
    overflow: hidden !important;
}

/* Editor: ensure sections are 100vh and stacked without gap */
.e-con.wdpopn-section-editor-visible {
    display: flex;
    min-height: 100vh;
    min-height: 100dvh;
}

/* Remove any gap Elementor sets on the wrapper widget */
.elementor-widget-wdpopn-navigation>.e-con {
    gap: 0 !important;
}

.wdpopn-wrapper .wdpopn-sections-content>.e-con {
    margin: 0 !important;
}

.e-con.wdpopn-section-active > .e-con.opn-scroll {
    flex: 1 1 0% !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: 100% !important;
    width: 100%;
    overflow-y: auto !important;
    overflow-x: hidden !important;
}

.e-con.opn-scroll > .e-con-inner,
.e-flex.opn-scroll > .e-con-inner,
.opn-scroll > .e-con-inner {
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    width: 100% !important;
    box-sizing: border-box !important;
    flex-shrink: 0 !important;
}

/* ==========================================
   Section Transition Animations
   ========================================== */

/* --- Fade --- */
.wdpopn-section-entering.wdpopn-anim-fade {
    animation: wdpopnFadeIn 0.45s ease forwards;
}

.wdpopn-section-leaving.wdpopn-anim-fade {
    animation: wdpopnFadeOut 0.45s ease forwards;
}

@keyframes wdpopnFadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes wdpopnFadeOut {
    from {
        opacity: 1;
    }

    to {
        opacity: 0;
    }
}

/* --- Slide Up / Down --- */
.wdpopn-section-entering.wdpopn-anim-slide-up.wdpopn-dir-forward {
    animation: wdpopnSlideInUp 0.45s ease forwards;
}

.wdpopn-section-leaving.wdpopn-anim-slide-up.wdpopn-dir-forward {
    animation: wdpopnSlideOutUp 0.45s ease forwards;
}

.wdpopn-section-entering.wdpopn-anim-slide-up.wdpopn-dir-backward {
    animation: wdpopnSlideInDown 0.45s ease forwards;
}

.wdpopn-section-leaving.wdpopn-anim-slide-up.wdpopn-dir-backward {
    animation: wdpopnSlideOutDown 0.45s ease forwards;
}

@keyframes wdpopnSlideInUp {
    from {
        transform: translateY(30px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes wdpopnSlideOutUp {
    from {
        transform: translateY(0);
        opacity: 1;
    }

    to {
        transform: translateY(-30px);
        opacity: 0;
    }
}

@keyframes wdpopnSlideInDown {
    from {
        transform: translateY(-30px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes wdpopnSlideOutDown {
    from {
        transform: translateY(0);
        opacity: 1;
    }

    to {
        transform: translateY(30px);
        opacity: 0;
    }
}

/* --- Slide Left / Right --- */
.wdpopn-section-entering.wdpopn-anim-slide-left.wdpopn-dir-forward {
    animation: wdpopnSlideInLeft 0.45s ease forwards;
}

.wdpopn-section-leaving.wdpopn-anim-slide-left.wdpopn-dir-forward {
    animation: wdpopnSlideOutLeft 0.45s ease forwards;
}

.wdpopn-section-entering.wdpopn-anim-slide-left.wdpopn-dir-backward {
    animation: wdpopnSlideInRight 0.45s ease forwards;
}

.wdpopn-section-leaving.wdpopn-anim-slide-left.wdpopn-dir-backward {
    animation: wdpopnSlideOutRight 0.45s ease forwards;
}

@keyframes wdpopnSlideInLeft {
    from {
        transform: translateX(30px);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes wdpopnSlideOutLeft {
    from {
        transform: translateX(0);
        opacity: 1;
    }

    to {
        transform: translateX(-30px);
        opacity: 0;
    }
}

@keyframes wdpopnSlideInRight {
    from {
        transform: translateX(-30px);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes wdpopnSlideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }

    to {
        transform: translateX(30px);
        opacity: 0;
    }
}

/* --- Zoom --- */
.wdpopn-section-entering.wdpopn-anim-zoom {
    animation: wdpopnZoomIn 0.45s ease forwards;
}

.wdpopn-section-leaving.wdpopn-anim-zoom {
    animation: wdpopnZoomOut 0.45s ease forwards;
}

@keyframes wdpopnZoomIn {
    from {
        transform: scale(0.85);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes wdpopnZoomOut {
    from {
        transform: scale(1);
        opacity: 1;
    }

    to {
        transform: scale(1.15);
        opacity: 0;
    }
}

/* --- Zoom Fade --- */
.wdpopn-section-entering.wdpopn-anim-zoom-fade.wdpopn-dir-forward {
    animation: wdpopnZoomFadeIn 0.45s ease forwards;
}

.wdpopn-section-leaving.wdpopn-anim-zoom-fade.wdpopn-dir-forward {
    animation: wdpopnZoomFadeOutShrink 0.45s ease forwards;
}

.wdpopn-section-entering.wdpopn-anim-zoom-fade.wdpopn-dir-backward {
    animation: wdpopnZoomFadeInShrink 0.45s ease forwards;
}

.wdpopn-section-leaving.wdpopn-anim-zoom-fade.wdpopn-dir-backward {
    animation: wdpopnZoomFadeOut 0.45s ease forwards;
}

@keyframes wdpopnZoomFadeIn {
    from {
        transform: scale(1.1);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes wdpopnZoomFadeOutShrink {
    from {
        transform: scale(1);
        opacity: 1;
    }

    to {
        transform: scale(0.9);
        opacity: 0;
    }
}

@keyframes wdpopnZoomFadeInShrink {
    from {
        transform: scale(0.9);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes wdpopnZoomFadeOut {
    from {
        transform: scale(1);
        opacity: 1;
    }

    to {
        transform: scale(1.1);
        opacity: 0;
    }
}

/* --- Flip Horizontal (X axis) --- */
.wdpopn-section-entering.wdpopn-anim-flip-x {
    animation: wdpopnFlipXIn 0.5s ease forwards;
}

.wdpopn-section-leaving.wdpopn-anim-flip-x {
    animation: wdpopnFlipXOut 0.5s ease forwards;
}

@keyframes wdpopnFlipXIn {
    from {
        transform: perspective(600px) rotateY(90deg);
        opacity: 0;
    }

    to {
        transform: perspective(600px) rotateY(0deg);
        opacity: 1;
    }
}

@keyframes wdpopnFlipXOut {
    from {
        transform: perspective(600px) rotateY(0deg);
        opacity: 1;
    }

    to {
        transform: perspective(600px) rotateY(-90deg);
        opacity: 0;
    }
}

/* --- Flip Vertikal (Y axis) --- */
.wdpopn-section-entering.wdpopn-anim-flip-y {
    animation: wdpopnFlipYIn 0.5s ease forwards;
}

.wdpopn-section-leaving.wdpopn-anim-flip-y {
    animation: wdpopnFlipYOut 0.5s ease forwards;
}

@keyframes wdpopnFlipYIn {
    from {
        transform: perspective(600px) rotateX(90deg);
        opacity: 0;
    }

    to {
        transform: perspective(600px) rotateX(0deg);
        opacity: 1;
    }
}

@keyframes wdpopnFlipYOut {
    from {
        transform: perspective(600px) rotateX(0deg);
        opacity: 1;
    }

    to {
        transform: perspective(600px) rotateX(-90deg);
        opacity: 0;
    }
}

/* --- Rotate --- */
.wdpopn-section-entering.wdpopn-anim-rotate.wdpopn-dir-forward {
    animation: wdpopnRotateIn 0.5s ease forwards;
}

.wdpopn-section-leaving.wdpopn-anim-rotate.wdpopn-dir-forward {
    animation: wdpopnRotateOut 0.5s ease forwards;
}

.wdpopn-section-entering.wdpopn-anim-rotate.wdpopn-dir-backward {
    animation: wdpopnRotateInReverse 0.5s ease forwards;
}

.wdpopn-section-leaving.wdpopn-anim-rotate.wdpopn-dir-backward {
    animation: wdpopnRotateOutReverse 0.5s ease forwards;
}

@keyframes wdpopnRotateIn {
    from {
        transform: rotate(15deg) scale(0.9);
        opacity: 0;
    }

    to {
        transform: rotate(0deg) scale(1);
        opacity: 1;
    }
}

@keyframes wdpopnRotateOut {
    from {
        transform: rotate(0deg) scale(1);
        opacity: 1;
    }

    to {
        transform: rotate(-15deg) scale(0.9);
        opacity: 0;
    }
}

@keyframes wdpopnRotateInReverse {
    from {
        transform: rotate(-15deg) scale(0.9);
        opacity: 0;
    }

    to {
        transform: rotate(0deg) scale(1);
        opacity: 1;
    }
}

@keyframes wdpopnRotateOutReverse {
    from {
        transform: rotate(0deg) scale(1);
        opacity: 1;
    }

    to {
        transform: rotate(15deg) scale(0.9);
        opacity: 0;
    }
}

/* --- Slide Fade Up (no direction) --- */
.wdpopn-section-entering.wdpopn-anim-slide-fade-up {
    animation: wdpopnSlideFadeUpIn 0.5s ease forwards;
}

.wdpopn-section-leaving.wdpopn-anim-slide-fade-up {
    animation: wdpopnSlideFadeUpOut 0.5s ease forwards;
}

@keyframes wdpopnSlideFadeUpIn {
    from {
        transform: translateY(50px) scale(0.95);
        opacity: 0;
    }

    to {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

@keyframes wdpopnSlideFadeUpOut {
    from {
        transform: translateY(0) scale(1);
        opacity: 1;
    }

    to {
        transform: translateY(-30px) scale(0.95);
        opacity: 0;
    }
}

/* Leaving sections must be positioned absolute to overlay during transition */
.wdpopn-section-leaving {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 0;
}

.wdpopn-section-entering {
    z-index: 1;
}

/* ==========================================
   Navigation Container — Base + Posisi
   ========================================== */

/* --- Base (semua posisi) --- */
.wdpopn-navigation-container {
    position: fixed;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 5px 10px;
    border-radius: 50px;
    background: rgba(255, 255, 255, 0.95);
    z-index: 999;
    scrollbar-width: none;      /* Firefox */
    -ms-overflow-style: none;   /* IE/Edge */
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.wdpopn-navigation-container::-webkit-scrollbar {
    display: none; /* Chrome/Safari */
}

/* --- TOP --- */
.wdpopn-navigation-container.wdpopn-pos-top {
    top: 20px;
    bottom: auto;
    left: 0;
    right: 0;
    flex-direction: row;
    margin-left: auto;
    margin-right: auto;
    width: fit-content;
    max-width: 95%;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
}

/* --- BOTTOM (default) --- */
.wdpopn-navigation-container.wdpopn-pos-bottom {
    bottom: 20px;
    top: auto;
    left: 0;
    right: 0;
    flex-direction: row;
    margin-left: auto;
    margin-right: auto;
    width: fit-content;
    max-width: 95%;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
}

/* --- LEFT --- */
.wdpopn-navigation-container.wdpopn-pos-left {
    left: 20px;
    right: auto;
    top: 50%;
    transform: translateY(-50%);
    flex-direction: column;
    width: fit-content;
    /* max-height diatur via Elementor control (default: 80vh) */
    overflow-y: auto;
    overflow-x: hidden;
}

/* --- RIGHT --- */
.wdpopn-navigation-container.wdpopn-pos-right {
    right: 20px;
    left: auto;
    top: 50%;
    transform: translateY(-50%);
    flex-direction: column;
    width: fit-content;
    /* max-height diatur via Elementor control (default: 80vh) */
    overflow-y: auto;
    overflow-x: hidden;
}

/* Hidden state (locked) — per posisi */
.wdpopn-pos-top.wdpopn-nav-hidden {
    opacity: 0;
    transform: translateY(-100px);
    pointer-events: none;
}

.wdpopn-pos-bottom.wdpopn-nav-hidden {
    opacity: 0;
    transform: translateY(100px);
    pointer-events: none;
}

.wdpopn-pos-left.wdpopn-nav-hidden {
    opacity: 0;
    transform: translateX(-100px) translateY(-50%);
    pointer-events: none;
}

.wdpopn-pos-right.wdpopn-nav-hidden {
    opacity: 0;
    transform: translateX(100px) translateY(-50%);
    pointer-events: none;
}

/* ==========================================
   Navigation Buttons
   ========================================== */

.wdpopn-nav-button {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 50px;
    padding: 8px 5px;
    border: none;
    border-radius: 25px;
    background: transparent;
    cursor: pointer;
    outline: none;
    transition: all 0.3s ease;
    flex-shrink: 0;
    -webkit-tap-highlight-color: transparent;
}

/* ==========================================
   Icon
   ========================================== */

.wdpopn-nav-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 20px;
    line-height: 1;
    margin-bottom: 3px;
    width: auto;
    height: auto;
    transition: color 0.3s ease;
}

.wdpopn-nav-icon i {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1em;
    height: 1em;
    font-size: inherit;
    line-height: 1;
}

.wdpopn-nav-icon svg {
    width: 1em;
    height: 1em;
    flex-shrink: 0;
    transition: fill 0.3s ease;
}

/* Active icon swap */
.wdpopn-nav-icon-active {
    display: none;
}

.wdpopn-nav-button.active .wdpopn-nav-icon-default {
    display: none;
}

.wdpopn-nav-button.active .wdpopn-nav-icon-active {
    display: flex;
}

/* If no active icon defined, keep default visible */
.wdpopn-nav-button.active .wdpopn-nav-icon-default:only-child {
    display: flex;
}

/* ==========================================
   Label
   ========================================== */

.wdpopn-nav-label {
    font-size: 10px;
    line-height: 1.2;
    text-align: center;
    white-space: nowrap;
    transition: color 0.3s ease;
}

/* ==========================================
   Editor Mode
   ========================================== */

/* Wrapper uses flexbox to push nav to bottom */
.wdpopn-editor-mode.wdpopn-wrapper {
    display: flex;
    flex-direction: column;
    overflow: visible;
}

.wdpopn-editor-mode .wdpopn-sections-content {
    flex: 1 1 auto;
}

/* Editor child containers — show all, keep flex, add min-height */
.e-con.wdpopn-section-editor-visible {
    display: flex !important;
    min-height: 100vh !important;
    min-height: 100dvh !important;
    border: 1px dashed #ccc;
    margin-bottom: 10px;
    position: relative;
}

.wdpopn-editor-mode .wdpopn-navigation-container {
    opacity: 1 !important;
    pointer-events: auto !important;
}

.wdpopn-editor-mode .wdpopn-nav-hidden {
    opacity: 1 !important;
    transform: none !important;
    pointer-events: auto !important;
}

.wdpopn-editor-mode .wdpopn-pos-left.wdpopn-nav-hidden,
.wdpopn-editor-mode .wdpopn-pos-right.wdpopn-nav-hidden {
    opacity: 1 !important;
    pointer-events: auto !important;
}

/* ==========================================
   Editor — Suppress Canvas Scrollbars
   ========================================== */

body.elementor-editor-active:has(.elementor-widget-wdpopn-navigation) {
    overflow: hidden !important;
    scrollbar-width: none !important;
    -ms-overflow-style: none !important;
}

body.elementor-editor-active:has(.elementor-widget-wdpopn-navigation)::-webkit-scrollbar {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
}

body.elementor-editor-active .wdpopn-editor-mode.wdpopn-wrapper {
    overflow-x: hidden !important;
}

body.elementor-editor-active .wdpopn-section,
body.elementor-editor-active .e-con.wdpopn-section-editor-visible {
    overflow: hidden !important;
}

/* ==========================================
   Internal Scroll Container (.opn-scroll)
   ========================================== */

.opn-scroll {
    display: flex !important;
    flex-direction: column !important;
    flex: 1 1 0% !important;
    min-height: 0 !important;
    height: 100% !important;
    max-height: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: contain;
    scrollbar-width: none;
    scrollbar-color: rgba(0, 0, 0, 0.3) rgba(0, 0, 0, 0.05);
}

body.elementor-editor-active .opn-scroll {
    flex-direction: unset !important;
    flex: unset !important;
    min-height: unset !important;
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
    overscroll-behavior: auto !important;
}

body.elementor-editor-active .opn-scroll > .e-con {
    width: auto !important;
    max-width: unset !important;
    height: auto !important;
    flex-shrink: unset !important;
}

body.elementor-editor-active .e-con.opn-scroll > .e-con-inner,
body.elementor-editor-active .e-flex.opn-scroll > .e-con-inner,
body.elementor-editor-active .opn-scroll > .e-con-inner {
    height: auto !important;
    min-height: unset !important;
    max-height: unset !important;
    flex-shrink: unset !important;
}

.e-con.wdpopn-section-active .e-con:has(.opn-scroll) {
    flex: 1 1 0% !important;
    min-height: 0 !important;
    height: 100% !important;
    max-height: 100% !important;
}

.e-con.wdpopn-section-active .e-con-inner:has(.opn-scroll) {
    flex: 1 1 0% !important;
    min-height: 0 !important;
    height: auto !important;
    max-height: none !important;
    display: flex !important;
    flex-direction: column !important;
}

.opn-scroll > .e-con {
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    box-sizing: border-box;
    flex-shrink: 0 !important;
}

/* ==========================================
   Widget Fix: Video & Maps dalam opn-scroll
   ========================================== */

.opn-scroll .elementor-widget-video,
.opn-scroll .elementor-widget-video .elementor-widget-container,
.opn-scroll .elementor-widget-video .elementor-video-container,
.opn-scroll .elementor-widget-video .elementor-wrapper,
.opn-scroll .elementor-widget-video .e-hosted-video {
    width: 100% !important;
    max-width: 100%;
}

.opn-scroll .elementor-widget-video iframe,
.opn-scroll .elementor-widget-video video {
    width: 100% !important;
    display: block;
}

.opn-scroll .elementor-widget-google_maps,
.opn-scroll .elementor-widget-google_maps .elementor-widget-container,
.opn-scroll .elementor-widget-google_maps .elementor-custom-embed {
    width: 100% !important;
    display: block;
}

.opn-scroll .elementor-widget-google_maps iframe {
    width: 100% !important;
    min-height: 200px;
    display: block;
}

.opn-scroll::-webkit-scrollbar {
    display: none !important;
    width: 0 !important;
}



/* ==========================================
   Responsive
   ========================================== */

@media (max-width: 767px) {
    .wdpopn-navigation-container {
        padding: 4px 6px;
    }

    .wdpopn-nav-button {
        min-width: 40px;
        padding: 6px 3px;
    }

    .wdpopn-nav-icon {
        font-size: 16px;
    }

    .wdpopn-nav-label {
        font-size: 8px;
    }
}

/* ==========================================
   Aksesibilitas — Reduced Motion
   Untuk pengguna yang mengaktifkan
   "Reduce Motion" di pengaturan OS mereka.
   ========================================== */

@media (prefers-reduced-motion: reduce) {
    .wdpopn-section-entering,
    .wdpopn-section-leaving {
        animation: none !important;
        transition: none !important;
        opacity: 1 !important;
        transform: none !important;
    }

    .wdpopn-nav-button {
        transition: none !important;
    }

    .wdpopn-nav-button.active {
        transform: none !important;
    }
}

/* ==========================================
   Flip Animation — 3D Transform Fix
   Mencegah inkonsistensi render di Safari
   dan browser lama untuk animasi flip.
   ========================================== */

.wdpopn-section.wdpopn-anim-flip-x,
.wdpopn-section.wdpopn-anim-flip-y {
    transform-style: preserve-3d;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

/* ==========================================
   Background Video Overlay Fix
   Hide native browser controls and extension overlays
   ========================================== */

.wdpopn-section .elementor-background-video-container,
.wdpopn-section .elementor-background-video-container video,
.wdpopn-section .elementor-background-video-container iframe {
    pointer-events: none !important;
}

.wdpopn-section .elementor-background-video-container video::-webkit-media-controls,
.wdpopn-section .elementor-background-video-container video::-webkit-media-controls-enclosure,
.wdpopn-section .elementor-background-video-container video::-webkit-media-controls-panel,
.wdpopn-section .elementor-background-video-container video::-webkit-media-controls-play-button {
    display: none !important;
    -webkit-appearance: none !important;
}