/*--------------------------------------------------------------
# Video Popup Modal
--------------------------------------------------------------*/

/* Modal Container */
.video-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.video-modal.video-modal-open {
    opacity: 1;
    visibility: visible;
}

/* Modal Overlay */
.video-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

/* Modal Content */
.video-modal-content {
    position: relative;
    width: 100%;
    max-width: 900px;
    background: transparent;
    border-radius: 12px;
    overflow: hidden;
    transform: scale(0.9) translateY(50px);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
}

.video-modal-open .video-modal-content {
    transform: scale(1) translateY(0);
}

/* Close Button */
.video-modal-close {
    position: absolute;
    top: -50px;
    right: 0;
    background: var(--secondary-accent);
    color: var(--contrast-color);
    border: none;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 18px;
    transition: all 0.3s ease;
    z-index: 10001;
    box-shadow: 0 4px 15px rgba(220, 38, 38, 0.3);
}

.video-modal-close:hover {
    background: color-mix(in srgb, var(--secondary-accent), transparent 15%);
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(220, 38, 38, 0.4);
}

.video-modal-close:active {
    transform: scale(0.95);
}

/* Loader */
.video-modal-loader {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--contrast-color);
    z-index: 10002;
}

.video-loader-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top: 3px solid var(--secondary-accent);
    border-radius: 50%;
    animation: video-loader-spin 1s linear infinite;
    margin-bottom: 15px;
}

.video-modal-loader p {
    font-size: 14px;
    font-weight: 500;
    margin: 0;
    opacity: 0.8;
}

@keyframes video-loader-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Video Container */
.video-container {
    position: relative;
    width: 100%;
    height: 0;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    background: #000;
    border-radius: 12px;
    overflow: hidden;
    transition: opacity 0.3s ease;
}

.video-container iframe,
.video-container video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
    border-radius: 12px;
    background: #000;
}

.video-container video {
    object-fit: contain;
}

/* Enhanced Watch Video Button */
.hero .btn-watch-video {
    position: relative;
    font-size: 16px;
    font-weight: 600;
    color: var(--default-color);
    text-decoration: none;
    padding: 12px 24px;
    border-radius: 50px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.2);
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    overflow: hidden;
    cursor: pointer;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.hero .btn-watch-video::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.6s ease;
}

.hero .btn-watch-video:hover::before {
    left: 100%;
}

.hero .btn-watch-video::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: radial-gradient(circle, var(--secondary-accent) 0%, transparent 70%);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: all 0.4s ease;
    opacity: 0;
    z-index: -1;
}

.hero .btn-watch-video:hover::after {
    width: 300px;
    height: 300px;
    opacity: 0.1;
}

.hero .btn-watch-video i {
    color: var(--secondary-accent);
    font-size: 28px;
    margin-right: 10px;
    transition: all 0.4s ease;
    filter: drop-shadow(0 2px 8px rgba(220, 38, 38, 0.3));
    position: relative;
    z-index: 2;
}

.hero .btn-watch-video span {
    position: relative;
    z-index: 2;
    transition: all 0.3s ease;
}

.hero .btn-watch-video:hover {
    color: var(--secondary-accent);
    transform: translateY(-3px);
    box-shadow: 0 15px 45px rgba(220, 38, 38, 0.2);
    border-color: rgba(220, 38, 38, 0.3);
    background: rgba(255, 255, 255, 0.15);
}

.hero .btn-watch-video:hover i {
    transform: scale(1.1) rotate(5deg);
    filter: drop-shadow(0 4px 12px rgba(220, 38, 38, 0.4));
}

.hero .btn-watch-video:active {
    transform: translateY(-1px);
    box-shadow: 0 8px 25px rgba(220, 38, 38, 0.3);
}

/* Play Button Pulse Animation */
.hero .btn-watch-video i::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    background: var(--secondary-accent);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    opacity: 0;
    animation: pulse-play 3s infinite;
    z-index: -1;
}

@keyframes pulse-play {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.8);
    }
    50% {
        opacity: 0.6;
        transform: translate(-50%, -50%) scale(1.2);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(1.6);
    }
}

/* Glassmorphism effect for modern browsers */
@supports (backdrop-filter: blur(10px)) {
    .hero .btn-watch-video {
        background: rgba(255, 255, 255, 0.08);
        border: 1px solid rgba(255, 255, 255, 0.18);
    }
}

/* Focus states for accessibility */
.hero .btn-watch-video:focus {
    outline: 2px solid var(--secondary-accent);
    outline-offset: 2px;
}

.hero .btn-watch-video:focus:not(:focus-visible) {
    outline: none;
}

/* Responsive Design */
@media (max-width: 768px) {
    .video-modal-overlay {
        padding: 15px;
    }
    
    .video-modal-content {
        max-width: 100%;
    }
    
    .video-modal-close {
        top: -45px;
        width: 40px;
        height: 40px;
        font-size: 16px;
    }
    
    .video-container {
        border-radius: 8px;
    }
    
    .video-container iframe,
    .video-container video {
        border-radius: 8px;
    }
    
    .hero .btn-watch-video {
        font-size: 15px;
        padding: 10px 20px;
    }
    
    .hero .btn-watch-video i {
        font-size: 24px;
        margin-right: 8px;
    }
    
    .hero .btn-watch-video:hover {
        transform: translateY(-2px);
    }
}

@media (max-width: 480px) {
    .video-modal-overlay {
        padding: 10px;
    }
    
    .video-modal-close {
        top: -40px;
        width: 36px;
        height: 36px;
        font-size: 14px;
    }
    
    .video-loader-spinner {
        width: 32px;
        height: 32px;
    }
    
    .video-modal-loader p {
        font-size: 13px;
    }
}

/* Accessibility */
.video-modal-close:focus {
    outline: 2px solid var(--secondary-accent);
    outline-offset: 2px;
}

.video-modal-close:focus:not(:focus-visible) {
    outline: none;
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .video-modal,
    .video-modal-content,
    .video-modal-close,
    .video-container,
    .hero .btn-watch-video,
    .hero .btn-watch-video i {
        transition: none;
    }
    
    .video-loader-spinner {
        animation: none;
    }
    
    .hero .btn-watch-video i::before {
        animation: none;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .video-modal-overlay {
        background: rgba(0, 0, 0, 0.95);
    }
}