/* Hisense Membership Cart Redemption Styles */

/* Custom Alert Modal Styles */
.hisense-cart-alert-modal,
.hisense-cart-confirm-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.hisense-cart-alert-modal.hisense-cart-alert-show,
.hisense-cart-confirm-modal.hisense-cart-confirm-show {
    opacity: 1;
    visibility: visible;
}

.hisense-cart-alert-backdrop,
.hisense-cart-confirm-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
}

.hisense-cart-alert-dialog,
.hisense-cart-confirm-dialog {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    max-width: 400px;
    width: 90%;
    max-height: 80vh;
    overflow: hidden;
}

.hisense-cart-alert-header,
.hisense-cart-confirm-header {
    display: flex;
    align-items: center;
    padding: 20px 20px 15px;
    border-bottom: 1px solid #e9ecef;
}

.hisense-cart-alert-icon {
    width: 24px;
    height: 24px;
    margin-right: 12px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 14px;
}

.hisense-alert-icon-success {
    background: #d4edda;
    color: #155724;
}

.hisense-alert-icon-success::before {
    content: "✓";
}

.hisense-alert-icon-error {
    background: #f8d7da;
    color: #721c24;
}

.hisense-alert-icon-error::before {
    content: "✕";
}

.hisense-alert-icon-warning {
    background: #fff3cd;
    color: #856404;
}

.hisense-alert-icon-warning::before {
    content: "⚠";
}

.hisense-alert-icon-info {
    background: #d1ecf1;
    color: #0c5460;
}

.hisense-alert-icon-info::before {
    content: "i";
}

.hisense-cart-alert-header h3,
.hisense-cart-confirm-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #212529;
}

.hisense-cart-alert-body,
.hisense-cart-confirm-body {
    padding: 15px 20px;
}

.hisense-cart-alert-message,
.hisense-cart-confirm-message {
    margin: 0;
    color: #495057;
    line-height: 1.5;
}

.hisense-cart-alert-footer,
.hisense-cart-confirm-footer {
    padding: 15px 20px 20px;
    text-align: right;
    border-top: 1px solid #e9ecef;
}

.hisense-cart-alert-ok,
.hisense-cart-confirm-ok,
.hisense-cart-confirm-cancel {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-left: 8px;
}

.hisense-cart-alert-ok,
.hisense-cart-confirm-ok {
    background: #007cba;
    color: white;
}

.hisense-cart-alert-ok:hover,
.hisense-cart-confirm-ok:hover {
    background: #005a87;
}

.hisense-cart-confirm-cancel {
    background: #6c757d;
    color: white;
}

.hisense-cart-confirm-cancel:hover {
    background: #545b62;
}

/* Cart Redemption Form Styles */
.hisense-cart-points-redemption th {
    padding: 20px 0 !important;
    border-top: 1px solid #e1e1e1 !important;
}

.cart-points-redemption-section {
    margin: 10px 0;
}

.points-redemption-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e1e1e1;
}

.redemption-title {
    display: flex;
    align-items: center;
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.points-icon {
    margin-right: 8px;
}

.points-balance { 
    color: #8b8b8b;
}

.redemption-form-container {
    margin-bottom: 15px;
}

.form-row {
    display: flex;
    gap: 15px;
    align-items: end;
    flex-wrap: wrap;
}

.form-group {
    flex: 1;
    min-width: 200px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #333;
}

.points-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    transition: border-color 0.3s ease;
}

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

.points-input.error {
    border-color: #dc3545;
    box-shadow: 0 0 0 2px rgba(220, 53, 69, 0.1);
}


.redeem-points-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* Redemption Value Display */
.redemption-value-display {
    display: none;
    margin-top: 15px;
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.3s ease-out;
}

.redemption-value-display.show {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

.redemption-preview-card {
    display: flex;
    align-items: center;
    padding: 15px;
    background: linear-gradient(135deg, #e8f5e8 0%, #f0f8f0 100%);
    border-radius: 8px;
    border: 1px solid #28a745;
    box-shadow: 0 2px 8px rgba(40, 167, 69, 0.15);
    transition: all 0.3s ease;
}

.redemption-preview-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.2);
}

.redemption-icon {
    margin-right: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: rgba(40, 167, 69, 0.1);
    border-radius: 50%;
}

.redemption-details {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.redemption-label {
    font-size: 12px;
    color: #6c757d;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 2px;
}

.redemption-amount {
    font-size: 18px;
    font-weight: 700;
    color: #28a745;
}

.redemption-badge {
    background: #28a745;
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Points Redeemed Display */
.points-redeemed-display {
    margin-top: 10px;
}

.redeemed-info-card {
    display: flex;
    align-items: center;
    padding: 15px;
    background: linear-gradient(135deg, #d4edda 0%, #e8f5e8 100%);
    border-radius: 8px;
    border: 1px solid #28a745;
}

.redeemed-icon {
    margin-right: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: rgba(40, 167, 69, 0.2);
    border-radius: 50%;
}

.redeemed-details {
    flex: 1;
}

.redeemed-title {
    margin: 0 0 5px 0;
    font-size: 16px;
    font-weight: 600;
    color: #155724;
}

.redeemed-info {
    margin: 0;
    font-size: 14px;
    color: #155724;
}

.remove-points-btn {
    background: #6c757d;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.remove-points-btn:hover {
    background: #545b62;
}

/* Responsive Design */
@media (max-width: 768px) {
    .form-row {
        flex-direction: column;
    }
    
    .form-group {
        min-width: auto;
    }
    
    .points-redemption-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .redeemed-info-card {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }
}

/* ==========================================================================
   Points History Clear Button
   ========================================================================== */

.points-history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.points-history-header h3 {
    margin: 0;
    color: #333;
    font-size: 18px;
}

.clear-points-history-btn {
    background: #dc3545;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 13px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.3s ease;
    text-decoration: none;
}

.clear-points-history-btn:hover {
    background: #c82333;
    color: white;
    text-decoration: none;
}

.clear-points-history-btn:disabled {
    background: #6c757d;
    cursor: not-allowed;
    opacity: 0.7;
}

.clear-points-history-btn .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
    line-height: 1;
}

.clear-points-history-btn .dashicons-update-alt {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Responsive styles for clear button */
@media (max-width: 768px) {
    .points-history-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .clear-points-history-btn {
        font-size: 12px;
        padding: 6px 12px;
    }
}
