/**
 * Frontend Styles for Sticky Video Widget
 * These styles control how the video appears on the website
 */

/* ============================================
   MAIN WIDGET CONTAINER
   ============================================ */

.svw-widget {
    /* Position fixed to stay in place while scrolling */
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999; /* Very high to appear above most content */
    width: 300px; /* Slightly wider to fit text better */
    max-width: calc(100vw - 40px); /* Don't overflow on small screens */
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    overflow: visible; /* Changed from hidden to allow CTA to show */
    background: #000;
    /* Smooth transition for hiding/showing */
    transition: transform 0.3s ease, opacity 0.3s ease, visibility 0.3s;
}

/* Hidden state - starts hidden, JavaScript removes this class after delay */
.svw-widget.svw-hidden {
    transform: translateY(120%); /* Slide down off screen */
    opacity: 0;
    visibility: hidden; /* Prevents any interaction or rendering */
    pointer-events: none; /* Can't click on it when hidden */
}

/* Inner wrapper */
.svw-widget-inner {
    position: relative;
}

/* ============================================
   CLOSE BUTTON
   ============================================ */

.svw-close {
    /* Position in top-right corner */
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 10; /* Above video */
    
    /* Styling - smaller size */
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    border: none;
    width: 24px; /* Reduced from 30px */
    height: 24px; /* Reduced from 30px */
    border-radius: 50%; /* Make it circular */
    font-size: 16px; /* Reduced from 20px */
    line-height: 1;
    cursor: pointer;
    
    /* Center the X */
    display: flex;
    align-items: center;
    justify-content: center;
    
    /* Hover effect */
    transition: background 0.2s;
}

.svw-close:hover {
    background: rgba(0, 0, 0, 0.9);
}

/* ============================================
   VIDEO CONTAINER
   ============================================ */

.svw-video-container {
    position: relative;
    /* 9:16 aspect ratio for vertical/shorts videos */
    padding-bottom: 177.78%; /* 16/9 * 100 = 177.78% */
    height: 0;
    overflow: hidden; /* Keep this hidden for the video iframe itself */
    background: #000;
    border-radius: 8px; /* Match parent border radius */
}

/* Make iframe fill container */
.svw-video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 8px; /* Match border radius */
}

/* ============================================
   CTA BUTTON (Positioned Over Video)
   ============================================ */

/* Floating animation - subtle bounce */
@keyframes svw-float {
    0%, 100% {
        transform: translateX(-50%) translateY(0);
    }
    50% {
        transform: translateX(-50%) translateY(-5px);
    }
}

/* CTA Button positioned 50px from bottom of video */
.svw-cta-button {
    /* Position 50px from bottom, centered horizontally */
    position: absolute;
    bottom: 50px; /* 50px from bottom to keep YouTube controls accessible */
    left: 50%;
    transform: translateX(-50%);
    z-index: 10; /* Above video */
    
    /* Button styling */
    display: inline-block;
    width: 90%; /* 90% width as requested */
    text-align: center;
    padding: 10px 24px;
    white-space: nowrap; /* Keep text on one line */
    
    /* Custom colors */
    background: #99CCCC; /* Teal background */
    color: #000; /* Black text */
    font-weight: 700; /* Bold */
    font-size: 17px;
    
    text-decoration: none;
    border-radius: 4px;
    
    /* Floating animation - subtle and slow */
    animation: svw-float 3s ease-in-out infinite;
    
    /* Add a subtle shadow for depth */
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    
    /* Ensure button is clickable */
    pointer-events: auto;
}

.svw-cta-button:hover {
    /* Keep same colors on hover, just pause animation */
    background: #99CCCC;
    color: #000;
    text-decoration: none;
    
    /* Pause floating animation on hover */
    animation-play-state: paused;
    
    /* Slight lift on hover */
    transform: translateX(-50%) translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

/* Tablet and smaller */
@media (max-width: 768px) {
    .svw-widget {
        width: 270px;
        bottom: 15px;
        right: 15px;
    }
    
    .svw-cta-button {
        /* Keep position: absolute, bottom, left, transform from main styles */
        font-size: 16px; /* Slightly smaller on tablet */
        padding: 9px 20px;
        bottom: 45px; /* Slightly higher on tablet for better visibility */
        /* left: 50% and transform: translateX(-50%) inherited */
    }
}

/* Mobile phones - Custom breakpoint at 679px as requested */
@media (max-width: 679px) {
    .svw-widget {
        width: 260px;
        bottom: 10px;
        right: 10px;
    }
    
    .svw-cta-button {
        /* IMPORTANT: Keep all positioning properties */
        position: absolute; /* Ensure absolute positioning */
        left: 50%; /* Center horizontally */
        
        /* Mobile specific styles as requested */
        font-size: 15px;
        font-weight: 700;
        bottom: 50px; /* 50px from bottom on mobile */
        
        /* Keep width and other properties */
        width: 90%;
        text-align: center;
        padding: 8px 18px;
        
        /* Floating animation continues on mobile */
        animation: svw-float 3s ease-in-out infinite;
    }
    
    .svw-cta-button:hover {
        /* Keep centered on hover for mobile */
        animation-play-state: paused;
        transform: translateX(-50%) translateY(-2px);
    }
}

/* Very small phones */
@media (max-width: 480px) {
    .svw-widget {
        width: 250px;
    }
}
