/**
 * Scarcity Boost - Frontend Styles
 * Plugin de urgencia y escasez
 */

/* Variables CSS */
:root {
    --scarcity-primary: #e74c3c;
    --scarcity-text: #333333;
    --scarcity-stock-bar: #e74c3c;
    --scarcity-bg: #fff5f5;
    --scarcity-border: #ffcccc;
    --scarcity-shadow: rgba(231, 76, 60, 0.1);
}

/* ==================== 
   Stock Counter
   ==================== */
.scarcity-stock-wrapper {
    background: linear-gradient(135deg, var(--scarcity-bg) 0%, #ffffff 100%);
    border: 1px solid var(--scarcity-border);
    border-left: 4px solid var(--scarcity-primary);
    border-radius: 8px;
    padding: 15px 18px;
    margin: 15px 0;
    box-shadow: 0 2px 10px var(--scarcity-shadow);
}

.scarcity-stock-message {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    font-weight: 600;
    color: var(--scarcity-text);
    font-size: 14px;
}

.scarcity-stock-message .scarcity-icon {
    font-size: 18px;
}

.scarcity-stock-bar {
    height: 8px;
    background: #eee;
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}

.scarcity-stock-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--scarcity-stock-bar) 0%, #ff6b6b 100%);
    border-radius: 10px;
    transition: width 0.5s ease;
    position: relative;
}

.scarcity-stock-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    animation: shimmer 2s infinite;
}

/* ==================== 
   Visitors Counter
   ==================== */
.scarcity-visitors-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: #f8f9fa;
    border-radius: 8px;
    margin: 12px 0;
    font-size: 14px;
    color: #555;
}

.scarcity-pulse-dot {
    width: 10px;
    height: 10px;
    background: #28a745;
    border-radius: 50%;
    position: relative;
    flex-shrink: 0;
}

.scarcity-pulse-dot::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    background: #28a745;
    border-radius: 50%;
    animation: pulse 2s ease-out infinite;
}

.scarcity-visitors-text {
    font-weight: 500;
}

/* ==================== 
   Countdown Timer
   ==================== */
.scarcity-timer-wrapper {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    border-radius: 12px;
    padding: 20px;
    margin: 15px 0;
    text-align: center;
    color: #fff;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.scarcity-timer-message {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 15px;
    font-size: 15px;
    font-weight: 500;
    opacity: 0.9;
}

.scarcity-timer-display {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.scarcity-timer-unit {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 60px;
}

.scarcity-timer-value {
    font-size: 32px;
    font-weight: 700;
    font-family: 'SF Mono', 'Monaco', 'Consolas', monospace;
    background: rgba(255,255,255,0.15);
    padding: 8px 12px;
    border-radius: 8px;
    min-width: 50px;
    display: inline-block;
}

.scarcity-timer-label {
    font-size: 11px;
    text-transform: uppercase;
    opacity: 0.7;
    margin-top: 5px;
    letter-spacing: 0.5px;
}

.scarcity-timer-separator {
    font-size: 28px;
    font-weight: 300;
    opacity: 0.6;
    padding-bottom: 20px;
}

/* ==================== 
   Urgency Message
   ==================== */
.scarcity-message {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 18px;
    border-radius: 8px;
    margin: 12px 0;
    font-weight: 600;
    font-size: 14px;
}

.scarcity-message-default {
    background: linear-gradient(135deg, #fff5f5 0%, #ffe0e0 100%);
    border: 1px solid #ffcccc;
    color: #c0392b;
}

.scarcity-message-warning {
    background: linear-gradient(135deg, #fff8e1 0%, #ffecb3 100%);
    border: 1px solid #ffd54f;
    color: #f57c00;
}

.scarcity-message-success {
    background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
    border: 1px solid #a5d6a7;
    color: #2e7d32;
}

.scarcity-message-info {
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    border: 1px solid #90caf9;
    color: #1565c0;
}

/* ==================== 
   Badge (Shop Loop)
   ==================== */
.scarcity-badge {
    display: inline-block;
    background: linear-gradient(135deg, var(--scarcity-primary) 0%, #c0392b 100%);
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 20px;
    margin-top: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ==================== 
   Animations
   ==================== */
@keyframes pulse {
    0% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) scale(2.5);
        opacity: 0;
    }
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-2px); }
    20%, 40%, 60%, 80% { transform: translateX(2px); }
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-5px); }
    60% { transform: translateY(-3px); }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Clases de animación */
.scarcity-animated {
    animation: fadeInUp 0.5s ease forwards;
}

.scarcity-animated .scarcity-icon {
    animation: bounce 2s ease infinite;
}

.scarcity-shake {
    animation: shake 0.5s ease;
}

/* Timer urgente (menos de 1 hora) */
.scarcity-timer-urgent .scarcity-timer-value {
    background: rgba(231, 76, 60, 0.3);
    animation: pulse-bg 1s ease infinite;
}

@keyframes pulse-bg {
    0%, 100% { background: rgba(231, 76, 60, 0.3); }
    50% { background: rgba(231, 76, 60, 0.5); }
}

/* ==================== 
   Responsive
   ==================== */
@media (max-width: 768px) {
    .scarcity-timer-value {
        font-size: 24px;
        padding: 6px 10px;
        min-width: 40px;
    }
    
    .scarcity-timer-unit {
        min-width: 50px;
    }
    
    .scarcity-timer-separator {
        font-size: 22px;
        padding-bottom: 15px;
    }
    
    .scarcity-timer-label {
        font-size: 10px;
    }
    
    .scarcity-stock-wrapper,
    .scarcity-timer-wrapper,
    .scarcity-visitors-wrapper,
    .scarcity-message {
        margin: 10px 0;
    }
}

@media (max-width: 480px) {
    .scarcity-timer-display {
        gap: 2px;
    }
    
    .scarcity-timer-value {
        font-size: 20px;
        padding: 5px 8px;
        min-width: 35px;
    }
    
    .scarcity-timer-unit {
        min-width: 40px;
    }
    
    .scarcity-timer-separator {
        font-size: 18px;
    }
}

/* ==================== 
   Dark Mode Support
   ==================== */
@media (prefers-color-scheme: dark) {
    .scarcity-stock-wrapper {
        background: linear-gradient(135deg, #2d2d2d 0%, #1a1a1a 100%);
        border-color: #444;
    }
    
    .scarcity-visitors-wrapper {
        background: #2d2d2d;
        color: #ccc;
    }
    
    .scarcity-stock-bar {
        background: #444;
    }
}

/* ==================== 
   Print Styles
   ==================== */
@media print {
    .scarcity-stock-wrapper,
    .scarcity-timer-wrapper,
    .scarcity-visitors-wrapper,
    .scarcity-message,
    .scarcity-badge {
        display: none !important;
    }
}
