/* ═══════════════════════════════════════════════════════════════
   Hero Announcement Bar — Glassmorphism Pill
   • Animated conic-gradient border (rotates via @property)
   • Backdrop-blur glass surface
   • Shimmer pass every 6s
   • Pulse-dot on icon, hover lift
   • Dismiss animation (slide-up + fade)
   ═══════════════════════════════════════════════════════════════ */

@property --ann-angle {
    syntax: '<angle>';
    initial-value: 0deg;
    inherits: false;
}

/* ═══ Carousel wrapper ═══════════════════════════════════════ */
.hero-announcement-carousel {
    position: relative;
    grid-column: 1 / -1;          /* span both hero columns */
    justify-self: center;
    width: 100%;
    max-width: 760px;
    margin: 0 auto 40px;
    isolation: isolate;
}

/* When the carousel has more than one slide we stack the slides */
.hero-announcement-carousel[data-count]:not([data-count="1"]) {
    display: grid;
    grid-template-areas: "stack";
    margin-bottom: 56px;          /* extra room for dots */
}
.hero-announcement-carousel[data-count]:not([data-count="1"]) .hero-announcement {
    grid-area: stack;
}

.hero-announcement {
    position: relative;
    display: flex;
    width: 100%;
    padding: 2px;                 /* gap for the gradient border */
    border-radius: 999px;
    opacity: 0;
    transform: translateY(-6px);
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.45s ease, transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1), visibility 0s linear 0.45s;
}
.hero-announcement.active {
    opacity: 1;
    transform: translateY(0);
    visibility: visible;
    pointer-events: auto;
    transition: opacity 0.45s ease, transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1), visibility 0s linear 0s;
    animation: ann-enter 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes ann-enter {
    from { opacity: 0; transform: translateY(-18px) scale(0.92); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* Animated conic border — modern browsers */
.hero-announcement::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -2;
    border-radius: inherit;
    background: conic-gradient(
        from var(--ann-angle),
        var(--ann-c1, #10b981) 0deg,
        var(--ann-c2, #34d399) 90deg,
        var(--ann-c3, #fbbf24) 180deg,
        var(--ann-c2, #34d399) 270deg,
        var(--ann-c1, #10b981) 360deg
    );
    animation: ann-rotate 6s linear infinite;
    filter: saturate(1.2);
}
@keyframes ann-rotate {
    to { --ann-angle: 360deg; }
}

/* Soft glow under the pill */
.ann-glow {
    position: absolute;
    inset: -10px;
    z-index: -3;
    border-radius: inherit;
    background: radial-gradient(
        ellipse at center,
        var(--ann-c1, rgba(16, 185, 129, 0.45)) 0%,
        transparent 70%
    );
    opacity: 0.55;
    filter: blur(20px);
    animation: ann-glow-pulse 4s ease-in-out infinite;
}
@keyframes ann-glow-pulse {
    0%, 100% { opacity: 0.45; transform: scale(1); }
    50%      { opacity: 0.75; transform: scale(1.05); }
}

/* Inner glass surface */
.ann-content {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    padding: 12px 22px 12px 16px;
    background: rgba(255, 255, 255, 0.72);
    backdrop-filter: blur(14px) saturate(1.4);
    -webkit-backdrop-filter: blur(14px) saturate(1.4);
    border-radius: inherit;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

[data-theme="dark"] .ann-content {
    background: rgba(20, 25, 35, 0.78);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

/* Shimmer sweep */
.ann-shimmer {
    position: absolute;
    inset: 2px;
    z-index: 0;
    border-radius: inherit;
    overflow: hidden;
    pointer-events: none;
}
.ann-shimmer::after {
    content: '';
    position: absolute;
    top: 0;
    left: -50%;
    width: 50%;
    height: 100%;
    background: linear-gradient(
        100deg,
        transparent 0%,
        rgba(255, 255, 255, 0.4) 50%,
        transparent 100%
    );
    transform: skewX(-20deg);
    animation: ann-shimmer-sweep 6s ease-in-out infinite;
}
[data-theme="dark"] .ann-shimmer::after {
    background: linear-gradient(
        100deg,
        transparent 0%,
        rgba(255, 255, 255, 0.12) 50%,
        transparent 100%
    );
}
@keyframes ann-shimmer-sweep {
    0%       { left: -50%; }
    50%, 60% { left: 110%; }
    100%     { left: 110%; }
}

/* Icon ring with pulse */
.ann-icon-wrap {
    position: relative;
    flex-shrink: 0;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--ann-c1, #10b981), var(--ann-c2, #059669));
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 16px;
    box-shadow: 0 4px 14px var(--ann-c1-soft, rgba(16, 185, 129, 0.4));
}
.ann-icon {
    z-index: 1;
    animation: ann-icon-bob 2.5s ease-in-out infinite;
}
@keyframes ann-icon-bob {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50%      { transform: translateY(-2px) rotate(-6deg); }
}

.ann-pulse {
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    border: 2px solid var(--ann-c1, #10b981);
    opacity: 0;
    animation: ann-pulse-ring 2s ease-out infinite;
}
@keyframes ann-pulse-ring {
    0%   { transform: scale(0.85); opacity: 0.7; }
    100% { transform: scale(1.6);  opacity: 0; }
}

/* Text */
.ann-text {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 12px;
    font-size: 14px;
    color: #1f2937;
    line-height: 1.45;
}
[data-theme="dark"] .ann-text { color: #e5e7eb; }
.ann-message strong { color: #047857; font-weight: 700; }
[data-theme="dark"] .ann-message strong { color: #34d399; }

.ann-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 700;
    color: #047857;
    text-decoration: none;
    padding: 4px 12px;
    border-radius: 999px;
    background: rgba(16, 185, 129, 0.1);
    transition: all 0.2s ease;
    white-space: nowrap;
}
[data-theme="dark"] .ann-link {
    color: #34d399;
    background: rgba(52, 211, 153, 0.15);
}
.ann-link:hover {
    background: rgba(16, 185, 129, 0.18);
    transform: translateX(2px);
}
[dir="rtl"] .ann-link:hover { transform: translateX(-2px); }
.ann-link .ann-arrow {
    font-size: 11px;
    transition: transform 0.2s ease;
}
.ann-link:hover .ann-arrow { transform: translateX(3px); }
[dir="rtl"] .ann-link .ann-arrow { transform: rotate(180deg); }
[dir="rtl"] .ann-link:hover .ann-arrow { transform: rotate(180deg) translateX(3px); }

/* ═══ Dots navigation (only when 2+ announcements) ═══════════ */
.hero-announcement-dots {
    position: absolute;
    bottom: -22px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 6px;
    z-index: 2;
}
.ann-dot {
    width: 7px;
    height: 7px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: rgba(100, 116, 139, 0.35);
    cursor: pointer;
    transition: all 0.3s ease;
}
.ann-dot:hover { background: rgba(100, 116, 139, 0.6); }
.ann-dot.active {
    width: 22px;
    border-radius: 4px;
    background: linear-gradient(90deg, #10b981, #34d399);
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.4);
}
[data-theme="dark"] .ann-dot { background: rgba(148, 163, 184, 0.3); }
[data-theme="dark"] .ann-dot:hover { background: rgba(148, 163, 184, 0.55); }

/* ═══ Type Variants ═══════════════════════════════════════════ */
.hero-announcement.type-info {
    --ann-c1: #10b981;
    --ann-c2: #34d399;
    --ann-c3: #fbbf24;
    --ann-c1-soft: rgba(16, 185, 129, 0.4);
}
.hero-announcement.type-success {
    --ann-c1: #22c55e;
    --ann-c2: #4ade80;
    --ann-c3: #facc15;
    --ann-c1-soft: rgba(34, 197, 94, 0.4);
}
.hero-announcement.type-warning {
    --ann-c1: #f59e0b;
    --ann-c2: #fbbf24;
    --ann-c3: #fb923c;
    --ann-c1-soft: rgba(245, 158, 11, 0.4);
}
.hero-announcement.type-promo {
    --ann-c1: #8b5cf6;
    --ann-c2: #ec4899;
    --ann-c3: #fbbf24;
    --ann-c1-soft: rgba(139, 92, 246, 0.4);
}
.hero-announcement.type-promo .ann-message strong { color: #ec4899; }
[data-theme="dark"] .hero-announcement.type-promo .ann-message strong { color: #f472b6; }
.hero-announcement.type-promo .ann-link {
    color: #fff;
    background: linear-gradient(135deg, #8b5cf6, #ec4899);
    box-shadow: 0 4px 14px rgba(236, 72, 153, 0.35);
}
.hero-announcement.type-promo .ann-link:hover {
    background: linear-gradient(135deg, #7c3aed, #db2777);
    box-shadow: 0 6px 18px rgba(236, 72, 153, 0.5);
}

/* ═══ Responsive ══════════════════════════════════════════════ */
@media (max-width: 600px) {
    .hero-announcement { max-width: calc(100% - 16px); }
    .ann-content { padding: 10px 14px 10px 12px; gap: 10px; }
    .ann-text { font-size: 13px; }
    .ann-icon-wrap { width: 32px; height: 32px; font-size: 14px; }
    .ann-link { padding: 3px 10px; font-size: 12px; }
}

/* ═══ Reduced Motion ══════════════════════════════════════════ */
@media (prefers-reduced-motion: reduce) {
    .hero-announcement,
    .hero-announcement::before,
    .ann-glow,
    .ann-shimmer::after,
    .ann-icon,
    .ann-pulse {
        animation: none !important;
    }
}
