/* WooBenner Frontend Styles */

/* Base Banner Styles */
.woobenner-banner {
    position: relative;
    display: block;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 10px 0;
    box-sizing: border-box;
}

.woobenner-banner * {
    box-sizing: border-box;
}

/* Shadow Effect */
.woobenner-shadow {
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.woobenner-shadow:hover {
    box-shadow: 0 12px 35px rgba(0,0,0,0.2);
}

/* Position Types */
.woobenner-position-fixed {
    position: fixed;
    z-index: 9999;
}

.woobenner-position-sticky {
    position: -webkit-sticky;
    position: sticky;
    top: 0;
    z-index: 999;
}

/* Banner Content */
.woobenner-content {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 15px;
}

.woobenner-image {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
}

.woobenner-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Video Styles */
.woobenner-video {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
    overflow: hidden;
}

.woobenner-video-iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}

.woobenner-video-player {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Video overlay for better text readability */
.woobenner-banner:has(.woobenner-video) .woobenner-text {
    background: rgba(0,0,0,0.7);
    color: white;
    backdrop-filter: blur(3px);
}

/* Video controls styling */
.woobenner-video-player::-webkit-media-controls-panel {
    background-color: rgba(0,0,0,0.8);
}

.woobenner-video-player::-webkit-media-controls-play-button,
.woobenner-video-player::-webkit-media-controls-volume-slider,
.woobenner-video-player::-webkit-media-controls-timeline {
    filter: invert(1);
}

.woobenner-text {
    position: relative;
    z-index: 2;
    background: rgba(255,255,255,0.9);
    padding: 15px;
    border-radius: 8px;
    margin: 10px;
    backdrop-filter: blur(5px);
}

.woobenner-title {
    margin: 0 0 10px 0;
    font-size: 18px;
    font-weight: bold;
    line-height: 1.3;
}

.woobenner-description {
    margin: 0;
    font-size: 14px;
    line-height: 1.4;
    opacity: 0.9;
}

/* Call to Action */
.woobenner-cta {
    position: relative;
    z-index: 3;
    margin-top: 15px;
}

.woobenner-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 10px 20px;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.woobenner-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
    color: white;
    text-decoration: none;
}

/* Close Button */
.woobenner-close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 25px;
    height: 25px;
    background: rgba(0,0,0,0.7);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    line-height: 1;
    z-index: 10;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.woobenner-banner:hover .woobenner-close {
    opacity: 1;
}

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

/* Link Styles */
.woobenner-link {
    display: block;
    width: 100%;
    height: 100%;
    text-decoration: none;
    color: inherit;
}

.woobenner-link:hover {
    text-decoration: none;
    color: inherit;
}

/* WooBenner Animation System - CSS-Only (No JavaScript Required) */
.woobenner-banner {
    /* Default visible state */
    display: block;
    visibility: visible;
    opacity: 1;
    
    /* Auto-animate on load */
    -webkit-animation: woobennerAutoFade 0.8s ease-out;
    -moz-animation: woobennerAutoFade 0.8s ease-out;
    animation: woobennerAutoFade 0.8s ease-out;
    
    /* Cross-browser animation support */
    -webkit-animation-fill-mode: forwards;
    -moz-animation-fill-mode: forwards;
    animation-fill-mode: forwards;
    
    /* Ensure proper dimensions */
    min-height: 50px;
    width: auto;
    max-width: 100%;
    
    /* Hardware acceleration */
    -webkit-transform: translateZ(0);
    -moz-transform: translateZ(0);
    transform: translateZ(0);
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

/* Animation classes for effects */
.woobenner-banner.woobenner-animate {
    animation-duration: 0.5s;
    animation-timing-function: ease-out;
}

.woobenner-banner.woobenner-show {
    opacity: 1;
    visibility: visible;
    display: block;
}

.woobenner-banner.woobenner-loaded {
    opacity: 1;
    visibility: visible;
}

/* CSS-Only Auto Animations - Work Without JavaScript */

/* Default auto-fade animation */
@keyframes woobennerAutoFade {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Effect-specific animations that trigger automatically */
.woobenner-banner[data-effect="fade"] {
    -webkit-animation: woobennerAutoFade 0.8s ease-out;
    animation: woobennerAutoFade 0.8s ease-out;
}

.woobenner-banner[data-effect="slide"] {
    -webkit-animation: woobennerAutoSlide 0.8s ease-out;
    animation: woobennerAutoSlide 0.8s ease-out;
}

.woobenner-banner[data-effect="bounce"] {
    -webkit-animation: woobennerAutoBounce 1s ease-out;
    animation: woobennerAutoBounce 1s ease-out;
}

.woobenner-banner[data-effect="zoom"] {
    -webkit-animation: woobennerAutoZoom 0.8s ease-out;
    animation: woobennerAutoZoom 0.8s ease-out;
}

.woobenner-banner[data-effect="flip"] {
    -webkit-animation: woobennerAutoFlip 1s ease-out;
    animation: woobennerAutoFlip 1s ease-out;
}

.woobenner-banner[data-effect="pulse"] {
    -webkit-animation: woobennerAutoPulse 1.5s ease-in-out;
    animation: woobennerAutoPulse 1.5s ease-in-out;
}

.woobenner-banner[data-effect="shake"] {
    -webkit-animation: woobennerAutoShake 0.8s ease-out;
    animation: woobennerAutoShake 0.8s ease-out;
}

/* Auto-animation keyframes */
@keyframes woobennerAutoSlide {
    from {
        opacity: 0;
        transform: translateX(-100px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes woobennerAutoBounce {
    0% {
        opacity: 0;
        transform: translateY(-60px);
    }
    60% {
        opacity: 1;
        transform: translateY(10px);
    }
    80% {
        transform: translateY(-5px);
    }
    100% {
        transform: translateY(0);
    }
}

@keyframes woobennerAutoZoom {
    from {
        opacity: 0;
        transform: scale(0.3);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes woobennerAutoFlip {
    from {
        opacity: 0;
        transform: rotateY(-90deg);
    }
    to {
        opacity: 1;
        transform: rotateY(0deg);
    }
}

@keyframes woobennerAutoPulse {
    0% {
        opacity: 0;
        transform: scale(0.8);
    }
    50% {
        opacity: 0.8;
        transform: scale(1.1);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes woobennerAutoShake {
    0% {
        opacity: 0;
        transform: translateX(0);
    }
    20% {
        opacity: 0.5;
        transform: translateX(-10px);
    }
    40% {
        opacity: 0.8;
        transform: translateX(10px);
    }
    60% {
        transform: translateX(-5px);
    }
    80% {
        transform: translateX(5px);
    }
    100% {
        opacity: 1;
        transform: translateX(0);
    }
}

/* FORCED ANIMATIONS - Applied via inline style */
@keyframes woobenner-force-fade {
    0% {
        opacity: 0;
        transform: scale(0.9) translateZ(0);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateZ(0);
    }
}

@keyframes woobenner-force-slide {
    0% {
        opacity: 0;
        transform: translateX(-100px) translateZ(0);
    }
    100% {
        opacity: 1;
        transform: translateX(0) translateZ(0);
    }
}

@keyframes woobenner-force-bounce {
    0% {
        opacity: 0;
        transform: translateY(-60px) translateZ(0);
    }
    60% {
        opacity: 1;
        transform: translateY(10px) translateZ(0);
    }
    80% {
        transform: translateY(-5px) translateZ(0);
    }
    100% {
        opacity: 1;
        transform: translateY(0) translateZ(0);
    }
}

@keyframes woobenner-force-zoom {
    0% {
        opacity: 0;
        transform: scale(0.3) translateZ(0);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateZ(0);
    }
}

@keyframes woobenner-force-flip {
    0% {
        opacity: 0;
        transform: rotateY(-90deg) translateZ(0);
    }
    100% {
        opacity: 1;
        transform: rotateY(0deg) translateZ(0);
    }
}

@keyframes woobenner-force-pulse {
    0% {
        opacity: 0;
        transform: scale(0.8) translateZ(0);
    }
    50% {
        opacity: 0.8;
        transform: scale(1.1) translateZ(0);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateZ(0);
    }
}

@keyframes woobenner-force-shake {
    0% {
        opacity: 0;
        transform: translateX(0) translateZ(0);
    }
    20% {
        opacity: 0.5;
        transform: translateX(-10px) translateZ(0);
    }
    40% {
        opacity: 0.8;
        transform: translateX(10px) translateZ(0);
    }
    60% {
        transform: translateX(-5px) translateZ(0);
    }
    80% {
        transform: translateX(5px) translateZ(0);
    }
    100% {
        opacity: 1;
        transform: translateX(0) translateZ(0);
    }
}

/* Legacy animation support (kept for compatibility) */
.woobenner-effect-fade.woobenner-animate {
    animation-name: woobennerFadeIn;
}

@keyframes woobennerFadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Slide Effect */
.woobenner-effect-slide.woobenner-animate {
    animation-name: woobennerSlideIn;
}

@keyframes woobennerSlideIn {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Bounce Effect */
.woobenner-effect-bounce.woobenner-animate {
    animation-name: woobennerBounceIn;
    animation-duration: 0.8s;
}

@keyframes woobennerBounceIn {
    0% {
        opacity: 0;
        transform: scale(0.3);
    }
    50% {
        opacity: 1;
        transform: scale(1.05);
    }
    70% {
        transform: scale(0.9);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* Zoom Effect */
.woobenner-effect-zoom.woobenner-animate {
    animation-name: woobennerZoomIn;
}

@keyframes woobennerZoomIn {
    from {
        opacity: 0;
        transform: scale(0.5);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Flip Effect */
.woobenner-effect-flip.woobenner-animate {
    animation-name: woobennerFlipIn;
    animation-duration: 0.8s;
}

@keyframes woobennerFlipIn {
    from {
        opacity: 0;
        transform: perspective(400px) rotateY(90deg);
    }
    40% {
        transform: perspective(400px) rotateY(-20deg);
    }
    60% {
        transform: perspective(400px) rotateY(10deg);
    }
    80% {
        transform: perspective(400px) rotateY(-5deg);
    }
    to {
        opacity: 1;
        transform: perspective(400px) rotateY(0deg);
    }
}

/* Pulse Effect */
.woobenner-effect-pulse.woobenner-animate {
    animation-name: woobennerPulseIn;
    animation-duration: 1s;
}

@keyframes woobennerPulseIn {
    0% {
        opacity: 0;
        transform: scale(0.8);
    }
    50% {
        opacity: 0.5;
        transform: scale(1.1);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* Shake Effect */
.woobenner-effect-shake.woobenner-animate {
    animation-name: woobennerShakeIn;
    animation-duration: 0.8s;
}

@keyframes woobennerShakeIn {
    0% {
        opacity: 0;
        transform: translateX(-10px);
    }
    25% {
        opacity: 0.5;
        transform: translateX(10px);
    }
    50% {
        opacity: 0.8;
        transform: translateX(-8px);
    }
    75% {
        opacity: 0.9;
        transform: translateX(8px);
    }
    100% {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Exit Animations */
.woobenner-banner.woobenner-exit {
    animation-duration: 0.3s;
    animation-fill-mode: forwards;
}

.woobenner-banner.woobenner-exit.woobenner-effect-fade {
    animation-name: woobennerFadeOut;
}

@keyframes woobennerFadeOut {
    to {
        opacity: 0;
        transform: scale(0.95);
    }
}

.woobenner-banner.woobenner-exit.woobenner-effect-slide {
    animation-name: woobennerSlideOut;
}

@keyframes woobennerSlideOut {
    to {
        opacity: 0;
        transform: translateY(-30px);
    }
}

/* Widget Specific Styles */
.woobenner-widget-banner {
    margin: 0 0 20px 0;
    max-width: 100%;
}

.widget .woobenner-banner {
    width: 100% !important;
    height: auto !important;
    min-height: 150px;
}

.widget .woobenner-content {
    padding: 20px 15px;
}

.widget .woobenner-title {
    font-size: 16px;
}

.widget .woobenner-description {
    font-size: 13px;
}

.widget .woobenner-button {
    font-size: 12px;
    padding: 8px 16px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .woobenner-banner {
        max-width: 100% !important;
        height: auto !important;
        min-height: 120px !important;
    }
    
    .woobenner-content {
        padding: 10px;
    }
    
    .woobenner-title {
        font-size: 16px;
    }
    
    .woobenner-description {
        font-size: 13px;
    }
    
    .woobenner-button {
        font-size: 12px;
        padding: 8px 15px;
    }
    
    .woobenner-text {
        padding: 10px;
        margin: 5px;
    }
}

@media (max-width: 480px) {
    .woobenner-banner {
        min-height: 100px !important;
    }
    
    .woobenner-title {
        font-size: 14px;
    }
    
    .woobenner-description {
        font-size: 12px;
    }
    
    .woobenner-button {
        font-size: 11px;
        padding: 6px 12px;
    }
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .woobenner-text {
        background: rgba(255,255,255,0.95);
        border: 2px solid #000;
    }
    
    .woobenner-button {
        border: 2px solid #000;
    }
    
    .woobenner-close {
        background: #000;
        border: 2px solid #fff;
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    .woobenner-banner,
    .woobenner-banner * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Print Styles */
@media print {
    .woobenner-banner {
        display: none !important;
    }
}
