/* ============================================
   PROMOTION HERO ANIMATIONS
   Colour palette: Cyan, Purple, Red/Coral, Orange
   ============================================ */

/* --- Animation 1: Flowing Aurora --- */
/* Smooth gradient that drifts across the hero like northern lights */
.promo-hero--animation1 {
    background: linear-gradient(
        135deg,
        #06b6d4 0%,
        #7c3aed 25%,
        #a855f7 40%,
        #ef4444 65%,
        #f97316 85%,
        #06b6d4 100%
    );
    background-size: 400% 400%;
    animation: promo-aurora 12s ease-in-out infinite;
}

@keyframes promo-aurora {
    0% { background-position: 0% 0%; }
    25% { background-position: 100% 50%; }
    50% { background-position: 50% 100%; }
    75% { background-position: 0% 50%; }
    100% { background-position: 0% 0%; }
}

/* --- Animation 2: Radial Pulse --- */
/* Concentric circles of colour that breathe outward from centre */
.promo-hero--animation2 {
    background:
        radial-gradient(ellipse at 30% 40%, rgba(6, 182, 212, 0.8) 0%, transparent 50%),
        radial-gradient(ellipse at 70% 30%, rgba(124, 58, 237, 0.9) 0%, transparent 45%),
        radial-gradient(ellipse at 80% 70%, rgba(239, 68, 68, 0.7) 0%, transparent 50%),
        radial-gradient(ellipse at 90% 90%, rgba(249, 115, 22, 0.8) 0%, transparent 40%),
        linear-gradient(135deg, #0e1628 0%, #1a0a2e 100%);
    background-size: 200% 200%;
    animation: promo-radial-pulse 8s ease-in-out infinite;
}

@keyframes promo-radial-pulse {
    0%, 100% {
        background-size: 200% 200%;
        background-position: center;
    }
    33% {
        background-size: 250% 250%;
        background-position: 30% 70%;
    }
    66% {
        background-size: 180% 180%;
        background-position: 70% 30%;
    }
}

/* --- Animation 3: Diagonal Sweep --- */
/* Bold diagonal bands that slide across the hero */
.promo-hero--animation3 {
    background: linear-gradient(
        -45deg,
        #06b6d4,
        #7c3aed,
        #ef4444,
        #f97316,
        #a855f7,
        #06b6d4
    );
    background-size: 600% 600%;
    animation: promo-diagonal-sweep 10s linear infinite;
}

@keyframes promo-diagonal-sweep {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* --- Animation 4: Flat Cyan-Purple (static gradient) --- */
/* Clean flat gradient — no animation, just a beautiful still image */
.promo-hero--animation4 {
    background: linear-gradient(
        135deg,
        #06b6d4 0%,
        #0891b2 20%,
        #7c3aed 50%,
        #a855f7 80%,
        #c084fc 100%
    );
}

/* --- Animation 5: Flat Coral-Orange (static gradient) --- */
/* Warm tones — no animation, bold and clean */
.promo-hero--animation5 {
    background: linear-gradient(
        135deg,
        #a855f7 0%,
        #ef4444 30%,
        #f97316 60%,
        #fb923c 80%,
        #fbbf24 100%
    );
}

/* --- Animation 6: Mesh Gradient --- */
/* Layered blobs that drift slowly — organic, premium feel */
.promo-hero--animation6 {
    background-color: #0e1628;
    position: relative;
    overflow: hidden;
}

.promo-hero--animation6::before,
.promo-hero--animation6::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.7;
    animation: promo-mesh-drift 14s ease-in-out infinite;
}

.promo-hero--animation6::before {
    width: 60%;
    height: 60%;
    top: -10%;
    left: -10%;
    background: radial-gradient(circle, #06b6d4 0%, #7c3aed 100%);
    animation-delay: 0s;
}

.promo-hero--animation6::after {
    width: 50%;
    height: 50%;
    bottom: -10%;
    right: -10%;
    background: radial-gradient(circle, #ef4444 0%, #f97316 100%);
    animation-delay: -7s;
}

@keyframes promo-mesh-drift {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }
    33% {
        transform: translate(5%, 10%) scale(1.1);
    }
    66% {
        transform: translate(-5%, -5%) scale(0.95);
    }
}

/* ============================================
   ADMIN ANIMATION SELECTOR
   Preview cards used in the admin create/edit forms
   ============================================ */

.animation-selector {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-top: 8px;
}

.animation-selector__option {
    position: relative;
    cursor: pointer;
}

.animation-selector__option input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.animation-selector__preview {
    height: 120px;
    border-radius: 8px;
    overflow: hidden;
    border: 3px solid #e5e7eb;
    transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
    position: relative;
}

.animation-selector__option input[type="radio"]:checked + .animation-selector__preview {
    border-color: #7c3aed;
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.3);
    transform: scale(1.02);
}

.animation-selector__option:hover .animation-selector__preview {
    border-color: #a855f7;
    transform: scale(1.01);
}

.animation-selector__label {
    display: block;
    text-align: center;
    font-size: 12px;
    font-weight: 600;
    color: #374151;
    margin-top: 6px;
}

.animation-selector__option input[type="radio"]:checked ~ .animation-selector__label {
    color: #7c3aed;
}

/* Mini-preview variants — same gradients as hero but used in the small cards */
.animation-selector__preview--animation1 {
    background: linear-gradient(135deg, #06b6d4 0%, #7c3aed 25%, #a855f7 40%, #ef4444 65%, #f97316 85%, #06b6d4 100%);
    background-size: 400% 400%;
    animation: promo-aurora 12s ease-in-out infinite;
}

.animation-selector__preview--animation2 {
    background:
        radial-gradient(ellipse at 30% 40%, rgba(6, 182, 212, 0.8) 0%, transparent 50%),
        radial-gradient(ellipse at 70% 30%, rgba(124, 58, 237, 0.9) 0%, transparent 45%),
        radial-gradient(ellipse at 80% 70%, rgba(239, 68, 68, 0.7) 0%, transparent 50%),
        radial-gradient(ellipse at 90% 90%, rgba(249, 115, 22, 0.8) 0%, transparent 40%),
        linear-gradient(135deg, #0e1628 0%, #1a0a2e 100%);
    background-size: 200% 200%;
    animation: promo-radial-pulse 8s ease-in-out infinite;
}

.animation-selector__preview--animation3 {
    background: linear-gradient(-45deg, #06b6d4, #7c3aed, #ef4444, #f97316, #a855f7, #06b6d4);
    background-size: 600% 600%;
    animation: promo-diagonal-sweep 10s linear infinite;
}

.animation-selector__preview--animation4 {
    background: linear-gradient(135deg, #06b6d4 0%, #0891b2 20%, #7c3aed 50%, #a855f7 80%, #c084fc 100%);
}

.animation-selector__preview--animation5 {
    background: linear-gradient(135deg, #a855f7 0%, #ef4444 30%, #f97316 60%, #fb923c 80%, #fbbf24 100%);
}

.animation-selector__preview--animation6 {
    background-color: #0e1628;
    overflow: hidden;
}

.animation-selector__preview--animation6::before,
.animation-selector__preview--animation6::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    filter: blur(30px);
    opacity: 0.7;
    animation: promo-mesh-drift 14s ease-in-out infinite;
}

.animation-selector__preview--animation6::before {
    width: 60%;
    height: 60%;
    top: -10%;
    left: -10%;
    background: radial-gradient(circle, #06b6d4 0%, #7c3aed 100%);
}

.animation-selector__preview--animation6::after {
    width: 50%;
    height: 50%;
    bottom: -10%;
    right: -10%;
    background: radial-gradient(circle, #ef4444 0%, #f97316 100%);
    animation-delay: -7s;
}

/* ============================================
   ADMIN LIVE PREVIEW
   Scaled-down preview of the promotion hero
   ============================================ */

.promo-preview {
    margin-top: var(--space-md);
    margin-bottom: var(--space-lg);
}

.promo-preview__toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: none;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    cursor: pointer;
    transition: border-color 0.2s ease, color 0.2s ease;
}

.promo-preview__toggle:hover {
    border-color: #7c3aed;
    color: #7c3aed;
}

.promo-preview__toggle--active {
    border-color: #7c3aed;
    color: #7c3aed;
    background: #f5f3ff;
}

.promo-preview__toggle svg {
    width: 16px;
    height: 16px;
}

.promo-preview__frame {
    margin-top: var(--space-md);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.12);
    border: 1px solid #e5e7eb;
}

.promo-preview__hero {
    position: relative;
    min-height: 280px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    overflow: hidden;
}

.promo-preview__background {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    z-index: 1;
}

.promo-preview__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(0,0,0,0.35) 0%, rgba(0,0,0,0.2) 100%);
    z-index: 1;
}

.promo-preview__content {
    position: relative;
    z-index: 2;
    text-align: center;
    color: white;
    padding: 40px 24px;
    width: 100%;
}

.promo-preview__title {
    font-size: clamp(20px, 3vw, 32px);
    font-weight: bold;
    color: white;
    margin-bottom: 16px;
    text-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.promo-preview__title--placeholder {
    opacity: 0.5;
}

.promo-preview__description {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.95);
    max-width: 600px;
    margin: 0 auto 16px auto;
    line-height: 1.6;
    text-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.promo-preview__badge {
    display: none;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
    margin-top: 12px;
}

/* Reuse animation classes on the preview hero */
.promo-preview__hero--animation1 {
    background: linear-gradient(135deg, #06b6d4 0%, #7c3aed 25%, #a855f7 40%, #ef4444 65%, #f97316 85%, #06b6d4 100%);
    background-size: 400% 400%;
    animation: promo-aurora 12s ease-in-out infinite;
}

.promo-preview__hero--animation2 {
    background:
        radial-gradient(ellipse at 30% 40%, rgba(6, 182, 212, 0.8) 0%, transparent 50%),
        radial-gradient(ellipse at 70% 30%, rgba(124, 58, 237, 0.9) 0%, transparent 45%),
        radial-gradient(ellipse at 80% 70%, rgba(239, 68, 68, 0.7) 0%, transparent 50%),
        radial-gradient(ellipse at 90% 90%, rgba(249, 115, 22, 0.8) 0%, transparent 40%),
        linear-gradient(135deg, #0e1628 0%, #1a0a2e 100%);
    background-size: 200% 200%;
    animation: promo-radial-pulse 8s ease-in-out infinite;
}

.promo-preview__hero--animation3 {
    background: linear-gradient(-45deg, #06b6d4, #7c3aed, #ef4444, #f97316, #a855f7, #06b6d4);
    background-size: 600% 600%;
    animation: promo-diagonal-sweep 10s linear infinite;
}

.promo-preview__hero--animation4 {
    background: linear-gradient(135deg, #06b6d4 0%, #0891b2 20%, #7c3aed 50%, #a855f7 80%, #c084fc 100%);
}

.promo-preview__hero--animation5 {
    background: linear-gradient(135deg, #a855f7 0%, #ef4444 30%, #f97316 60%, #fb923c 80%, #fbbf24 100%);
}

.promo-preview__hero--animation6 {
    background-color: #0e1628;
}

.promo-preview__hero--animation6::before,
.promo-preview__hero--animation6::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.7;
    animation: promo-mesh-drift 14s ease-in-out infinite;
}

.promo-preview__hero--animation6::before {
    width: 60%;
    height: 60%;
    top: -10%;
    left: -10%;
    background: radial-gradient(circle, #06b6d4 0%, #7c3aed 100%);
}

.promo-preview__hero--animation6::after {
    width: 50%;
    height: 50%;
    bottom: -10%;
    right: -10%;
    background: radial-gradient(circle, #ef4444 0%, #f97316 100%);
    animation-delay: -7s;
}

/* Description mode toggle (Rich Text / HTML) */
.form-label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
}

.form-label-row .form-label {
    margin-bottom: 0;
}

.form-mode-toggle {
    background: none;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    padding: 3px 10px;
    font-size: 11px;
    font-weight: 600;
    color: #6b7280;
    cursor: pointer;
    transition: border-color 0.2s ease, color 0.2s ease;
}

.form-mode-toggle:hover {
    border-color: #7c3aed;
    color: #7c3aed;
}

.form-mode-toggle--active {
    border-color: #7c3aed;
    color: #7c3aed;
    background: #f5f3ff;
}

.form-textarea--code {
    font-family: 'Courier New', monospace;
    font-size: 13px;
    line-height: 1.5;
    min-height: 180px;
    resize: vertical;
    white-space: pre-wrap;
    tab-size: 2;
}

/* Current image thumbnail in edit form */
.form-current-image {
    margin-bottom: 8px;
}

.form-current-image__img {
    max-width: 200px;
    max-height: 100px;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
    object-fit: cover;
}

/* ============================================
   PROMO CODE BOX (redesigned)
   ============================================ */

.promo-code-box {
    display: inline-flex;
    align-items: center;
    gap: 16px;
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 16px;
    padding: 20px 28px;
    margin-bottom: 24px;
    transition: background 0.2s ease;
}

.promo-code-box:hover {
    background: rgba(255, 255, 255, 0.18);
}

.promo-code-box__discount {
    font-size: clamp(24px, 4vw, 36px);
    font-weight: 800;
    color: #fff;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    line-height: 1.1;
}

.promo-code-box__divider {
    width: 1px;
    height: 48px;
    background: rgba(255, 255, 255, 0.3);
}

.promo-code-box__code-area {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.promo-code-box__label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: rgba(255, 255, 255, 0.7);
    font-weight: 500;
}

.promo-code-box__code-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.promo-code-box__code {
    font-family: 'Courier New', monospace;
    font-size: 20px;
    font-weight: 700;
    color: #fff;
    background: rgba(255, 255, 255, 0.15);
    padding: 6px 14px;
    border-radius: 8px;
    letter-spacing: 2px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.promo-code-box__copy-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.8);
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
    padding: 0;
    font-size: 16px;
    line-height: 1;
}

.promo-code-box__copy-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    color: #fff;
}

.promo-code-box__copy-btn--copied {
    background: rgba(34, 197, 94, 0.3);
    border-color: rgba(34, 197, 94, 0.5);
    color: #4ade80;
}

/* Responsive */
@media (max-width: 600px) {
    .promo-code-box {
        flex-direction: column;
        gap: 12px;
        padding: 16px 20px;
    }

    .promo-code-box__divider {
        width: 60%;
        height: 1px;
    }

    .animation-selector {
        grid-template-columns: repeat(2, 1fr);
    }
}
