/**
 * Phusa Hero Section Styles
 * Based on new design from index.html and style.css
 */

/* ===== HERO SECTION ===== */
.phusa-hero-section {
    position: relative;
    width: 100%;
    min-height: 650px;
    height: 650px;
    overflow: hidden;
    /* Giữ nguyên kích thước khi zoom trình duyệt */
    transform-origin: center top;
    will-change: transform;
    /* Improve rendering performance */
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    /* Ensure proper stacking context */
    isolation: isolate;
}

/* Hero section với dynamic height từ slide settings */
.phusa-hero-section[data-slide-height] {
    min-height: var(--slide-height, 650px);
    height: var(--slide-height, 650px);
    aspect-ratio: var(--slide-aspect, 1.78);
}

/* ===== HERO SLIDER ===== */
.phusa-hero-slider {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.phusa-hero-slider .swiper-wrapper {
    height: 100%;
}

.phusa-hero-slider .swiper-slide {
    height: 100%;
    position: relative;
}

.phusa-hero-slide-item {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.phusa-hero-image,
.phusa-hero-image-link {
    display: block;
    width: 100%;
    height: 100%;
}

.phusa-hero-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* Improve image rendering */
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
    /* Prevent image drag on mobile */
    -webkit-user-drag: none;
    user-select: none;
    pointer-events: none;
}

.phusa-hero-video {
    width: 100%;
    height: 100%;
    position: relative;
}

.phusa-hero-video-player {
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* Improve video rendering */
    -webkit-user-drag: none;
    user-select: none;
    /* Prevent video controls on mobile */
    pointer-events: none;
}

.phusa-hero-video-link-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    cursor: pointer;
}

/* Video Mute Toggle Button */
.phusa-hero-video-mute-toggle {
    position: absolute;
    top: 80px;
    right: 20px;
    width: 45px;
    height: 45px;
    background: rgba(0, 0, 0, 0.5);
    border: 2px solid rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    color: #ffffff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 11;
    transition: all 0.3s ease;
    padding: 0;
    outline: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.phusa-hero-video-mute-toggle:hover {
    background: rgba(0, 0, 0, 0.7);
    border-color: #ffffff;
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.phusa-hero-video-mute-toggle:active {
    transform: scale(0.95);
}

.phusa-hero-video-mute-toggle:focus {
    outline: 2px solid #ffffff;
    outline-offset: 2px;
}

.phusa-hero-video-mute-toggle.unmuted {
    background: rgba(255, 255, 255, 0.2);
}

.phusa-hero-video-mute-toggle.unmuted:hover {
    background: rgba(255, 255, 255, 0.3);
}

.phusa-hero-mute-icon,
.phusa-hero-unmute-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    line-height: 1;
}

.phusa-hero-video-mute-toggle.unmuted .phusa-hero-mute-icon {
    display: none;
}

.phusa-hero-video-mute-toggle.unmuted .phusa-hero-unmute-icon {
    display: flex !important;
}

.phusa-hero-video-mute-toggle:not(.unmuted) .phusa-hero-unmute-icon {
    display: none;
}

.phusa-hero-video-mute-toggle:not(.unmuted) .phusa-hero-mute-icon {
    display: flex;
}

/* Navigation Arrows */
.phusa-hero-arrow-next,
.phusa-hero-arrow-prev {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.2);
    width: 45px;
    height: 45px;
    border-radius: 50%;
    transition: all 0.3s ease;
    z-index: 10;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    /* Improve accessibility */
    outline: none;
}

.phusa-hero-arrow-next:hover,
.phusa-hero-arrow-prev:hover {
    background: rgba(255, 255, 255, 0.4);
    transform: scale(1.1);
}

.phusa-hero-arrow-next:active,
.phusa-hero-arrow-prev:active {
    transform: scale(0.95);
}

.phusa-hero-arrow-next:focus,
.phusa-hero-arrow-prev:focus {
    outline: 2px solid rgba(255, 255, 255, 0.8);
    outline-offset: 2px;
}

.phusa-hero-arrow-next::after,
.phusa-hero-arrow-prev::after {
    font-size: 18px;
    font-weight: bold;
}

/* Pagination Dots */
.phusa-hero-pagination {
    bottom: 70px !important;
    z-index: 10;
}

.phusa-hero-pagination .swiper-pagination-bullet {
    width: 12px;
    height: 12px;
    background: rgba(255, 255, 255, 0.5);
    opacity: 1;
    transition: all 0.3s ease;
    cursor: pointer;
    margin: 0 4px;
}

.phusa-hero-pagination .swiper-pagination-bullet:hover {
    background: rgba(255, 255, 255, 0.8);
    transform: scale(1.1);
}

.phusa-hero-pagination .swiper-pagination-bullet-active {
    background: #ffffff;
    transform: scale(1.2);
    opacity: 1;
}

.phusa-hero-artboard {
    position: absolute;
    width: 100%;
    top: 0;
    left: 0;
    height: 100%;
    object-fit: cover;
    z-index: 1;
}

.phusa-hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #000000;
    opacity: 0.15; /* Default opacity, có thể override bằng data attribute và JS */
    z-index: 2;
    transition: opacity 0.3s ease;
}

.phusa-hero-content {
    position: relative;
    z-index: 3;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center;
    padding: 0 20px;
    /* Improve text readability */
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    /* Ensure content is accessible */
    pointer-events: none;
}

.phusa-hero-content * {
    pointer-events: auto;
}

.phusa-hero-title {
    position: relative;
    width: 600px;
    max-width: 90%;
    height: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    text-shadow: 5px 5px 10px rgba(0, 0, 0, 0.25);
    font-weight: 700;
    color: #ffffff;
    font-size: 50px;
    text-align: center;
    letter-spacing: 0;
    line-height: 1.2;
    margin-bottom: 18px;
    margin-top: 0;
    /* Improve text rendering */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.phusa-hero-description {
    position: relative;
    width: 500px;
    max-width: 90%;
    height: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    text-shadow: 5px 5px 10px rgba(0, 0, 0, 0.25);
    font-weight: 400;
    color: #ffffff;
    font-size: 13px;
    text-align: center;
    letter-spacing: 0;
    line-height: 1.6;
    margin-bottom: 25px;
    margin-top: 0;
    /* Improve text rendering */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.phusa-hero-buttons {
    display: flex;
    gap: 25px;
    position: relative;
    width: auto;
    height: 42px;
    justify-content: center;
    align-items: center;
}

.phusa-btn {
    border: none;
    height: 42px;
    width: 130px;
    font-size: 15px;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 600;
    letter-spacing: 0;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
}

.phusa-btn-primary {
    background: #ffffff;
    color: #0D0C55;
}

.phusa-btn-secondary {
    background: transparent;
    color: #ffffff;
    border: 2px solid #ffffff;
}

.phusa-btn:hover {
    opacity: 0.9;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.phusa-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.phusa-btn:focus {
    outline: 2px solid rgba(255, 255, 255, 0.8);
    outline-offset: 2px;
}

.phusa-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.phusa-scroll-indicator {
    position: absolute;
    bottom: 60px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 3;
    animation: phusa-bounce 2s infinite;
    cursor: pointer;
    background: transparent;
    border: none;
    padding: 8px;
    /* Improve accessibility */
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.phusa-scroll-indicator:hover {
    opacity: 1;
    transform: translateX(-50%) translateY(-5px);
}

.phusa-scroll-indicator:focus {
    outline: 2px solid rgba(255, 255, 255, 0.8);
    outline-offset: 4px;
    border-radius: 4px;
}

.phusa-scroll-indicator:active {
    transform: translateX(-50%) translateY(0);
}

.phusa-scroll-indicator i {
    font-size: 30px;
    color: #fff;
    opacity: 0.8;
    display: block;
    pointer-events: none;
}

@keyframes phusa-bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateX(-50%) translateY(0);
    }
    40% {
        transform: translateX(-50%) translateY(-10px);
    }
    60% {
        transform: translateX(-50%) translateY(-5px);
    }
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 1024px) {
    .phusa-hero-section {
        min-height: 550px;
        height: 550px;
    }
    
    /* Giữ nguyên aspect ratio nếu có từ slide settings, nhưng đảm bảo min-height */
    .phusa-hero-section[data-slide-height] {
        min-height: max(550px, calc(var(--slide-height, 650px) * 0.85));
        height: auto;
    }
    
    .phusa-hero-artboard {
        height: 100%;
    }
    
    .phusa-hero-arrow-next,
    .phusa-hero-arrow-prev {
        width: 40px;
        height: 40px;
    }
    
    .phusa-hero-arrow-next::after,
    .phusa-hero-arrow-prev::after {
        font-size: 16px;
    }
    
    .phusa-hero-title {
        font-size: 42px;
        width: 90%;
    }
    
    .phusa-hero-description {
        font-size: 13px;
        width: 80%;
    }
}

@media (max-width: 768px) {
    .phusa-hero-section {
        min-height: 500px;
        height: 500px;
    }
    
    /* Giữ nguyên aspect ratio nếu có từ slide settings, nhưng đảm bảo min-height */
    .phusa-hero-section[data-slide-height] {
        min-height: max(500px, calc(var(--slide-height, 650px) * 0.77));
        height: auto;
    }
    
    .phusa-hero-artboard {
        height: 100%;
    }
    
    .phusa-hero-arrow-next,
    .phusa-hero-arrow-prev {
        width: 35px;
        height: 35px;
    }
    
    .phusa-hero-arrow-next::after,
    .phusa-hero-arrow-prev::after {
        font-size: 14px;
    }
    
    .phusa-hero-pagination {
        bottom: 60px !important;
    }
    
    .phusa-hero-title {
        font-size: 36px;
        width: 95%;
    }
    
    .phusa-hero-description {
        font-size: 13px;
        width: 90%;
    }
    
    .phusa-hero-buttons {
        flex-direction: column;
        width: 200px;
        height: auto;
        gap: 10px;
    }
    
    .phusa-btn {
        width: 100%;
    }
    
    .phusa-hero-video-mute-toggle {
        width: 45px;
        height: 45px;
        top: 75px;
        right: 15px;
    }
    
    .phusa-hero-mute-icon,
    .phusa-hero-unmute-icon {
        font-size: 18px;
    }
}

@media (max-width: 480px) {
    .phusa-hero-section {
        min-height: 400px;
        height: 400px;
    }
    
    /* Giữ nguyên aspect ratio nếu có từ slide settings, nhưng đảm bảo min-height */
    .phusa-hero-section[data-slide-height] {
        min-height: max(400px, calc(var(--slide-height, 650px) * 0.62));
        height: auto;
    }
    
    .phusa-hero-artboard {
        height: 100%;
    }
    
    .phusa-hero-arrow-next,
    .phusa-hero-arrow-prev {
        width: 30px;
        height: 30px;
        display: none; /* Hide arrows on very small screens */
    }
    
    .phusa-hero-pagination {
        bottom: 50px !important;
    }
    
    .phusa-hero-pagination .swiper-pagination-bullet {
        width: 8px;
        height: 8px;
        margin: 0 3px;
    }
    
    .phusa-hero-title {
        font-size: 28px;
        line-height: 1.2;
    }
    
    .phusa-hero-description {
        font-size: 12px;
        line-height: 1.4;
    }
    
    .phusa-hero-video-mute-toggle {
        width: 40px;
        height: 40px;
        top: 50px;
        right: 10px;
    }
    
    .phusa-hero-mute-icon,
    .phusa-hero-unmute-icon {
        font-size: 16px;
    }
    
    .phusa-scroll-indicator {
        bottom: 50px;
    }
    
    .phusa-scroll-indicator i {
        font-size: 28px;
    }
}

/* ===== ACCESSIBILITY IMPROVEMENTS ===== */
@media (prefers-reduced-motion: reduce) {
    .phusa-hero-section,
    .phusa-hero-slider,
    .phusa-scroll-indicator,
    .phusa-btn,
    .phusa-hero-arrow-next,
    .phusa-hero-arrow-prev,
    .phusa-hero-pagination .swiper-pagination-bullet {
        animation: none !important;
        transition: none !important;
    }
    
    .phusa-scroll-indicator {
        animation: none;
    }
}

/* ===== PRINT STYLES ===== */
@media print {
    .phusa-hero-section {
        min-height: auto;
        height: auto;
        page-break-inside: avoid;
    }
    
    .phusa-hero-slider,
    .phusa-hero-arrow-next,
    .phusa-hero-arrow-prev,
    .phusa-hero-pagination,
    .phusa-hero-video-mute-toggle,
    .phusa-scroll-indicator {
        display: none !important;
    }
    
    .phusa-hero-content {
        position: relative;
        z-index: auto;
    }
    
    .phusa-hero-overlay {
        display: none;
    }
}

/* ===== HIGH CONTRAST MODE ===== */
@media (prefers-contrast: high) {
    .phusa-hero-overlay {
        opacity: 0.3 !important;
    }
    
    .phusa-btn {
        border-width: 3px;
    }
    
    .phusa-hero-arrow-next,
    .phusa-hero-arrow-prev {
        border: 2px solid #ffffff;
    }
}
