/* ================================================
   HENDOSHI - COMPONENTS - DISCOUNT BANNER
   ================================================
   
   Purpose: Discount banner and theme toggle button styling
   
   Contains:
   - Theme toggle button
   - Discount banner components
   - Interactive hover effects
   - Theme switching UI elements
   
   Dependencies: variables.css
   Load Order: Load after foundation files
   ================================================ */

.theme-toggle:hover {
    transform: rotate(20deg) scale(1.1);
    color: var(--neon-pink);
}

.theme-toggle i {
    transition: transform 0.5s ease;
}

.theme-toggle.light-mode-active i {
    transform: rotate(180deg);
}

:root.light-mode .theme-toggle,
.theme-toggle.light-mode-active {
    color: var(--neon-pink);
}

.theme-toggle.light-mode-active:hover {
    color: #ff69b4;
}

:root.light-mode .theme-toggle:hover {
    color: var(--electric-yellow);
}

/* ============================================
   DISCOUNT BANNER - Enhanced with 7 Improvements
   ============================================ */

/* Main Banner Container */
body .discount-banner {
    box-sizing: border-box;
    display: flex;
    z-index: 99999;
    position: fixed;
    top: 0;
    right: 0;
    left: 0;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 0.6rem 0;
    overflow: hidden;
    gap: 0.5rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.12);
    backdrop-filter: none;
    background: linear-gradient(
        -45deg,
        var(--charcoal) 0%,
        rgba(255, 20, 147, 0.3) 25%,
        rgba(255, 215, 0, 0.2) 50%,
        var(--charcoal) 100%
    );
    background-size: 400% 400%;
    box-shadow: 0 6px 30px rgba(0, 0, 0, 0.6);
    color: var(--off-white);
    font-size: 0.9rem;
    text-align: center;
    animation:
        gradientShift 12s ease-in-out infinite,
        bannerGlow 15s ease-in-out infinite;
    cursor: default;
    opacity: 1;
    transition:
        transform 0.4s cubic-bezier(0.4, 0, 0.2, 1),
        box-shadow 0.4s ease,
        opacity 0.3s ease;
}

/* High-value discount special styling */
.discount-banner.high-value {
    background: linear-gradient(
        -45deg,
        #1a0a14 0%,
        rgba(255, 20, 147, 0.4) 20%,
        rgba(255, 215, 0, 0.3) 40%,
        rgba(255, 107, 53, 0.3) 60%,
        rgba(255, 20, 147, 0.4) 80%,
        #1a0a14 100%
    );
    background-size: 600% 600%;

    animation:
        bannerSlideIn 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards,
        gradientShiftFast 8s ease-in-out infinite 0.6s;
}

/* Hidden state for scroll behavior */
body .discount-banner.banner-hidden {
    transform: translateY(-110%);
    animation: none;
    opacity: 0;
    pointer-events: none;
}

/* Confetti Canvas */
.confetti-canvas {
    z-index: 1;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

/* Banner Content Wrapper */
body .discount-banner-content {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Scrolling Message Container */
body .discount-banner-content,
body .discount-message-container {
    box-sizing: border-box;
    position: relative;
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 0;
}
body .discount-message-container {
    min-width: 100%;
    overflow: hidden;
}

.discount-message-scroll {
    display: flex;
    width: max-content;
    white-space: nowrap;
    animation: discountMessageScroll 80s linear infinite;
}

.discount-message-text {
    min-width: 200px;
    font-weight: 600;
    text-align: center;
}

.discount-message-text,
.discount-separator {
    display: inline-flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
}

.discount-separator {
    width: 40px;
    color: var(--off-white);
    font-weight: 300;
    font-size: 1.2em;
    opacity: 0.6;
}

/* Discount Buttons */
.discount-button {
    display: inline-flex;
    flex-shrink: 0;
    align-items: center;
    margin-left: 0.5rem;
    padding: 0.25rem 0.6rem;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 15px;
    font-weight: 600;
    font-size: 0.75rem;
    text-decoration: none;
    transition: all 0.3s ease;
}

.discount-button.shop-now {
    background: linear-gradient(45deg, #e71f7f, #ff69b4);
    color: white;
}

.discount-button.shop-now:hover {
    transform: translateY(-1px);
    background: linear-gradient(45deg, #ff1493, #ff8bc4);
    box-shadow: 0 2px 8px rgba(231, 31, 127, 0.4);
}

.discount-button.sale {
    background: linear-gradient(45deg, #b8d400, #d4e157);
    color: #000000;
}

.discount-button.sale:hover {
    transform: translateY(-1px);
    background: linear-gradient(45deg, #c6e226, #e0ee6e);
    box-shadow: 0 2px 8px rgba(184, 212, 0, 0.4);
}

.discount-banner:hover .discount-message-scroll {
    animation-play-state: paused;
}

/* Banner Hover Effect */
.discount-banner:hover {
    transform: translateY(-1px);
    box-shadow:
        0 8px 35px rgba(255, 20, 147, 0.25),
        0 0 20px rgba(255, 215, 0, 0.15),
        0 0 30px rgba(255, 105, 180, 0.1);
}

/* Gift Icon */
.discount-banner #discountIcon {
    color: var(--neon-pink);
    font-size: 1rem;
    animation:
        iconSparkle 15s ease-in-out infinite,
        iconBounce 2s ease-in-out infinite;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.discount-banner:hover #discountIcon {
    transform: scale(1.15) rotate(10deg);
}

/* Discount Code Text - Clickable */
.discount-banner .discount-code-text {
    display: inline-block;
    position: relative;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    background: linear-gradient(45deg, #ff1493, #ffd700, #ffa500, #ff1493);
    background-size: 300% 300%;
    background-clip: text;
    color: transparent;
    font-weight: 800;
    letter-spacing: 0.5px;
    animation:
        textGlow 8s ease-in-out infinite,
        gradientShift 12s ease-in-out infinite;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.discount-banner .discount-code-text::before {
    position: absolute;
    inset: 0;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.1);
    content: "";
    opacity: 0;
    transition: opacity 0.2s ease;
}

.discount-banner .discount-code-text:hover {
    transform: scale(1.05);
}

.discount-banner .discount-code-text:hover::before {
    opacity: 1;
}

.discount-banner .discount-code-text:active {
    transform: scale(0.95);
}

/* Copy Tooltip */
.copy-tooltip {
    visibility: hidden;
    z-index: 10;
    position: absolute;
    top: 100%;
    left: 50%;
    padding: 0.4rem 0.8rem;
    transform: translateX(-50%) translateY(5px);
    border-radius: 6px;
    background: rgba(25, 135, 84, 0.95);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    color: white;
    font-weight: 600;
    font-size: 0.75rem;
    white-space: nowrap;
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.copy-tooltip::before {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-bottom-color: rgba(25, 135, 84, 0.95);
    content: "";
}

.copy-tooltip.show {
    visibility: visible;
    transform: translateX(-50%) translateY(8px);
    opacity: 1;
}

/* Message Transition */
.discount-message-container {
    transition:
        opacity 0.3s ease,
        transform 0.3s ease;
}

.discount-message-container.fade-out {
    transform: translateY(-5px);
    opacity: 0;
}

/* Light mode styles */
:root.light-mode .discount-banner {
    border-bottom-color: rgba(0, 0, 0, 0.12);
    background: linear-gradient(
        -45deg,
        #f5f5f5 0%,
        rgba(255, 20, 147, 0.15) 30%,
        rgba(255, 215, 0, 0.15) 60%,
        #f5f5f5 100%
    );
    background-size: 400% 400%;
    box-shadow: 0 6px 30px rgba(0, 0, 0, 0.15);
    color: #000000;
}

:root.light-mode .discount-banner.high-value {
    background: linear-gradient(
        -45deg,
        #fff0f5 0%,
        rgba(255, 20, 147, 0.2) 20%,
        rgba(255, 215, 0, 0.2) 40%,
        rgba(255, 107, 53, 0.15) 60%,
        rgba(255, 20, 147, 0.2) 80%,
        #fff0f5 100%
    );
}

:root.light-mode .discount-banner #discountIcon {
    color: #e71f7f;
}

:root.light-mode .discount-banner .discount-code-text {
    background: none;
    background-clip: unset;
    color: #000000;
}

:root.light-mode .discount-button.shop-now {
    color: #ffffff;
}

:root.light-mode .discount-button.sale,
:root.light-mode .discount-close {
    color: #000000;
}

:root.light-mode .discount-close:hover {
    background-color: rgba(220, 53, 69, 0.4);
}

:root.light-mode .discount-cta {
    border-color: rgba(255, 255, 255, 0.4);
    background: rgba(0, 0, 0, 0.1);
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .discount-banner,
    .discount-banner.high-value,
    .discount-banner #discountIcon,
    .discount-banner .discount-code-text,
    .discount-countdown {
        animation: none;
    }
}

.discount-banner.reduced-motion,
.discount-banner.reduced-motion.high-value,
.discount-banner.reduced-motion #discountIcon,
.discount-banner.reduced-motion .discount-code-text,
.discount-banner.reduced-motion .discount-countdown {
    animation: none;
}

/* Dismiss animation */
body .discount-banner.slide-up {
    animation: slideUp 0.5s cubic-bezier(0.4, 0, 1, 1) forwards;
}

/* ============================================
   DISCOUNT BANNER KEYFRAME ANIMATIONS
   ============================================ */

/* Entry animation - slide in from top */
@keyframes bannerSlideIn {
    0% {
        transform: translateY(-100%);
        opacity: 0;
    }
    60% {
        transform: translateY(5%);
        opacity: 1;
    }
    100% {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Gradient shift */
@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

/* Faster gradient for high-value */
@keyframes gradientShiftFast {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

/* Banner glow */
@keyframes bannerGlow {
    0%,
    100% {
        box-shadow: 0 6px 30px rgba(0, 0, 0, 0.6);
    }
    50% {
        box-shadow:
            0 6px 35px rgba(255, 20, 147, 0.15),
            0 0 15px rgba(255, 105, 180, 0.05);
    }
}

/* Intense glow for high-value */
@keyframes bannerGlowIntense {
    0%,
    100% {
        box-shadow:
            0 6px 40px rgba(255, 20, 147, 0.4),
            0 0 20px rgba(255, 215, 0, 0.2);
    }
    50% {
        box-shadow:
            0 8px 50px rgba(255, 20, 147, 0.6),
            0 0 30px rgba(255, 215, 0, 0.4),
            0 0 40px rgba(255, 105, 180, 0.2);
    }
}

/* Icon sparkle */
@keyframes iconSparkle {
    0%,
    100% {
        transform: scale(1);
        color: #ff1493;
        filter: drop-shadow(0 0 3px rgba(255, 20, 147, 0.5));
    }
    25% {
        transform: scale(1.1);
        color: #ffd700;
        filter: drop-shadow(0 0 5px rgba(255, 215, 0, 0.5));
    }
    50% {
        transform: scale(1);
        color: #ffa500;
        filter: drop-shadow(0 0 3px rgba(255, 165, 0, 0.5));
    }
    75% {
        transform: scale(1.05);
        color: #ffd700;
        filter: drop-shadow(0 0 4px rgba(255, 215, 0, 0.5));
    }
}

/* Icon bounce */
@keyframes iconBounce {
    0%,
    100% {
        transform: translateY(0) scale(1);
    }
    50% {
        transform: translateY(-2px) scale(1.05);
    }
}

/* Text glow */
@keyframes textGlow {
    0%,
    100% {
        filter: brightness(1) drop-shadow(0 0 2px rgba(255, 20, 147, 0.3));
    }
    50% {
        filter: brightness(1.1) drop-shadow(0 0 5px rgba(255, 215, 0, 0.5));
    }
}

/* Countdown pulse */
@keyframes countdownPulse {
    0%,
    100% {
        opacity: 1;
    }
    50% {
        opacity: 0.8;
    }
}

/* Countdown urgent */
@keyframes countdownUrgent {
    0%,
    100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

/* Slide up dismiss */
@keyframes slideUp {
    0% {
        transform: translateY(0);
        opacity: 1;
    }
    100% {
        transform: translateY(-100%);
        opacity: 0;
    }
}

/* Confetti fall */
@keyframes confettiFall {
    0% {
        transform: translateY(-10px) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(100px) rotate(720deg);
        opacity: 0;
    }
}

/* Discount message scroll */
@keyframes discountMessageScroll {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-50%);
    }
}

/* Mobile Responsive - Discount Banner */
@media (max-width: 768px) {
    /* Compact layout for mobile */
    .discount-banner {
        z-index: 99998;
        right: 0;
        left: 0;
        flex-direction: column;
        min-width: 100%;
        min-height: auto;
        padding: 0.65rem 0;
        gap: 0.25rem;
        font-size: 0.8rem;
    }

    /* Banner content - full width on mobile */
    .discount-banner,
    body .discount-banner-content {
        box-sizing: border-box;
        align-items: center;
        justify-content: center;
        width: 100%;
        max-width: 100%;
        margin: 0;
    }
    body .discount-banner-content {
        display: flex;
        flex-wrap: nowrap;
        padding: 0;
        gap: 0.3rem;
    }

    /* Scrolling Message Container - Mobile */
    body .discount-message-container {
        box-sizing: border-box;
        flex: none;
        width: 100%;
        min-width: 100%;
        max-width: 100%;
        margin: 0;
        padding: 0;
    }

    .discount-message-scroll {
        animation-duration: 75s; /* Extremely slow on mobile for maximum readability */
    }

    .discount-message-text {
        min-width: 150px;
        font-size: 0.75rem;
    }

    .discount-separator {
        width: 30px;
        font-size: 1em;
    }

    .discount-button {
        margin-right: 0.3rem;
        padding: 0.2rem 0.5rem;
        font-size: 0.65rem;
    }

    /* Smaller gift icon */
    .discount-banner #discountIcon {
        flex-shrink: 0;
        font-size: 0.7rem;
    }

    /* Second line: countdown + CTA together */
    .discount-countdown {
        display: inline-flex;
        flex-shrink: 0;
        margin: 0;
        padding: 0.12rem 0.35rem;
        gap: 0.2rem;
        font-size: 0.6rem;
    }

    .discount-countdown i {
        font-size: 0.55rem;
    }

    /* CTA button - compact */
    .discount-cta {
        display: inline-flex;
        flex-shrink: 0;
        padding: 0.12rem 0.4rem;
        gap: 0.2rem;
        font-size: 0.6rem;
    }

    /* Progress dots - inline in row, right side */
    .discount-progress {
        display: flex;
        position: absolute;
        top: 50%;
        right: 1.5rem;
        align-items: center;
        margin: 0;
        gap: 0.2rem;
        transform: translateY(-50%);
    }

    .progress-dot {
        display: inline-block;
        width: 4px;
        height: 4px;
    }

    .discount-cycle {
        width: 14px;
        height: 14px;
        font-size: 0.5rem;
    }

    /* Close button - right side */
    .discount-close {
        top: 50%;
        right: 0.25rem;
        width: 16px;
        height: 16px;
        transform: translateY(-50%);
        font-size: 0.6rem;
    }

    /* Show confetti on mobile (reduced) */
    .confetti-canvas {
        display: block;
        opacity: 0.4;
    }

    /* Copy tooltip positioning on mobile */
    .copy-tooltip {
        padding: 0.2rem 0.4rem;
        font-size: 0.55rem;
    }
}

/* Very small screens */
@media (max-width: 400px) {
    .discount-banner {
        padding: 0.55rem 1.3rem 0.55rem 0.4rem;
        gap: 0.2rem;
        font-size: 0.7rem;
    }

    .discount-message-container {
        max-width: calc(100% - 5rem);
    }

    .discount-message-text {
        font-size: 0.65rem;
    }

    .discount-banner #discountIcon {
        font-size: 0.6rem;
    }
}
