/* Frontend styles for WooCommerce Discount Campaigns */

/* Discount info on single product page */
.wdc-discount-info {
    margin: 15px 0;
    padding: 15px;
    background: linear-gradient(135deg, #e8f5e8, #f1f8e9);
    border: 1px solid #c8e6c9;
    border-radius: 8px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.wdc-discount-info::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #4caf50, #8bc34a);
}

.wdc-discount-badge {
    display: inline-block;
    background: #4caf50;
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 16px;
    margin-bottom: 8px;
    box-shadow: 0 2px 4px rgba(76, 175, 80, 0.3);
}

.wdc-campaign-name {
    color: #2e7d32;
    font-size: 14px;
    font-weight: 500;
    margin-top: 5px;
}

/* Discount info on shop page */
.wdc-discount-info-shop {
    position: relative;
    margin-bottom: 10px;
}

.wdc-discount-badge-shop {
    display: inline-block;
    background: #ff5722;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-weight: 600;
    font-size: 12px;
    position: absolute;
    top: -5px;
    right: -5px;
    z-index: 10;
    box-shadow: 0 2px 4px rgba(255, 87, 34, 0.4);
    animation: wdc-pulse 2s infinite;
}

@keyframes wdc-pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* Product price modifications */
.wdc-original-price {
    text-decoration: line-through;
    color: #999;
    font-size: 0.9em;
    margin-right: 5px;
}

.wdc-discounted-price {
    color: #d32f2f;
    font-weight: 600;
}

/* Discount savings display */
.wdc-savings {
    color: #4caf50;
    font-weight: 600;
    font-size: 0.9em;
    margin-left: 10px;
}

.wdc-savings::before {
    content: '(Tiết kiệm ';
}

.wdc-savings::after {
    content: ')';
}

/* Cart and checkout discount info */
.wdc-cart-discount-info {
    background: #e8f5e8;
    border: 1px solid #c8e6c9;
    border-radius: 4px;
    padding: 10px;
    margin: 10px 0;
    font-size: 14px;
    color: #2e7d32;
}

.wdc-cart-discount-info .wdc-icon {
    display: inline-block;
    width: 16px;
    height: 16px;
    background: #4caf50;
    border-radius: 50%;
    margin-right: 8px;
    position: relative;
}

.wdc-cart-discount-info .wdc-icon::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 10px;
    font-weight: bold;
}

/* Responsive design */
@media (max-width: 768px) {
    .wdc-discount-info {
        margin: 10px 0;
        padding: 12px;
    }
    
    .wdc-discount-badge {
        padding: 6px 12px;
        font-size: 14px;
    }
    
    .wdc-discount-badge-shop {
        padding: 3px 6px;
        font-size: 11px;
        top: -3px;
        right: -3px;
    }
    
    .wdc-campaign-name {
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .wdc-discount-info {
        margin: 8px 0;
        padding: 10px;
    }
    
    .wdc-discount-badge {
        padding: 5px 10px;
        font-size: 13px;
    }
    
    .wdc-campaign-name {
        font-size: 12px;
    }
}

/* Integration with popular themes */

/* Storefront theme compatibility */
.storefront .wdc-discount-info {
    margin: 15px 0 20px;
}

.storefront .wdc-discount-badge-shop {
    top: 10px;
    right: 10px;
}

/* Astra theme compatibility */
.astra-shop-thumbnail-wrap .wdc-discount-badge-shop {
    top: 10px;
    right: 10px;
}

/* OceanWP theme compatibility */
.oceanwp-thumbnail .wdc-discount-badge-shop {
    top: 10px;
    right: 10px;
}

/* GeneratePress theme compatibility */
.generate-product-image .wdc-discount-badge-shop {
    top: 10px;
    right: 10px;
}

/* Hover effects */
.wdc-discount-info:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.wdc-discount-badge:hover {
    transform: scale(1.05);
    transition: transform 0.2s ease;
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .wdc-discount-info {
        background: linear-gradient(135deg, #1b5e20, #2e7d32);
        border-color: #4caf50;
        color: #e8f5e8;
    }
    
    .wdc-campaign-name {
        color: #c8e6c9;
    }
    
    .wdc-cart-discount-info {
        background: #1b5e20;
        border-color: #4caf50;
        color: #e8f5e8;
    }
}

/* Print styles */
@media print {
    .wdc-discount-badge-shop,
    .wdc-discount-info {
        background: white !important;
        color: black !important;
        border: 1px solid black !important;
    }
    
    .wdc-discount-badge {
        background: white !important;
        color: black !important;
        border: 1px solid black !important;
    }
}

/* Accessibility improvements */
.wdc-discount-badge:focus,
.wdc-discount-info:focus {
    outline: 2px solid #2196f3;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .wdc-discount-info {
        background: white;
        border: 2px solid black;
        color: black;
    }
    
    .wdc-discount-badge {
        background: black;
        color: white;
        border: 2px solid black;
    }
    
    .wdc-discount-badge-shop {
        background: black;
        color: white;
        border: 1px solid white;
    }
}