/**
 * PIX Discount Universal - Frontend Styles
 */

/* PIX Discount Info Banner */
.pix-discount-info {
    margin: 0 0 20px 0;
    padding: 0;
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.3s ease-out;
}

.pix-discount-info.active {
    opacity: 1;
    transform: translateY(0);
}

.pix-discount-banner {
    background: linear-gradient(135deg, #32d583 0%, #1ba85c 100%);
    color: white;
    padding: 16px 20px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    box-shadow: 0 4px 12px rgba(50, 213, 131, 0.25);
    position: relative;
    overflow: hidden;
}

.pix-discount-banner::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, rgba(255,255,255,0.1) 25%, transparent 25%), 
                linear-gradient(-45deg, rgba(255,255,255,0.1) 25%, transparent 25%), 
                linear-gradient(45deg, transparent 75%, rgba(255,255,255,0.1) 75%), 
                linear-gradient(-45deg, transparent 75%, rgba(255,255,255,0.1) 75%);
    background-size: 20px 20px;
    animation: movePattern 20s linear infinite;
    opacity: 0.3;
    pointer-events: none;
}

@keyframes movePattern {
    0% { background-position: 0 0, 0 0, 10px 10px, 10px 10px; }
    100% { background-position: 20px 20px, -20px 20px, 30px 30px, -10px 30px; }
}

.pix-icon {
    font-size: 28px;
    margin-right: 15px;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
    animation: pulse 2s ease-in-out infinite;
}

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

.pix-discount-text {
    flex: 1;
}

.pix-discount-text strong {
    display: block;
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 4px;
    text-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.pix-discount-text p {
    margin: 0;
    font-size: 14px;
    opacity: 0.95;
    font-weight: 500;
}

/* Notification Messages */
#pix-discount-notices {
    margin-bottom: 20px;
}

#pix-discount-notices .woocommerce-info,
#pix-discount-notices .woocommerce-message,
#pix-discount-notices .woocommerce-error {
    margin: 0 0 10px 0;
    border-radius: 6px;
    font-weight: 500;
}

.pix-discount-processing {
    background-color: #e7f3ff;
    border-left-color: #0073aa;
    color: #0073aa;
    position: relative;
}

.pix-discount-processing::before {
    content: "";
    display: inline-block;
    width: 16px;
    height: 16px;
    margin-right: 8px;
    border: 2px solid #0073aa;
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    vertical-align: middle;
}

.pix-discount-success {
    background-color: #d4edda;
    border-left-color: #28a745;
    color: #155724;
}

.pix-discount-success::before {
    content: "✅";
    margin-right: 8px;
}

.pix-discount-error {
    background-color: #f8d7da;
    border-left-color: #dc3545;
    color: #721c24;
}

.pix-discount-error::before {
    content: "⚠️";
    margin-right: 8px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Payment Methods Enhancement */
.wc_payment_methods {
    position: relative;
}

.wc_payment_method input[type="radio"] {
    transition: all 0.2s ease;
}

/* PIX Method Highlight */
.wc_payment_method.pix-method {
    position: relative;
}

.wc_payment_method.pix-method.selected {
    background: linear-gradient(90deg, rgba(50, 213, 131, 0.1) 0%, transparent 100%);
    border-radius: 6px;
    border-left: 4px solid #32d583;
    padding-left: 16px;
    margin-left: -20px;
    padding-right: 20px;
}

.wc_payment_method.pix-method.selected::after {
    content: "💸 Desconto aplicado!";
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: #32d583;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-50%) translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateY(-50%) translateX(0);
    }
}

/* Mobile Responsive */
@media screen and (max-width: 768px) {
    .pix-discount-banner {
        padding: 14px 16px;
        flex-direction: column;
        text-align: center;
    }
    
    .pix-icon {
        margin: 0 0 10px 0;
        font-size: 32px;
    }
    
    .pix-discount-text strong {
        font-size: 15px;
    }
    
    .pix-discount-text p {
        font-size: 13px;
    }
    
    .wc_payment_method.pix-method.selected {
        margin-left: -10px;
        padding-left: 14px;
        padding-right: 10px;
    }
    
    .wc_payment_method.pix-method.selected::after {
        position: static;
        display: block;
        margin-top: 8px;
        transform: none;
        font-size: 11px;
        text-align: center;
    }
}

/* High DPI Displays */
@media screen and (-webkit-min-device-pixel-ratio: 2), 
       screen and (min-resolution: 192dpi) {
    .pix-discount-banner {
        box-shadow: 0 2px 8px rgba(50, 213, 131, 0.3);
    }
}

/* Dark Theme Support */
@media (prefers-color-scheme: dark) {
    .pix-discount-info {
        filter: brightness(0.9);
    }
    
    .pix-discount-banner {
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    }
}

/* Print Styles */
@media print {
    .pix-discount-info {
        display: none !important;
    }
    
    #pix-discount-notices {
        display: none !important;
    }
}

/* Accessibility Enhancements */
.pix-discount-banner {
    outline: none;
}

.pix-discount-banner:focus-within {
    box-shadow: 0 4px 12px rgba(50, 213, 131, 0.4), 0 0 0 3px rgba(50, 213, 131, 0.3);
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    .pix-discount-info,
    .pix-discount-banner::before,
    .pix-icon,
    .pix-discount-processing::before {
        animation: none !important;
        transition: none !important;
    }
    
    .pix-discount-info.active {
        transform: none;
    }
}