/* Flash Sale Animations and Styles */
@keyframes pulse {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.2); opacity: 0.8; }
    100% { transform: scale(1); opacity: 1; }
}

@keyframes shine {
    0% { background-position: -100% 0; }
    100% { background-position: 200% 0; }
}

@keyframes bounce {
    0%, 100% { transform: rotate(45deg) scale(1); }
    50% { transform: rotate(45deg) scale(1.1); }
}

@keyframes glowing {
    0% { box-shadow: 0 0 5px #ff4800, 0 0 10px #ff4800, 0 0 15px #ff6634; }
    50% { box-shadow: 0 0 20px #ff4800, 0 0 25px #ff4800, 0 0 30px #ff6634; }
    100% { box-shadow: 0 0 5px #ff4800, 0 0 10px #ff4800, 0 0 15px #ff6634; }
}

/* Flash Sale Icon */
.flash-icon {
    animation: pulse 1.5s infinite ease-in-out;
}

/* Flash Sale Title */
.flash-title {
    background: linear-gradient(90deg, #FFB800 0%, #FF8A00 25%, #ff6600 50%, #FF8A00 75%, #FFB800 100%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent !important;
    font-weight: bold;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    animation: colorShift 2s ease infinite;
}

@keyframes colorShift {
    0% { 
        background-position: 0% center;
        transform: scale(1);
    }
    50% {
        background-position: 100% center;
        transform: scale(1.05);
    }
    100% {
        background-position: 0% center;
        transform: scale(1);
    }
}

/* Flash Sale Badge */
.flash-badge {
    position: relative;
    overflow: hidden;
    animation: badgePop 0.6s ease-out forwards, badgeFloat 3s ease-in-out infinite;
    transform-origin: center;
    border: 2px solid rgba(255, 255, 255, 0.2);
    box-shadow: 
        0 4px 12px rgba(0, 0, 0, 0.15),
        inset 0 2px 4px rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(4px);
    background: linear-gradient(135deg, #ff6b00, #ff4d00);
    transition: all 0.3s ease;
    border-radius: 50%;
    animation: badgePulsate 2s ease-in-out infinite;
}

.flash-badge:hover {
    transform: translateY(-2px);
    box-shadow: 
        0 6px 16px rgba(0, 0, 0, 0.2),
        inset 0 2px 4px rgba(255, 255, 255, 0.4);
}

.flash-badge-content {
    position: relative;
    z-index: 1;
}

@keyframes badgePop {
    0% { transform: scale(0.8); opacity: 0; }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}

@keyframes badgeFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-4px); }
}

.flash-badge::before {
    content: "";
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        to bottom right,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.1) 50%,
        rgba(255, 255, 255, 0) 100%
    );
    transform: rotate(45deg);
    animation: shine 2s infinite linear;
}

.flash-badge::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.3),
        transparent
    );
    animation: shimmer 2s infinite;
}

/* Add shine effect */
.flash-badge::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        45deg,
        transparent 0%,
        rgba(255, 255, 255, 0.1) 30%,
        rgba(255, 255, 255, 0.2) 50%,
        rgba(255, 255, 255, 0.1) 70%,
        transparent 100%
    );
    transform: rotate(45deg);
    animation: shineEffect 3s infinite;
    pointer-events: none;
}

@keyframes shineEffect {
    0% { transform: translateX(-100%) rotate(45deg); }
    80%, 100% { transform: translateX(100%) rotate(45deg); }
}

/* Percentage OFF Animation */
@keyframes rotateGlow {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes pulseScale {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

@keyframes glowingBorder {
    0% { border-color: #5C705D; }
    50% { border-color: #7B927C; }
    100% { border-color: #5C705D; }
}

.percent-off {
    position: relative;
    animation: textPulse 2s ease-in-out infinite;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    font-weight: bold;
    letter-spacing: 0.5px;
    transform: translateZ(0);
    animation: float 3s ease-in-out infinite;
}

@keyframes textPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.percent-off-container {
    animation: glowingBorder 2s infinite ease-in-out;
}

/* Ring Glow Effect */
.percent-off-ring {
    position: relative;
}

.percent-off-ring::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, #ff6b6b, #ffd93d);
    border-radius: 50%;
    z-index: -1;
    animation: rotateGlow 3s linear infinite;
}

/* Product Card */
.flash-product {
    transition: all 0.3s ease;
}

.flash-product:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.2);
}

/* Flash Sale Timer */
.countdown-text {
    color: white;
    font-weight: 600;
}

.countdown {
    color: white;
    font-weight: bold;
    padding: 0 4px;
}

/* Save Amount Text */

@keyframes fadeSlideUp {
    0% { 
        transform: translateY(5px);
        opacity: 0;
    }
    100% { 
        transform: translateY(0);
        opacity: 0.9;
    }
}

@keyframes saveFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-2px); }
}

/* Flash Sale Badge Animations */
@keyframes badgePulsate {
    0% { transform: scale(1); }
    50% { transform: scale(1.02); }
    100% { transform: scale(1); }
}

@keyframes shimmer {
    0% { transform: translateX(-100%) skewX(-15deg); }
    100% { transform: translateX(100%) skewX(-15deg); }
}

.percent-off {
    transform: translateZ(0);
    animation: float 3s ease-in-out infinite;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.save-amount {
    animation: fadeIn 0.5s ease-out forwards;
    opacity: 0;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-2px); }
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 0.9; transform: translateY(0); }
}

/* Stock warning animation */
.stock-warning {
    animation: blink 1s ease-in-out infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Glassmorphism effect for container */
.flashsale-container {
    background: rgba(40, 41, 45, 0.85);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
}

/* Improved Timer Styles */
.fs-countdown {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
    padding: 8px 16px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.18);
}

.time-group {
    background: linear-gradient(145deg, #ff6b00, #ff4d00);
    padding: 4px 8px;
    border-radius: 8px;
    margin: 0 4px;
    min-width: 50px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(255, 107, 0, 0.2);
    transition: transform 0.3s ease;
}

.time-group:hover {
    transform: translateY(-2px);
}

.time {
    font-size: 1.2rem;
    font-weight: bold;
    color: #ffffff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.time-label {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.9);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.separator {
    color: #ff6b00;
    font-weight: bold;
    font-size: 1.2rem;
    margin: 0 2px;
    animation: blink 1s infinite;
}

/* Flashsale End Date Styling */
.flashsale-end-date {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.8);
    margin-top: 8px;
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.flashsale-end-date:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-1px);
}

.flashsale-end-date svg {
    color: #ff6b00;
}

/* Product Card Hover Effects */
.product-card {
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    overflow: hidden;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    border-color: rgba(255, 107, 0, 0.3);
}

/* Price Tag Styling */
.price-tag {
    background: linear-gradient(135deg, #ff6b00, #ff4d00);
    padding: 4px 12px;
    border-radius: 20px;
    color: white;
    font-weight: bold;
    box-shadow: 0 4px 15px rgba(255, 107, 0, 0.2);
    position: relative;
    overflow: hidden;
}

.price-tag::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        to right,
        transparent,
        rgba(255, 255, 255, 0.3),
        transparent
    );
    transform: rotate(45deg);
    animation: shine 3s infinite;
}

/* Stock Indicator */
.stock-indicator {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.8);
}

.stock-indicator.low {
    background: rgba(255, 71, 71, 0.2);
    color: #ff4747;
    animation: pulse 2s infinite;
}

/* Title and Description */
.flashsale-title {
    font-size: 1.8rem;
    font-weight: bold;
    background: linear-gradient(135deg, #ff6b00, #ff4d00);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
    margin-bottom: 0.5rem;
}

.flashsale-description {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
    line-height: 1.5;
    margin-bottom: 1rem;
}

/* Button Styling */
.buy-button {
    background: linear-gradient(135deg, #ff6b00, #ff4d00);
    color: white;
    padding: 8px 16px;
    border-radius: 8px;
    font-weight: bold;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.buy-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 107, 0, 0.3);
}

.buy-button::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        to right,
        transparent,
        rgba(255, 255, 255, 0.3),
        transparent
    );
    transform: rotate(45deg);
    animation: shine 3s infinite;
}
