/**
 * Announcement Banner Styles - Fixed Transparent Bar with Fade/Spin Effects
 *
 * @package Tokutei
 * @since 1.3.10
 */

/* Announcement Banner Container - Always visible, fixed height, sticky below header */
.announcement-banner {
    position: sticky;
    top: 74px; /* Height of header (70px) + 4px spacing */
    width: 100%;
    overflow: hidden;
    z-index: 998; /* Below header (1000) but above content */

    /* Fixed height - always occupies space */
    min-height: 48px;

    /* Transparent by default - content will fade in */
    background: transparent;

    /* Smooth transitions */
    transition: background 0.6s ease;
}

/* When banner has content - show gradient background */
.announcement-banner.has-content {
    /* Beautiful gradient background - Vibrant Red/Orange (Default) */
    background: linear-gradient(135deg, #E53935 0%, #FF6F00 100%);

    /* Shadow and depth effects */
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15),
                0 1px 3px rgba(0, 0, 0, 0.1);
}

.announcement-banner.hidden {
    display: none;
}

/* Subtle border bottom for definition */
.announcement-banner::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.3) 50%,
        transparent 100%);
}

/* Banner Inner Wrapper */
.announcement-banner-inner {
    position: relative;
    width: 100%;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
}

/* Fade gradient on left and right edges - Applied to banner inner */
.announcement-banner-inner::before,
.announcement-banner-inner::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    width: 80px;
    pointer-events: none;
    z-index: 2;
}

.announcement-banner-inner::before {
    left: 0;
    background: linear-gradient(to right,
        rgba(0, 0, 0, 0.25) 0%,
        transparent 100%);
}

.announcement-banner-inner::after {
    right: 0;
    background: linear-gradient(to left,
        rgba(0, 0, 0, 0.25) 0%,
        transparent 100%);
}

/* Announcement Slider Container */
.announcement-slider {
    position: relative;
    width: 100%;
    max-width: 1200px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Announcement Items Container */
.announcement-items {
    position: relative;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Individual Announcement Item - Fade/Scale effect (Spin-like) */
.announcement-item {
    position: absolute;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: scale(0.8) rotateX(90deg);
    transition: all 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
    pointer-events: none;
}

.announcement-item.active {
    opacity: 1;
    transform: scale(1) rotateX(0deg);
    position: relative;
    pointer-events: auto;
}

.announcement-item.exiting {
    opacity: 0;
    transform: scale(0.8) rotateX(-90deg);
}

/* Announcement Content Wrapper */
.announcement-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    text-align: center;
    width: 100%;
    padding: 0 10px;
}

/* Icon Styling */
.announcement-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    line-height: 1;
    animation: iconPulse 2s ease-in-out infinite;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

@keyframes iconPulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

/* Announcement Text */
.announcement-text {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
    text-decoration: none;
    color: inherit;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    letter-spacing: 0.3px;
}

/* Link Styling */
.announcement-link {
    color: inherit;
    text-decoration: none;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.announcement-link:hover {
    transform: scale(1.02);
    filter: brightness(1.1);
}

.announcement-link:hover .announcement-text {
    text-decoration: underline;
    text-decoration-thickness: 2px;
    text-underline-offset: 3px;
}

/* Close Button - Hidden by default */
.announcement-close {
    display: none;
}

/* Navigation Dots - Removed (not needed) */

/* Smooth fade out animation */
@keyframes fadeOut {
    from {
        opacity: 1;
        max-height: 100px;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        max-height: 0;
        padding-top: 0;
        padding-bottom: 0;
        transform: translateY(-20px);
    }
}

.announcement-banner.closing {
    animation: fadeOut 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* Resting state - fade without layout shift */
.announcement-banner.resting {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease;
}

/* Keep height when resting to avoid layout shift */
.announcement-banner.resting .announcement-banner-inner {
    visibility: hidden;
}

/* Responsive Design */
@media (max-width: 768px) {
    .announcement-banner-inner {
        padding: 8px 15px;
        min-height: 38px;
    }

    .announcement-content {
        gap: 8px;
        padding: 0 5px;
    }

    .announcement-text {
        font-size: 13px;
    }

    .announcement-icon {
        font-size: 16px;
    }

    /* Smaller fade gradient on mobile */
    .announcement-banner-inner::before,
    .announcement-banner-inner::after {
        width: 50px;
    }
}

@media (max-width: 480px) {
    .announcement-banner-inner {
        padding: 8px 12px;
        min-height: 36px;
    }

    .announcement-text {
        font-size: 12px;
        letter-spacing: 0.2px;
    }

    .announcement-icon {
        font-size: 14px;
    }

    .announcement-content {
        gap: 6px;
    }

    /* Even smaller fade on small mobile */
    .announcement-banner-inner::before,
    .announcement-banner-inner::after {
        width: 40px;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .announcement-banner {
        border: 2px solid currentColor;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .announcement-item,
    .announcement-link,
    .announcement-banner {
        transition: none;
        animation: none;
    }

    .announcement-icon {
        animation: none;
    }

    .announcement-item.active {
        transform: none;
    }

    .announcement-item.exiting {
        transform: none;
    }

    .announcement-banner.closing {
        animation: none;
        display: none;
    }
}

/* Custom Gradient Backgrounds - Vivid Colors */
.announcement-banner.has-content.gradient-fire {
    /* Đỏ Hồng Coral (Mặc định) - Nhẹ nhàng và sang trọng */
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a6f 100%);
}

.announcement-banner.has-content.gradient-ocean {
    /* Xanh Dương - Sâu thẳm như đại dương */
    background: linear-gradient(135deg, #1976D2 0%, #00B8D4 100%);
}

.announcement-banner.has-content.gradient-sunset {
    /* Hoàng Hôn - Ấm áp và rực rỡ */
    background: linear-gradient(135deg, #F06292 0%, #FFB74D 100%);
}

.announcement-banner.has-content.gradient-forest {
    /* Xanh Lá - Tươi mát và sống động */
    background: linear-gradient(135deg, #00897B 0%, #43A047 100%);
}

.announcement-banner.has-content.gradient-purple {
    /* Tím Hồng - Sang trọng và nổi bật */
    background: linear-gradient(135deg, #7B1FA2 0%, #E91E63 100%);
}

.announcement-banner.has-content.gradient-custom {
    /* Custom gradient using CSS variables */
    background: linear-gradient(135deg, var(--custom-gradient-start, #ff6b6b) 0%, var(--custom-gradient-end, #ee5a6f) 100%);
}

/* Loading state for smooth initialization */
.announcement-banner.loading .announcement-item {
    opacity: 0;
}
