/**
 * Unified Slider Styles
 * Combines Room Slider, Tour Highlights, and Tour Gallery functionality
 * 
 * @package DPX_Tours
 * @since 1.1.0
 */

/* Unified Slider Container */
.unify-unified-slider {
    position: relative;
    width: 100%;
    overflow: hidden;
    margin: 20px 0 40px 0; /* Add 20px top margin and 40px bottom margin */
}

/* Hide navigation when nav is disabled */
.unify-unified-slider .owl-nav.disabled {
    display: none !important;
}

/* Hide dots when dots are disabled */
.unify-unified-slider .owl-dots.disabled {
    display: none !important;
}

.unify-unified-slider-empty {
    text-align: center;
    padding: 40px 20px;
    color: #666;
    font-style: italic;
}

/* Owl Carousel Overrides */
.unify-unified-slider .owl-carousel {
    position: relative;
}

.unify-unified-slider .owl-stage-outer {
    overflow: hidden;
    position: relative;
    width: 100%;
}

.unify-unified-slider .owl-stage {
    position: relative;
    -ms-touch-action: pan-Y;
    touch-action: manipulation;
    -moz-backface-visibility: hidden;
    backface-visibility: hidden;
    display: flex;
    align-items: stretch;
    margin-bottom: 20px;
}

.unify-unified-slider .owl-item {
    position: relative;
    min-height: 1px;
    float: left;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    display: flex;
    align-items: stretch;
}

.unify-unified-slider .owl-item img {
    display: block;
    width: 100%;
    height: 100%; /* Fill container height */
    object-fit: cover; /* Ensure images cover the container */
    object-position: center; /* Center the image within the container */
}

/* Navigation Styles */
.unify-unified-slider .owl-nav {
    position: absolute;
    top: 50%;
    width: 100%;
    transform: translateY(-50%);
    z-index: 10;
    display: flex !important;
    justify-content: space-between;
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: none; /* Allow clicks to pass through nav container */
}

.unify-unified-slider .owl-nav button {
    position: relative;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex !important;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: #333;
    cursor: pointer;
    /* Transition controlled via Elementor */
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    z-index: 10;
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto; /* Enable clicks on buttons */
}

/* Ensure arrows are always visible */
.unify-unified-slider .owl-nav button:not(.disabled) {
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
}

.unify-unified-slider .owl-nav .owl-prev {
    margin-left: 15px;
}

.unify-unified-slider .owl-nav .owl-next {
    margin-right: 15px;
}

/* Simple Text Arrow Icons */
.unify-unified-slider .owl-nav button {
    font-family: Arial, sans-serif;
    font-size: 18px;
    font-weight: bold;
    position: relative;
}



/* Arrow states for first/last slides */
.unify-unified-slider .owl-nav .owl-prev.disabled,
.unify-unified-slider .owl-nav .owl-prev.owl-disabled {
    opacity: 0.3 !important;
    cursor: not-allowed !important;
    pointer-events: none !important;
}

.unify-unified-slider .owl-nav .owl-next.disabled,
.unify-unified-slider .owl-nav .owl-next.owl-disabled {
    opacity: 0.3 !important;
    cursor: not-allowed !important;
    pointer-events: none !important;
}

/* Hide arrows completely on first/last slides */
.unify-unified-slider .owl-nav .owl-prev.hidden {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

.unify-unified-slider .owl-nav .owl-next.hidden {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

/* Simple text arrows - no fallbacks needed */

/* Dots Navigation */
.unify-unified-slider .owl-dots {
    text-align: center;
    margin-top: 0px;
    margin-bottom: 0px;
}

.unify-unified-slider .owl-dots .owl-dot {
    display: inline-block;
    margin: 0 5px;
}

.unify-unified-slider .owl-dots .owl-dot span {
    display: block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: #ddd;
    /* Transition controlled via Elementor */
}

.unify-unified-slider .owl-dots .owl-dot.active span,
.unify-unified-slider .owl-dots .owl-dot:hover span {
    background-color: #007cba;
    transform: scale(1.2);
}

/* Slider Item Base Styles */
.unify-unified-slider-item {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    /* Transition controlled via Elementor */
    height: 100%;
    display: flex;
    flex-direction: column;
    width: 100%;
    min-height: 350px; /* Set minimum height for consistency */
}

/* Hover effects disabled by default - controlled via Elementor */

/* Room Item Styles */
.unify-room-item {
    display: flex;
    flex-direction: column;
    height: 100%;
    position: relative;
    transition: all 0.3s ease;
}

/* Make room item fully clickable when modal is enabled */
.unify-room-item[style*="cursor: pointer"] {
    cursor: pointer !important;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}


.unify-room-item[style*="cursor: pointer"]:focus {
    outline: 2px solid #007cba;
    outline-offset: 2px;
}

.unify-room-item[style*="cursor: pointer"]:active {
    transform: translateY(0);
}

.unify-room-image {
    position: relative;
    overflow: hidden;
    height: 200px;
}

.unify-room-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* Transform transition controlled via Elementor */
}

/* Image hover effects disabled by default - controlled via Elementor */

.unify-room-content {
    padding: 20px 0px;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.unify-room-title {
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 10px 0;
    color: #111111;
    line-height: 1.3;
}

.unify-room-meta {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.unify-room-capacity,
.unify-room-type {
    font-size: 14px;
    color: #111111;
    font-weight: 500;
}

.unify-room-description {
    font-size: 14px;
    color: #666;
    line-height: 1.5;
    margin: 0 0 15px 0;
    flex: 1;
}

.unify-room-amenities {
    margin-bottom: 15px;
    font-size: 13px;
}

.unify-room-amenities strong {
    color: #333;
    margin-right: 5px;
}

.unify-room-amenities span {
    color: #666;
}

.unify-room-price-container {
    margin-top: auto;
    padding-top: 15px;
}

.unify-room-price {
    font-size: 18px;
    font-weight: 600;
    color: #007cba;
}

.unify-room-price-included {
    font-size: 16px;
    font-weight: 600;
    color: #111111;
}

.unify-room-upgrade {
    font-size: 16px;
    color: #111111;
    display: block;
    margin-top: 2px;
}

/* Highlight Item Styles */
.unify-highlight-item {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.unify-highlight-image {
    position: relative;
    overflow: hidden;
    height: 200px;
}

.unify-highlight-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* Transform transition controlled via Elementor */
}

/* Highlight image hover effects disabled by default - controlled via Elementor */

.unify-highlight-content {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.unify-highlight-title {
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 15px 0;
    color: #111111;
    line-height: 1.3;
}

.unify-highlight-description {
    font-size: 14px;
    color: #666;
    line-height: 1.5;
    margin: 0;
    flex: 1;
}

/* Gallery Item Styles */
.unify-gallery-item {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.unify-gallery-image {
    position: relative;
    overflow: hidden;
    height: 250px;
}

.unify-gallery-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* Transform transition controlled via Elementor */
}

/* Gallery image hover effects disabled by default - controlled via Elementor */

.unify-gallery-caption {
    padding: 15px 20px;
    background: #f8f9fa;
    border-top: 1px solid #eee;
}

.unify-gallery-caption p {
    font-size: 14px;
    color: #666;
    line-height: 1.4;
    margin: 0;
}

/* Responsive Design */
@media (max-width: 768px) {
    .unify-unified-slider {
        margin: 15px 0 30px 0; /* Reduced margins on tablet */
    }
    
    .unify-unified-slider .owl-nav button {
        width: 35px;
        height: 35px;
        font-size: 16px;
        opacity: 1 !important;
        visibility: visible !important;
    }
    
    .unify-unified-slider .owl-nav .owl-prev {
        margin-left: 10px;
    }
    
    .unify-unified-slider .owl-nav .owl-next {
        margin-right: 10px;
    }
    
    /* Ensure arrows are visible on mobile */
 
    
    .unify-unified-slider .owl-nav button {
        display: flex !important;
    }
    
    .unify-room-content,
    .unify-highlight-content {
        padding: 15px 0px;
    }
    
    .unify-room-title,
    .unify-highlight-title {
        font-size: 16px;
    }
    
    .unify-room-image,
    .unify-highlight-image,
    .unify-gallery-image {
        height: 180px;
    }
}

@media (max-width: 480px) {
    .unify-unified-slider {
        margin: 10px 0 25px 0; /* Reduced margins on mobile */
    }
    
    .unify-unified-slider .owl-nav {
        display: none;
    }
    
    .unify-room-meta {
        flex-direction: column;
        gap: 8px;
    }
    
    .unify-room-content,
    .unify-highlight-content {
        padding: 12px 0px;
    }
    
    .unify-room-image,
    .unify-highlight-image,
    .unify-gallery-image {
        height: 160px;
    }
}

/* Animation Classes */
.unify-unified-slider-item.fade-in {
    animation: dpxFadeIn 0.5s ease-in-out;
}

@keyframes dpxFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Loading State */
.unify-unified-slider.loading {
    position: relative;
}

.unify-unified-slider.loading:before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.unify-unified-slider.loading:after {
    content: 'Loading...';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1001;
    color: #666;
    font-size: 14px;
}

/* Accessibility Improvements */
.unify-unified-slider .owl-nav button:focus {
    outline: 2px solid #007cba;
    outline-offset: 2px;
}

.unify-unified-slider .owl-dots .owl-dot:focus {
    outline: 2px solid #007cba;
    outline-offset: 2px;
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .unify-unified-slider-item {
        border: 2px solid #000;
    }
    
    .unify-room-capacity,
    .unify-room-type {
        color: #111111;
    }
    
    .unify-room-price {
        color: #111111;
        font-weight: 700;
    }
}

/* Room Modal Styles */
.unify-room-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: none;
}

.unify-room-modal.show {
    display: flex !important;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
}

.unify-room-modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    cursor: pointer;
}

.unify-room-modal-dialog {
    position: relative;
    max-width: 800px;
    width: 90%;
    margin: 10% auto;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    height: auto !important; /* Fixed height to 70% of viewport */
    max-height: 70vh !important; /* Ensure max height is also 70vh */
    border: 2px solid #e0e0e0; /* Added border */
    display: flex;
    flex-direction: column;
    overflow: hidden; /* Prevent dialog from scrolling */
}

.unify-room-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 20px 0px 20px;
    border-bottom: 1px solid #ddd;
    flex-shrink: 0; /* Prevent header from shrinking */
}

.unify-room-modal-close {
    background: #ffffff!important;
    border: none;
    font-size: 32px!important;
    cursor: pointer;
    color: #111111;
    padding: 0!important;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.unify-room-modal-close:hover {
    color: #111111;
}

.unify-room-modal-title {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    color: #111111;
}

.unify-room-modal-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 20px;
    flex: 1; /* Take remaining space */
    overflow-y: auto; /* Add scrolling for overflow content */
    border-radius: 0 0 10px 10px; /* Rounded bottom corners */
}

.unify-room-modal-image-wrap {
    position: relative;
    border-radius: 8px; /* Added border radius for image container */
    border: 1px solid #ddd; /* Added border for image container */
    width: 100%;
    height: 200px; /* Fixed height for modal carousel */
    background: #f8f9fa; /* Light background for better visibility */
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Modal Owl Carousel Styles */
.unify-modal-carousel {
    width: 100%;
    height: 200px;
    position: relative;
}

.unify-modal-carousel .owl-stage-outer {
    height: 100%;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
}

.unify-modal-carousel .owl-stage {
    height: 100%;
    display: flex;
    align-items: center;
}

.unify-modal-carousel .owl-item {
    height: 200px;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.unify-modal-carousel .owl-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
    display: block;
}

/* Modal Carousel Navigation */
.unify-modal-carousel .owl-nav {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    transform: translateY(-50%);
    width: 100%;
    height: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    pointer-events: none;
    z-index: 10;
}

.unify-modal-carousel .owl-nav button {
    background: rgba(255, 255, 255, 0.95) !important;
    border: 2px solid rgba(255, 255, 255, 0.8) !important;
    width: 45px !important;
    height: 45px !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 20px !important;
    color: #333 !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2) !important;
    transition: all 0.3s ease !important;
    pointer-events: auto !important;
    margin: 0 !important;
    line-height: 1 !important;
    vertical-align: middle !important;
}

.unify-modal-carousel .owl-nav button:hover {
    background: rgba(255, 255, 255, 1) !important;
    transform: scale(1.1) !important;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3) !important;
    border-color: rgba(0, 123, 255, 0.3) !important;
}

/* Handle disabled state properly */
.unify-modal-carousel .owl-nav button.disabled,
.unify-modal-carousel .owl-nav button.owl-disabled {
    opacity: 0.3 !important;
    cursor: not-allowed !important;
    pointer-events: none !important;
}

.unify-modal-carousel .owl-nav button.disabled:hover,
.unify-modal-carousel .owl-nav button.owl-disabled:hover {
    background: rgba(255, 255, 255, 0.95) !important;
    transform: none !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2) !important;
    border-color: rgba(255, 255, 255, 0.8) !important;
}

/* Style the span elements inside buttons */
.unify-modal-carousel .owl-nav button span {
    display: block !important;
    line-height: 1 !important;
    vertical-align: middle !important;
    text-align: center !important;
}

/* Hide navigation buttons when needed */
.unify-modal-carousel .owl-nav .owl-prev.hidden,
.unify-modal-carousel .owl-nav .owl-next.hidden {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
}

/* Hide entire navigation container when needed */
.unify-modal-carousel .owl-nav.hidden {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
}

.unify-modal-carousel .owl-nav .owl-prev {
    margin-left: 10px !important;
    position: relative !important;
    top: 0 !important;
    transform: none !important;
}

.unify-modal-carousel .owl-nav .owl-next {
    margin-right: 10px !important;
    position: relative !important;
    top: 0 !important;
    transform: none !important;
}

/* Hide dots completely for modal carousel */
.unify-modal-carousel .owl-dots {
    display: none !important;
}

/* Ensure single item display */
.unify-modal-carousel .owl-stage {
    display: flex;
    align-items: center;
}

.unify-modal-carousel .owl-item {
    width: 100% !important;
}

/* Force Owl Carousel to show content */
.unify-modal-carousel {
    opacity: 1 !important;
    visibility: visible !important;
}

.unify-modal-carousel .owl-stage-outer {
    opacity: 1 !important;
    visibility: visible !important;
}

/* Ensure images are visible */
.unify-modal-carousel .owl-item img {
    opacity: 1 !important;
    visibility: visible !important;
    max-width: 100% !important;
    max-height: 100% !important;
}

/* Old modal image styles removed - now using Owl Carousel */

/* Old modal arrow styles removed - now using Owl Carousel navigation */

.unify-room-modal-content {
    flex: 1;
    color: #111111;
    padding: 10px 0; /* Add some padding for content */
}

.unify-room-modal-description {
    margin-bottom: 15px;
    line-height: 1.6;
    color: #111111;
}

.unify-room-amenities-list {
    margin-top: 10px;
}

.unify-room-amenities-list ul {
    margin: 0;
    padding-left: 20px;
    list-style-type: disc;
    color: #111111;
}

.unify-room-amenities-list li {
    margin-bottom: 4px;
    color: #111111;
}

/* Modal responsive */
@media (max-width: 768px) {
    .unify-room-modal-dialog {
        margin: 20px;
        height: 80vh !important; /* Slightly larger on mobile */
        max-height: 80vh !important; /* Ensure max height is also 80vh on mobile */
        max-width: calc(100% - 40px);
        width: calc(100% - 40px);
    }
    
    .unify-room-modal.show {
        padding: 10px;
    }
    
    .unify-room-modal-container {
        flex-direction: column;
    }
    
    /* Old modal image and arrow styles removed - now using Owl Carousel */
}

/* Dark background styles */
.unify-room-modal-dialog.dark-bg {
    background: #111111;
}

.unify-room-modal-dialog.dark-bg .unify-room-modal-title,
.unify-room-modal-dialog.dark-bg .unify-room-modal-content,
.unify-room-modal-dialog.dark-bg .unify-room-modal-description,
.unify-room-modal-dialog.dark-bg .unify-room-amenities-list ul,
.unify-room-modal-dialog.dark-bg .unify-room-amenities-list li {
    color: #ffffff;
}

.unify-room-modal-dialog.dark-bg .unify-room-modal-close {
    color: #ffffff;
}

.unify-room-modal-dialog.dark-bg .unify-room-modal-close:hover {
    color: #cccccc;
}

/* Body scroll lock when modal is open */
body.unify-room-modal-open {
    overflow: hidden;
}

/* Equal Heights for Cards */
.unify-unified-slider.equal-heights .owl-stage {
    display: flex;
    align-items: stretch;
    margin-bottom: 20px;
}

.unify-unified-slider.equal-heights .owl-item {
    display: flex;
    align-items: stretch;
    float: none;
}

.unify-unified-slider.equal-heights .unify-unified-slider-item {
    height: 100%;
    display: flex;
    flex-direction: column;
}

/* Ensure all cards have the same height by setting a fixed height */
.unify-unified-slider.equal-heights .owl-item {
    height: auto;
    min-height: 400px;
}

/* Force equal heights using CSS Grid fallback */
@supports (display: grid) {
    .unify-unified-slider.equal-heights .owl-stage {
        display: grid;
        grid-auto-columns: 1fr;
        grid-auto-rows: 1fr;
    }
    
    .unify-unified-slider.equal-heights .owl-item {
        display: contents;
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    .unify-unified-slider-item,
    .unify-room-image img,
    .unify-highlight-image img,
    .unify-gallery-image img {
        transition: none;
    }
    
    .unify-unified-slider-item:hover {
        transform: none;
    }
    
    .unify-room-item:hover .unify-room-image img,
    .unify-highlight-item:hover .unify-highlight-image img,
    .unify-gallery-item:hover .unify-gallery-image img {
        transform: none;
    }
}
