/* RAJDAR Rabatowanie Premiami - Plugin Styles */

/* Main info boxes */
.rajdar-info-box {
    padding: 15px;
    margin: 10px 0;
    border-radius: 4px;
    font-size: 14px;
    line-height: 1.5;
    border-left: 4px solid;
    /* Styles are now applied inline based on user settings */
}

.rajdar-info-box.success {
    /* Fallback styles for backward compatibility */
    border-left-color: #28a745;
    background: #d4edda;
    border-color: #c3e6cb;
    color: #155724;
}

.rajdar-info-box.warning {
    /* Fallback styles for backward compatibility */
    border-left-color: #ffc107;
    background: #fff3cd;
    border-color: #ffeaa7;
    color: #856404;
}

.rajdar-info-box.error {
    /* Fallback styles for backward compatibility */
    border-left-color: #dc3545;
    background: #f8d7da;
    border-color: #f5c6cb;
    color: #721c24;
}

/* Discount form styles */
.rajdar-discount-form {
    margin: 20px 0;
    padding: 20px;
    background: #ffffff;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.rajdar-discount-input {
    padding: 10px;
    border: 2px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    transition: border-color 0.3s ease;
}

.rajdar-discount-input:focus {
    outline: none;
    border-color: #007cba;
    box-shadow: 0 0 0 3px rgba(0,124,186,0.1);
}

.cart-rabat-button {
    background: #007cba;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    font-weight: 600;
}

.cart-rabat-button:hover {
    background: #005a87;
}

.cart-rabat-button:active {
    transform: translateY(1px);
}

/* Price display styles */
.original-price {
    color: #6c757d;
    font-size: 0.9em;
}

.original-price del {
    text-decoration: line-through;
    opacity: 0.7;
}

.modified-price {
    color: #28a745;
    font-weight: 600;
    font-size: 1.1em;
}

.modified-price ins {
    text-decoration: none;
    background: none;
}

.original-subtotal {
    color: #6c757d;
    font-size: 0.9em;
}

.original-subtotal del {
    text-decoration: line-through;
    opacity: 0.7;
}

.modified-subtotal {
    color: #28a745;
    font-weight: 600;
    font-size: 1.1em;
}

.modified-subtotal ins {
    text-decoration: none;
    background: none;
}

/* Cart totals discount info */
.additional-info-rajdar-box {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white !important;
    padding: 15px !important;
    border-radius: 8px;
    font-weight: 600;
    font-size: 16px;
    margin: 10px 0;
    text-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.total-cart-info {
    background: rgba(40, 167, 69, 0.1);
}

/* Responsive design */
@media (max-width: 768px) {
    .rajdar-discount-form {
        padding: 15px;
        margin: 15px 0;
    }
    
    .rajdar-info-box {
        padding: 12px;
        margin: 8px 0;
        font-size: 13px;
    }
    
    .cart-rabat-button {
        width: 100% !important;
        margin-top: 10px !important;
    }
    
    .rajdar-discount-input {
        width: 100% !important;
        margin-bottom: 10px;
    }
}

@media (max-width: 480px) {
    .rajdar-discount-form {
        padding: 12px;
    }
    
    .additional-info-rajdar-box {
        padding: 12px !important;
        font-size: 14px;
    }
}

/* Admin order styles */
.form-field.form-field-wide[style*="background-color:green"] {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%) !important;
    border: 1px solid #28a745;
    border-radius: 6px;
    margin: 15px 0;
}

.form-field.form-field-wide[style*="background-color:green"] strong {
    color: white;
    font-size: 18px;
}

/* Loading spinner for AJAX operations */
.rajdar-loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #007cba;
    border-radius: 50%;
    animation: rajdar-spin 1s linear infinite;
    margin-left: 10px;
}

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

/* Success message styling */
.woocommerce-message.rajdar-success {
    background: #d4edda;
    border-top-color: #28a745;
    color: #155724;
}

/* Error message styling */
.woocommerce-error.rajdar-error {
    background: #f8d7da;
    border-top-color: #dc3545;
    color: #721c24;
}

/* Tooltip styles */
.rajdar-tooltip {
    position: relative;
    display: inline-block;
    cursor: help;
}

.rajdar-tooltip .rajdar-tooltip-text {
    visibility: hidden;
    width: 200px;
    background-color: #555;
    color: #fff;
    text-align: center;
    border-radius: 6px;
    padding: 8px;
    position: absolute;
    z-index: 1;
    bottom: 125%;
    left: 50%;
    margin-left: -100px;
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 12px;
}

.rajdar-tooltip:hover .rajdar-tooltip-text {
    visibility: visible;
    opacity: 1;
}

/* Premium balance indicator */
.rajdar-premium-balance {
    display: inline-flex;
    align-items: center;
    background: linear-gradient(135deg, #007cba 0%, #005a87 100%);
    color: white;
    padding: 8px 15px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 14px;
    margin: 5px 0;
}

.rajdar-premium-balance::before {
    content: "💎";
    margin-right: 8px;
    font-size: 16px;
}

/* Discount validation styles */
.rajdar-discount-valid {
    border-color: #28a745 !important;
    box-shadow: 0 0 0 3px rgba(40, 167, 69, 0.1) !important;
}

.rajdar-discount-invalid {
    border-color: #dc3545 !important;
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.1) !important;
}

/* Animation for price changes */
.rajdar-price-change {
    animation: rajdar-highlight 2s ease-in-out;
}

@keyframes rajdar-highlight {
    0% { background-color: rgba(40, 167, 69, 0.3); }
    100% { background-color: transparent; }
}

/* Print styles */
@media print {
    .rajdar-discount-form,
    .rajdar-info-box {
        display: none !important;
    }
    
    .additional-info-rajdar-box {
        background: white !important;
        color: black !important;
        border: 1px solid #000 !important;
    }
}


.rajdar-discount-applied {
    background-color: rgb(0, 128, 0) !important;
    color: yellow !important;
    border-radius: 5px !important;
}

#rajdar_remove_discount_button {
    background-color: white !important;
    color: black !important;
    border: 1px solid white !important;
    border-radius: 5px !important;
    cursor: pointer !important;
}

#rajdar_remove_discount_button:hover {
    background-color: var(--rajdar-brand) !important;
    color: white !important;
    border: 1px solid var(--rajdar-brand) !important;
    border-radius: 5px !important;
    cursor: pointer !important;
}

#rajdar_apply_discount_button{
    cursor: pointer !important;
    background-color: #ec945b !important;
    color: black !important;
    border: 1px solid #ec945b !important;
    border-radius: 5px !important;
}

#rajdar_apply_discount_button:hover {
    cursor: pointer !important;
    background-color: #aa4f14 !important;
    color: white !important;
    border: 1px solid #aa4f14 !important;
    border-radius: 5px !important;
}