/**
 * Zeal Ad Manager
 *
 * This file contains the base styles, layouts, and common keyframes for the "Animated Ad" format.
 */

/**
 * TABLE OF CONTENTS
 * --------------------------------------------------------------------------
 * 1.0 - Base Animated Ad Styles & Layout
 * 2.0 - Dimension-Specific Adjustments
 * 4.0 - Keyframe Definitions
 * --------------------------------------------------------------------------
 */


/* --- 1.0 - Base Animated Ad Styles & Layout --- */
.zam-anim-ad-unit {
    position: relative;
    overflow: hidden;
    background: #ddd;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: #fff;
    border-radius: 8px;
    cursor: pointer;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    display: flex;
    flex-direction: column;
}

.zam-anim-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    transition: transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1), filter 0.4s ease;
    z-index: 1;
}

.zam-anim-content {
    position: relative;
    z-index: 2;
    padding: 20px;
    flex-grow: 1; /* Allow content to fill available space */
    display: flex;
    flex-direction: column;
    justify-content: center;
    box-sizing: border-box;
}

.zam-anim-logo-wrapper {
    text-align: center;
    margin-bottom: 10px;
    opacity: 0;
}

.zam-anim-logo {
    max-width: 120px;
    max-height: 40px;
    display: inline-block;
}

.zam-anim-headline,
.zam-anim-description,
.zam-anim-button {
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.7);
    margin: 0;
    opacity: 0;
}

.zam-anim-headline {
    color: #fff;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.5px;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 1;
    overflow: hidden;
    text-overflow: ellipsis;
}

.zam-anim-description {
    line-height: 1.5;
    margin-top: 8px;
    font-weight: 400;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    text-overflow: ellipsis;
}

.zam-anim-button {
    position: absolute;
    z-index: 3;
    padding: 12px;
    width: 80%;
    left: 10%;
    bottom: 10px;
    text-align: center;
    font-weight: 600;
    border-radius: 6px;
    background-color: #ef0606;
    box-sizing: border-box;
}


/* --- 2.0 - Dimension-Specific Adjustments --- */

/* Default: Spotlight (300x250) */
.zam-anim-ad-unit.is-spotlight {
    width: 300px;
    height: 250px;
}
.is-spotlight .zam-anim-headline { font-size: 26px; }
.is-spotlight .zam-anim-description { font-size: 14px; }
.is-spotlight .zam-anim-button {
    bottom: 20px;
    left: 20px;
    right: 20px;
    width: auto;
}

/* Portrait (300x500) */
.zam-anim-ad-unit.is-portrait {
    width: 300px;
    height: 500px;
}
.is-portrait .zam-anim-content { justify-content: flex-end; padding-bottom: 100px; }
.is-portrait .zam-anim-headline { font-size: 32px; -webkit-line-clamp: 2; }
.is-portrait .zam-anim-description { font-size: 16px; -webkit-line-clamp: 3; margin-top: 15px;}
.is-portrait .zam-anim-button {
    bottom: 30px;
    left: 30px;
    right: 30px;
    width: auto;
}
.is-portrait .zam-anim-focus-zoom .zam-anim-content,
.is-portrait .zam-anim-text-spotlight .zam-anim-content {
    justify-content: center;
    padding-bottom: 20px;
}

/* Banner (728x90) */
.zam-anim-ad-unit.is-banner {
    width: 728px;
    height: 90px;
    max-width: 100%;
    flex-direction: row;
    align-items: center;
    padding: 0 15px;
}
.is-banner .zam-anim-content {
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    padding: 0;
    flex-grow: 1;
}
.is-banner .zam-anim-logo-wrapper {
    margin: 0 20px 0 0;
    flex-shrink: 0;
}
.is-banner .zam-anim-logo { max-height: 50px; }
.is-banner .zam-anim-text-container { flex-grow: 1; }
.is-banner .zam-anim-headline { font-size: 22px; text-align: left; }
.is-banner .zam-anim-description { font-size: 14px; margin-top: 2px; text-align: left; }
.is-banner .zam-anim-button {
    margin-top: 20px;
    width: 150px;
    position: static;
    margin-left: 30px;
    padding: 10px 25px;
    white-space: nowrap;
    flex-shrink: 0;
    opacity: 0;
}
.is-banner .zam-anim-text-spotlight .zam-anim-headline,
.is-banner .zam-anim-text-spotlight .zam-anim-description {
    text-align: left;
}


/* --- 4.0 - Keyframe Definitions --- */

@keyframes zam-fade-in {
    0%, 20%, 100% { opacity: 0; }
    50%, 80% { opacity: 1; }
}

@keyframes zam-slide-in-bottom {
    0%, 20%, 100% { opacity: 0; transform: translateY(25px); }
    50%, 80% { opacity: 1; transform: translateY(0); }
}

@keyframes zam-slide-in-left {
    0%, 20%, 100% { opacity: 0; transform: translateX(-25px); }
    50%, 80% { opacity: 1; transform: translateX(0); }
}

@keyframes zam-slide-in-right {
    0%, 20%, 100% { opacity: 0; transform: translateX(25px); }
    50%, 80% { opacity: 1; transform: translateX(0); }
}

@keyframes zam-slow-zoom {
    from { transform: scale(1); }
    to { transform: scale(1.15); }
}

@keyframes zam-light-reveal {
    0% { transform: translate(-50%, -50%) scale(0); opacity: 0; }
    50% { transform: translate(-50%, -50%) scale(500); opacity: 1; }
    100% { transform: translate(-50%, -50%) scale(0); opacity: 0; }
}

@keyframes zam-fade-scale-in {
    0%, 20%, 100% { opacity: 0; transform: scale(0.9); }
    50%, 80% { opacity: 1; transform: scale(1); }
}

@keyframes zam-fade-blur-in {
    0%, 20%, 100% { opacity: 0; filter: blur(8px); transform: scale(0.95); }
    50%, 80% { opacity: 1; filter: blur(0); transform: scale(1); }
}

@keyframes zam-ken-burns {
    0% { transform: scale(1) translate(0, 0); }
    100% { transform: scale(1.15) translate(-3%, 2%); }
}

@keyframes zam-ken-burns-fade-up {
    0%, 15%, 85%, 100% { opacity: 0; transform: translateY(10px); }
    30%, 70% { opacity: 1; transform: translateY(0); }
}

@keyframes zam-diagonal-wipe {
    0% { clip-path: polygon(0 0, 0 0, 0 100%, 0 100%); }
    40%, 60% { clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%); }
    100% { clip-path: polygon(100% 0, 100% 0, 100% 100%, 100% 100%); }
}

@keyframes zam-reveal-text-anim {
    0%, 30%, 100% { opacity: 0; transform: translateY(15px); }
    50%, 80% { opacity: 1; transform: translateY(0); }
}

@keyframes zam-glitch-main {
    0% { clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%); }
    2% { clip-path: polygon(0 42%, 100% 42%, 100% 55%, 0 55%); }
    4% { clip-path: polygon(0 22%, 100% 22%, 100% 95%, 0 95%); }
    6% { clip-path: polygon(0 77%, 100% 77%, 100% 82%, 0 82%); }
    8%, 100% { clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%); }
}

@keyframes zam-glitch-sub {
    0%, 100% { opacity: 1; transform: translateX(0); }
    2% { opacity: 1; transform: translateX(10px); }
    4% { opacity: 0.3; transform: translateX(-10px); }
    6% { opacity: 1; transform: translateX(5px); }
    8% { opacity: 0.5; transform: translateX(-2px); }
}

@keyframes minimal-rotate { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
@keyframes minimal-float { 0%, 100% { transform: translateY(0) rotate(0deg); } 50% { transform: translateY(-10px) rotate(5deg); } }
@keyframes minimal-underline { 0% { transform: scaleX(0); transform-origin: right; } 50% { transform: scaleX(1); transform-origin: right; } 51% { transform-origin: left; } 100% { transform: scaleX(0); transform-origin: left; } }
@keyframes minimal-levitate { 0%, 100% { transform: translateY(0) rotate(0deg); } 33% { transform: translateY(-8px) rotate(1deg); } 66% { transform: translateY(4px) rotate(-1deg); } }
@keyframes minimal-pulse { 0%, 100% { transform: scale(1); box-shadow: 0 4px 15px rgba(74, 144, 226, 0.3); } 50% { transform: scale(1.03); box-shadow: 0 6px 20px rgba(74, 144, 226, 0.4); } }
@keyframes minimal-fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes minimal-slideUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes minimal-particle { 0% { opacity: 0; transform: translateY(0) scale(0); } 20% { opacity: 0.7; transform: translateY(-20px) scale(1); } 100% { opacity: 0; transform: translateY(-40px) scale(0); } }

@keyframes luxe-pulse { 0%, 100% { transform: scale(1); opacity: 0.05; } 50% { transform: scale(1.1); opacity: 0.08; } }
@keyframes luxe-rotate { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
@keyframes luxe-glow { 0%, 100% { text-shadow: 0 0 5px rgba(224, 168, 13, 0.7); } 50% { text-shadow: 0 0 15px rgba(224, 168, 13, 0.9), 0 0 20px rgba(224, 168, 13, 0.6); } }
@keyframes luxe-float { 0% { transform: translateY(0px) rotate(0deg); } 50% { transform: translateY(-10px) rotate(2deg); } 100% { transform: translateY(0px) rotate(0deg); } }
@keyframes luxe-pulse-button { 0%, 100% { transform: scale(1); box-shadow: 0 4px 8px rgba(224, 168, 13, 0.3); } 50% { transform: scale(1.05); box-shadow: 0 6px 12px rgba(224, 168, 13, 0.5); } }
@keyframes luxe-bounce { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }
@keyframes luxe-fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes luxe-sparkle { 0% { opacity: 0; transform: scale(0); } 50% { opacity: 1; transform: scale(1); } 100% { opacity: 0; transform: scale(0); } }
@keyframes luxe-shine { 0% { left: -100%; } 20% { left: 100%; } 100% { left: 100%; } }

@keyframes luxury-shimmer { 0%, 100% { opacity: 0.1; } 50% { opacity: 0.3; } }
@keyframes luxury-gold-glow { 0%, 100% { opacity: 0; transform: scaleX(0); } 50% { opacity: 1; transform: scaleX(1); } }
@keyframes luxury-float { 0%, 100% { transform: translateY(0) scale(1); } 50% { transform: translateY(-10px) scale(1.05); } }
@keyframes luxury-button-glow { 0%, 100% { box-shadow: 0 5px 20px rgba(212, 175, 55, 0.5); } 50% { box-shadow: 0 5px 30px rgba(212, 175, 55, 0.8); } }
@keyframes luxury-fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes luxury-slideUp { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: translateY(0); } }
@keyframes luxury-sparkle { 0%, 100% { opacity: 0; transform: scale(0); } 50% { opacity: 1; transform: scale(1); } }
@keyframes luxury-crown-float { 0%, 100% { transform: translateX(-50%) rotate(0deg); } 25% { transform: translateX(-50%) rotate(5deg); } 75% { transform: translateX(-50%) rotate(-5deg); } }