/**
 * Pageable WPBakery Integration - Custom Styles
 */

/* General Styles */
body.pageable-wpb-enabled {
    margin: 0;
    padding: 0;
    overflow: hidden;
}

body.pageable-loaded {
    overflow: hidden;
}

/* Pageable Container */
#pageable-container {
    position: relative;
    width: 100%;
    height: 100vh;
}

/* Page Styles */
.pg-page {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: auto;
}

/* Ensure wpb_row inside pages takes full height */
.pg-page .wpb_row {
    min-height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* Fix for WPBakery columns */
.pg-page .vc_row {
    width: 100%;
}

.pg-page .vc_column-inner {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.pg-page .wpb_wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* Navigation Pips Customization */
.pg-pips {
    position: fixed;
    z-index: 9999;
    display: flex;
    transition: all 0.3s ease;
}

/* Right Position (default) */
.pg-pips-right {
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    flex-direction: column;
}

/* Left Position */
.pg-pips-left {
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    flex-direction: column;
}

/* Top Position */
.pg-pips-top {
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    flex-direction: row;
}

/* Bottom Position */
.pg-pips-bottom {
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    flex-direction: row;
}

/* Pip Items */
.pg-pips button {
    background: rgba(255, 255, 255, 0.4);
    border: 2px solid transparent;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0;
    outline: none;
}

/* Vertical orientation pips */
.pg-pips-right button,
.pg-pips-left button {
    width: 12px;
    height: 12px;
    margin: 8px 0;
}

/* Horizontal orientation pips */
.pg-pips-top button,
.pg-pips-bottom button {
    width: 12px;
    height: 12px;
    margin: 0 8px;
}

.pg-pips button:hover {
    background: rgba(255, 255, 255, 0.7);
    transform: scale(1.2);
}

.pg-pips button.active {
    background: #fff;
    border-color: #fff;
    width: 14px;
    height: 14px;
}

/* Hide pips labels by default */
.pg-pips button span {
    display: none;
}

/* Loading State */
body.pageable-wpb-enabled:not(.pageable-loaded) #pageable-container {
    opacity: 0;
    transition: opacity 0.3s ease;
}

body.pageable-loaded #pageable-container {
    opacity: 1;
}

/* Scrollbar for overflow pages */
.pg-page::-webkit-scrollbar {
    width: 8px;
}

.pg-page::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
}

.pg-page::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
}

.pg-page::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.5);
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Optional: Add animation class to elements */
.pg-page.pg-active .animate-in {
    animation: slideInUp 0.6s ease forwards;
}

/* Fix for video backgrounds */
.pg-page .vc_video-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Fix for parallax backgrounds */
.pg-page [data-parallax="true"] {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Ensure images don't break layout */
.pg-page img {
    max-width: 100%;
    height: auto;
}

/* Responsive Styles */
@media screen and (max-width: 1024px) {
    /* Adjust navigation on tablets */
    .pg-pips-right,
    .pg-pips-left {
        right: 15px;
        left: auto;
    }
    
    .pg-pips-left {
        right: auto;
        left: 15px;
    }
}

@media screen and (max-width: 768px) {
    /* Smaller pips on mobile */
    .pg-pips button {
        width: 8px !important;
        height: 8px !important;
        margin: 6px 0;
    }
    
    .pg-pips button.active {
        width: 10px !important;
        height: 10px !important;
    }
    
    /* Adjust pip position on mobile */
    .pg-pips-right {
        right: 10px;
    }
    
    .pg-pips-left {
        left: 10px;
    }
    
    .pg-pips-top {
        top: 10px;
    }
    
    .pg-pips-bottom {
        bottom: 10px;
    }
    
    /* Optional: Disable on very small screens */
    /*
    body.pageable-wpb-enabled {
        overflow: auto !important;
    }
    
    #pageable-container {
        height: auto !important;
    }
    
    .pg-page {
        height: auto !important;
    }
    
    .pg-pips {
        display: none !important;
    }
    */
}

/* Print Styles */
@media print {
    body.pageable-wpb-enabled {
        overflow: visible !important;
    }
    
    #pageable-container {
        height: auto !important;
    }
    
    .pg-page {
        height: auto !important;
        page-break-inside: avoid;
    }
    
    .pg-pips {
        display: none !important;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .pg-pips button {
        background: rgba(255, 255, 255, 0.3);
    }
    
    .pg-pips button:hover {
        background: rgba(255, 255, 255, 0.6);
    }
    
    .pg-pips button.active {
        background: #fff;
    }
}

/* Accessibility */
.pg-pips button:focus {
    outline: 2px solid #fff;
    outline-offset: 2px;
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
