/**
 * Estilos frontend do plugin BCOA - Horário de Corte
 * 
 * @package BCOA
 * @since 2.0.0
 */

/* Widget principal do horário de corte */
.bcoa-cutoff-widget {
    background-color: #fff1e0;
    color: #6d594b;
    padding: 10px;
    border-radius: 5px;
    margin: 20px 0;
    text-align: center;
    position: relative;
    overflow: hidden;
    border: none;
    backdrop-filter: blur(10px);
    border-left: 3px solid #f3d2b5;
}

/* Efeito shimmer animado */
.bcoa-cutoff-widget::before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    animation: bcoa-shimmer 4s infinite;
    pointer-events: none;
}

@keyframes bcoa-shimmer {
    0% { 
        left: -100%; 
    }
    50% { 
        left: 100%; 
    }
    100% { 
        left: 100%; 
    }
}

/* Container da mensagem */
.bcoa-cutoff-message {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    font-size: 18px;
    font-weight: 600;
    position: relative;
    z-index: 2;
    line-height: 1.2;
    text-align: left;
}

/* Ícones */
.bcoa-cutoff-icon {
    font-size: 20px;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
    animation: bcoa-pulse 2s infinite;
}

@keyframes bcoa-pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

/* Texto da mensagem */
.bcoa-cutoff-text {
    flex: 1;
}

/* Contador regressivo */
.bcoa-countdown {    
    font-family: 'Courier New', Monaco, monospace;
    font-size: 20px;
    font-weight: bold;
    letter-spacing: 2px;
    border: none;
    display: inline-block;
    min-width: 120px;
    animation: bcoa-countdown-glow 2s infinite alternate;
    text-align: center;
}

@keyframes bcoa-countdown-glow {
    from {
        box-shadow: 0 0 5px rgba(255,255,255,0.3);
    }
    to {
        box-shadow: 0 0 15px rgba(255,255,255,0.5), 0 0 25px rgba(255,255,255,0.2);
    }
}

/* Estados específicos */
.bcoa-same-day {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
}

.bcoa-same-day .bcoa-cutoff-icon {
    color: #fff;
}

.bcoa-next-day {
    background: linear-gradient(135deg, #6c757d 0%, #495057 100%);
    opacity: 0.95;
}

.bcoa-next-day .bcoa-cutoff-icon {
    animation: none;
    opacity: 0.8;
}

/* Variantes por posição */

/* Na página do produto */
.single-product .bcoa-cutoff-widget {
    margin: 15px 0;
    padding: 10px;
    font-size: 19px;
}

.single-product .bcoa-cutoff-message {
    font-size: 18px;
}

/* .single-product .bcoa-countdown {
    font-size: 20px;
    padding: 3px 10px;
} */

/* No checkout */
.woocommerce-checkout .bcoa-cutoff-widget {
    margin: 0 0 25px 0;
    border-radius: 8px;
    padding: 20px;
}

.woocommerce-checkout .bcoa-cutoff-message {
    font-size: 16px;
}

.woocommerce-checkout .bcoa-countdown {
    font-size: 18px;
}

/* Responsividade */
@media (max-width: 768px) {
    .bcoa-cutoff-widget {
        padding: 18px;
        margin: 15px 0;
    }
    
    .bcoa-cutoff-message {
        flex-direction: column;
        gap: 12px;
        font-size: 16px;
    }
    
    .bcoa-cutoff-icon {
        font-size: 20px;
    }
    
    .bcoa-countdown {
        font-size: 18px;
        padding: 8px 14px;
        min-width: 100px;
    }
    
    .single-product .bcoa-cutoff-widget {
        padding: 5px;
        font-size: 17px;
    }
    
    .single-product .bcoa-cutoff-message {
        font-size: 17px;
    }
    
    .single-product .bcoa-countdown {
        font-size: 20px;
    }
}

@media (max-width: 480px) {
    .bcoa-cutoff-widget {
        padding: 15px;
        border-radius: 10px;
    }
    
    .bcoa-cutoff-message {
        font-size: 15px;
        gap: 10px;
    }
    
    .bcoa-cutoff-icon {
        font-size: 20px;
    }
    
    .bcoa-countdown {
        font-size: 16px;
        letter-spacing: 1px;
    }
}

/* Estados de loading/erro */
.bcoa-cutoff-widget.loading {
    opacity: 0.7;
    pointer-events: none;
}

.bcoa-cutoff-widget.error {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
}

.bcoa-cutoff-widget.error .bcoa-cutoff-icon::before {
    content: "⚠️";
}

/* Animação de entrada */
.bcoa-cutoff-widget {
    animation: bcoa-slideInUp 0.6s ease-out;
}

@keyframes bcoa-slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Efeitos hover para desktop */
@media (hover: hover) {
    .bcoa-cutoff-widget:hover {
        transform: translateY(-2px);
        transition: all 0.3s ease;
    }
    
    .bcoa-cutoff-widget:hover .bcoa-countdown {
        transform: scale(1.05);
        transition: transform 0.3s ease;
    }
}

/* Acessibilidade */
.bcoa-cutoff-widget[role="alert"] {
    /* Para leitores de tela */
}

@media (prefers-reduced-motion: reduce) {
    .bcoa-cutoff-widget::before,
    .bcoa-cutoff-icon,
    .bcoa-countdown {
        animation: none;
    }
    
    .bcoa-cutoff-widget {
        animation: none;
        opacity: 1;
        transform: none;
    }
}


/* Integração com temas populares */

/* Storefront */
.storefront .bcoa-cutoff-widget {
    font-family: inherit;
}

/* Astra */
.ast-theme .bcoa-cutoff-widget {
    font-family: inherit;
}

/* OceanWP */
.oceanwp-theme .bcoa-cutoff-widget {
    font-family: inherit;
}

/* Flatsome */
.flatsome-theme .bcoa-cutoff-widget {
    margin: 20px 0;
}

/* Customizações para plugins populares */

/* Elementor */
.elementor-widget-woocommerce-product-add-to-cart .bcoa-cutoff-widget {
    margin-top: 20px;
}

/* Divi */
.et_pb_module .bcoa-cutoff-widget {
    margin: 20px 0;
}

/* Beaver Builder */
.fl-node-content .bcoa-cutoff-widget {
    margin: 20px 0;
}

/* Estados especiais */

/* Urgência (menos de 1 hora) */
.bcoa-cutoff-widget.bcoa-urgent {
    background: linear-gradient(135deg, #ff6b35 0%, #f7931e 100%);
    animation: bcoa-urgent-pulse 1s infinite alternate;
}

@keyframes bcoa-urgent-pulse {
    from {
        box-shadow: 0 4px 20px rgba(255, 107, 53, 0.4);
    }
    to {
        box-shadow: 0 4px 20px rgba(255, 107, 53, 0.8), 0 0 30px rgba(255, 107, 53, 0.3);
    }
}

/* Crítico (menos de 30 minutos) */
.bcoa-cutoff-widget.bcoa-critical {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    animation: bcoa-critical-blink 0.5s infinite alternate;
}

@keyframes bcoa-critical-blink {
    from {
        opacity: 1;
    }
    to {
        opacity: 0.8;
    }
}

/* Print styles */
@media print {
    .bcoa-cutoff-widget {
        background: #f8f9fa !important;
        color: #333 !important;
        border: 2px solid #667eea;
        box-shadow: none;
    }
    
    .bcoa-cutoff-widget::before {
        display: none;
    }
    
    .bcoa-countdown {
        background: #e9ecef !important;
        color: #333 !important;
    }
}
