/**
 * SkinClub Points Gateway Styles - Simplified Version
 */

/* Main container */
.skinclub-points-simple {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

/* Balance display */
.skinclub-points-balance-display {
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #dee2e6;
}

.skinclub-points-balance-display p {
    margin: 0;
    font-size: 16px;
    color: #495057;
}

.skinclub-points-balance-display .points-balance {
    color: #28a745;
    font-weight: 600;
    font-size: 18px;
}

.skinclub-points-balance-display .points-value {
    color: #6c757d;
    font-size: 14px;
    margin-left: 5px;
}

/* Checkbox wrapper */
.skinclub-use-points-wrapper {
    margin-top: 15px;
}

.skinclub-use-points-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    color: #212529;
    padding: 12px 15px;
    background: #ffffff;
    border: 2px solid #28a745;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.skinclub-use-points-label:hover {
    background: #f8f9fa;
    border-color: #218838;
}

.skinclub-use-points-label input[type="checkbox"] {
    width: 20px;
    height: 20px;
    margin-right: 12px;
    cursor: pointer;
}

.skinclub-use-points-label .checkbox-label {
    flex: 1;
}

/* Points usage info */
.skinclub-points-usage-info {
    margin-top: 15px;
    padding: 15px;
    background: #ffffff;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    display: none; /* Hidden by default, shown via JS */
}

.skinclub-points-usage-info p {
    margin: 8px 0;
    font-size: 14px;
    color: #495057;
    display: flex;
    align-items: center;
}

.skinclub-points-usage-info p.points-to-use {
    color: #28a745;
}

.skinclub-points-usage-info p.remaining-to-pay {
    color: #dc3545;
}

.skinclub-points-usage-info .icon {
    font-size: 16px;
    margin-right: 8px;
    min-width: 20px;
    text-align: center;
}

.skinclub-points-usage-info strong {
    font-weight: 600;
    color: #212529;
}

/* No points message */
.skinclub-no-points {
    color: #dc3545;
    font-weight: 500;
    margin: 0;
    padding: 15px;
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 6px;
}

/* Checkout balance display */
.skinclub-points-checkout-balance {
    background: #e9ecef;
    padding: 12px 15px;
    margin-bottom: 20px;
    border-radius: 6px;
    border-left: 4px solid #28a745;
}

.skinclub-points-checkout-balance p {
    margin: 0;
    font-size: 14px;
    color: #495057;
}

/* Payment method list adjustments */
.woocommerce-checkout #payment ul.payment_methods li.payment_method_skinclub_points {
    transition: all 0.3s ease;
}

.woocommerce-checkout #payment ul.payment_methods li.payment_method_skinclub_points.hidden {
    display: none !important;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .skinclub-points-simple {
        padding: 15px;
    }
    
    .skinclub-use-points-label {
        font-size: 14px;
        padding: 10px 12px;
    }
    
    .skinclub-use-points-label input[type="checkbox"] {
        width: 18px;
        height: 18px;
        margin-right: 10px;
    }
    
    .skinclub-points-usage-info {
        padding: 12px;
    }
    
    .skinclub-points-usage-info p {
        font-size: 13px;
    }
    
    .skinclub-points-balance-display .points-balance {
        font-size: 16px;
    }
}

/* Animation for showing/hiding elements */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.skinclub-points-usage-info.show {
    animation: slideDown 0.3s ease;
}

/* Hover effects */
.skinclub-use-points-label input[type="checkbox"]:checked + .checkbox-label {
    color: #28a745;
}

/* Focus styles for accessibility */
.skinclub-use-points-label input[type="checkbox"]:focus {
    outline: 2px solid #28a745;
    outline-offset: 2px;
}

/* Loading state */
.skinclub-points-simple.loading {
    opacity: 0.6;
    pointer-events: none;
}

.skinclub-points-simple.loading::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #28a745;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 0.8s linear infinite;
}

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

/* Product Points Eligibility Indicators */

/* Shop loop badge overlay on thumbnail - Unified SkinClub style */
.skinclub-points-badge-overlay {
    position: absolute;
    top: 12px;
    left: 12px;
    background: #FFFFFF;
    color: #000000;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    z-index: 10;
    box-shadow: 0 2px 4px rgba(0,0,0,0.08);
    border: 2px solid #D89CA1;
    display: inline-flex;
    align-items: center;
    transition: all 0.2s ease;
    letter-spacing: 0.3px;
}

.skinclub-points-badge-overlay:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(216, 156, 161, 0.3);
    background: #FFF9FA;
}

.skinclub-points-badge-overlay .badge-text {
    letter-spacing: 0.3px;
}

/* Make product container relative for absolute positioning */
.woocommerce ul.products li.product {
    position: relative;
}

.woocommerce ul.products li.product a {
    position: relative;
    display: block;
}

/* Single product page banner */
.skinclub-product-points-info {
    margin: 20px 0;
}

.points-eligible-banner {
    display: flex;
    align-items: center;
    background: linear-gradient(135deg, #e8f5e9, #c8e6c9);
    border: 2px solid #28a745;
    border-radius: 10px;
    padding: 15px 20px;
    gap: 15px;
}

.points-eligible-banner .points-icon {
    font-size: 32px;
    flex-shrink: 0;
}

.points-eligible-banner .points-text {
    flex: 1;
    color: #1b5e20;
    font-size: 14px;
    line-height: 1.5;
}

.points-eligible-banner strong {
    color: #28a745;
    font-size: 16px;
}

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

.points-eligible-banner .member-price {
    color: #6c757d;
    font-size: 13px;
    margin-top: 4px;
    display: inline-block;
}

/* Cart item indicator */
.skinclub-cart-points-badge {
    display: inline-block;
    font-size: 16px;
    margin-left: 8px;
    cursor: help;
    vertical-align: middle;
}

/* Checkout eligible products notice */
.eligible-products-notice {
    background: #fff3cd;
    border-left: 4px solid #ffc107;
    padding: 8px 12px;
    margin-top: 10px;
    border-radius: 4px;
    font-size: 13px;
    color: #856404;
}

.eligible-products-notice .icon {
    margin-right: 6px;
    font-size: 14px;
}

/* No eligible products message */
.skinclub-no-eligible-products {
    color: #6c757d;
    font-weight: 500;
    margin: 0;
    padding: 15px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    text-align: center;
}

/* Responsive adjustments for badges */
@media (max-width: 768px) {
    .skinclub-points-badge-overlay,
    .skinclub-points-badge-inline,
    .skinclub-points-value-badge {
        font-size: 12px;
        padding: 6px 12px;
    }

    .skinclub-points-badge-overlay {
        top: 8px;
        left: 8px;
    }

    .points-eligible-banner {
        padding: 12px 15px;
        gap: 12px;
    }

    .points-eligible-banner .points-icon {
        font-size: 24px;
    }

    .points-eligible-banner .points-text {
        font-size: 13px;
    }

    .points-eligible-banner strong {
        font-size: 14px;
    }
}

/* Product grid hover effect */
.products .product:hover .skinclub-points-badge-overlay {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* Animation on page load - subtle slide in */
@keyframes slideInFade {
    0% {
        opacity: 0;
        transform: translateX(-10px);
    }
    100% {
        opacity: 1;
        transform: translateX(0);
    }
}

.skinclub-points-badge-overlay {
    animation: slideInFade 0.3s ease-out;
}

/* Sale-like badge style for special occasions - SkinClub pink gradient */
.skinclub-points-badge-overlay.highlight {
    background: linear-gradient(135deg, #D89CA1, #F5D0D3);
    color: #FFFFFF;
    border: 2px solid #D89CA1;
}

.skinclub-points-badge-overlay.highlight::before {
    display: none;
}

/* Compact icon-only version */
.skinclub-points-badge-overlay.compact {
    padding: 10px;
    border-radius: 50%;
    min-width: unset;
}

.skinclub-points-badge-overlay.compact .badge-icon {
    font-size: 16px;
    line-height: 1;
}

/* Alternative position - bottom left */
.skinclub-points-badge-overlay.bottom-left {
    top: auto;
    bottom: 12px;
    left: 12px;
}

/* Dark theme version - SkinClub color scheme */
.skinclub-points-badge-overlay.dark {
    background: #000000;
    color: #FFFFFF;
    border: 2px solid #D89CA1;
}

/* Inline badge style for shortcodes - Unified SkinClub style */
.skinclub-points-badge-inline {
    display: inline-flex;
    align-items: center;
    background: #FFFFFF;
    color: #000000;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    border: 2px solid #D89CA1;
    box-shadow: 0 2px 4px rgba(0,0,0,0.08);
    transition: all 0.2s ease;
    letter-spacing: 0.3px;
    position: relative;
}

.skinclub-points-badge-inline:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(216, 156, 161, 0.3);
    background: #FFF9FA;
}

/* Medlemspris styling - SkinClub gray */
.skinclub-medlemspris {
    color: #AAAAAA;
    font-size: 14px;
    display: inline-block;
}

/* Points value badge - Unified style matching points_badge */
.skinclub-points-value-badge {
    display: inline-flex;
    align-items: center;
    background: #FFFFFF;
    color: #000000;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    border: 2px solid #D89CA1;
    box-shadow: 0 2px 4px rgba(0,0,0,0.08);
    transition: all 0.2s ease;
    position: relative;
    letter-spacing: 0.3px;
}

.skinclub-points-value-badge:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(216, 156, 161, 0.3);
    background: #FFF9FA;
}

/* Points value inline - subtle version */
.skinclub-points-value-inline {
    display: inline-block;
    color: #D89CA1;
    font-weight: 600;
    font-size: 15px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    letter-spacing: 0.2px;
}

/* Alternative minimal badge style */
.skinclub-points-value-minimal {
    display: inline-block;
    background: linear-gradient(135deg, #FFF9FA, #FFFFFF);
    color: #D89CA1;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    border: 1px solid #D89CA1;
}

/* Dark version for dark backgrounds */
.skinclub-points-value-dark {
    display: inline-flex;
    align-items: center;
    background: #000000;
    color: #FFFFFF;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    border: 2px solid #D89CA1;
}

/* Ensure badges align nicely when shown together */
.skinclub-points-badge-inline + .skinclub-points-value-badge,
.skinclub-points-value-badge + .skinclub-points-badge-inline {
    margin-left: 8px;
}

/* Product page badge container */
.skinclub-product-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 10px 0;
}

/* ========================================
   Brand Display Styles
   ======================================== */

/* Brand Display Container */
.skinclub-brand-display {
    display: inline-block;
    margin: 5px 0;
}

/* Brand Link Style */
.skinclub-brand-link {
    color: #666;
    text-decoration: none;
    font-size: 0.9em;
    transition: color 0.3s ease;
    font-weight: 500;
}

.skinclub-brand-link:hover {
    color: #D89CA1; /* SkinClub pink */
    text-decoration: underline;
}

/* Brand Badge Style */
.skinclub-brand-badge {
    display: inline-block;
    background: #FFFFFF;
    color: #000000;
    padding: 4px 12px;
    border-radius: 15px;
    border: 1px solid #D89CA1;
    text-decoration: none;
    font-size: 0.85em;
    margin: 2px;
    transition: all 0.3s ease;
    font-weight: 500;
}

.skinclub-brand-badge:hover {
    background: #D89CA1;
    color: #FFFFFF;
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(216, 156, 161, 0.3);
}

/* In product loops */
.woocommerce ul.products li.product .skinclub-brand-display {
    margin-bottom: 8px;
    display: block;
    text-align: center;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .skinclub-brand-badge {
        font-size: 0.8em;
        padding: 3px 10px;
    }
}