/* Frontend Styles for Category Second Discount Plugin */

/* Discount Notice on Product Page */
.csd-discount-notice {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    border-radius: 8px;
    margin: 20px 0;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    animation: slideInFromTop 0.5s ease-out;
}

.csd-notice-content {
    display: flex;
    align-items: center;
    gap: 15px;
}

.csd-icon {
    font-size: 24px;
    min-width: 30px;
}

.csd-text {
    flex: 1;
}

.csd-text strong {
    font-size: 18px;
    display: block;
    margin-bottom: 5px;
}

.csd-text p {
    margin: 0;
    opacity: 0.9;
    font-size: 14px;
    line-height: 1.4;
}

/* Category Info Messages */
.csd-category-info {
    padding: 15px 20px;
    border-radius: 6px;
    margin: 15px 0;
    font-weight: 500;
    text-align: center;
    animation: fadeInUp 0.4s ease-out;
}

.csd-category-info.first-product {
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
    border: none;
}

.csd-category-info.second-product {
    background: linear-gradient(135deg, #ffc107, #fd7e14);
    color: #212529;
    border: none;
}

.csd-category-info.no-discount {
    background: #f8f9fa;
    color: #6c757d;
    border: 1px solid #dee2e6;
}

.csd-category-info p {
    margin: 0;
    font-size: 15px;
}

/* Cart Discount Display */
.csd-cart-discount {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
    padding: 15px;
    border-radius: 6px;
    margin: 15px 0;
}

.csd-cart-discount .csd-discount-title {
    font-weight: bold;
    font-size: 16px;
    margin-bottom: 5px;
}

.csd-cart-discount .csd-discount-amount {
    font-size: 18px;
    color: #28a745;
    font-weight: bold;
}

/* Shopping Cart Page Enhancements */
.woocommerce-cart .csd-discount-summary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    border-radius: 8px;
    margin: 20px 0;
    text-align: center;
}

.csd-discount-summary h4 {
    margin: 0 0 10px 0;
    color: white;
    font-size: 18px;
}

.csd-discount-summary .csd-savings {
    font-size: 24px;
    font-weight: bold;
    margin: 10px 0;
}

/* Product Archive/Shop Badges */
.csd-product-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 12px;
    font-weight: bold;
    z-index: 10;
    animation: pulse 2s infinite;
}

/* Responsive Design */
@media (max-width: 768px) {
    .csd-discount-notice {
        padding: 15px;
        margin: 15px 0;
    }
    
    .csd-notice-content {
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }
    
    .csd-text strong {
        font-size: 16px;
    }
    
    .csd-category-info {
        padding: 12px 15px;
        margin: 12px 0;
    }
    
    .csd-category-info p {
        font-size: 14px;
    }
}

/* Animations */
@keyframes slideInFromTop {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

/* Loading States */
.csd-loading {
    opacity: 0.6;
    pointer-events: none;
    position: relative;
}

.csd-loading::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Success Messages */
.csd-success-message {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
    padding: 12px 20px;
    border-radius: 4px;
    margin: 15px 0;
    text-align: center;
}

/* Error Messages */
.csd-error-message {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
    padding: 12px 20px;
    border-radius: 4px;
    margin: 15px 0;
    text-align: center;
}

/* Mini Cart Widget */
.widget_shopping_cart .csd-mini-discount {
    background: #e8f5e8;
    padding: 10px;
    margin: 10px 0;
    border-radius: 4px;
    font-size: 12px;
    text-align: center;
    color: #28a745;
}

/* Checkout Page */
.woocommerce-checkout .csd-checkout-notice {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    color: #856404;
    padding: 15px;
    border-radius: 6px;
    margin: 15px 0;
}

/* Price Display Enhancements */
.csd-original-price {
    text-decoration: line-through;
    color: #999;
    font-size: 0.9em;
    margin-left: 10px;
}

.csd-discount-price {
    color: #28a745;
    font-weight: bold;
}

.csd-you-save {
    background: #28a745;
    color: white;
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 0.8em;
    margin-left: 10px;
}

/* RTL Support */
body.rtl .csd-discount-notice {
    direction: rtl;
    text-align: right;
}

body.rtl .csd-notice-content {
    flex-direction: row-reverse;
}

body.rtl .csd-category-info {
    direction: rtl;
    text-align: center;
}

body.rtl .csd-product-badge {
    right: auto;
    left: 10px;
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .csd-discount-notice {
        background: #000;
        color: #fff;
        border: 2px solid #fff;
    }
    
    .csd-category-info.first-product {
        background: #006400;
        color: #fff;
    }
    
    .csd-category-info.second-product {
        background: #ff8c00;
        color: #000;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .csd-discount-notice,
    .csd-category-info {
        animation: none;
    }
    
    .csd-product-badge {
        animation: none;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .csd-category-info.no-discount {
        background: #2d3748;
        color: #e2e8f0;
        border-color: #4a5568;
    }
    
    .csd-original-price {
        color: #a0aec0;
    }
} 