/**
 * Farbe Egal CSS styles
 *
 * @since      1.0.0
 * @package    Kobosil_Orders
 * @subpackage Kobosil_Orders/public/css
 */

/* Container für Checkbox auf Produktseite und Checkout */
.farbe-egal-container {
    background: #f0f8f0;
    border: 2px solid #4CAF50;
    padding: 15px;
    margin: 20px 0;
    border-radius: 8px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

/* Checkbox Label */
.farbe-egal-container label {
    display: flex;
    align-items: center;
    cursor: pointer;
    margin: 0;
    font-weight: 500;
    color: #2e7d32;
}

/* Checkbox größer für bessere Sichtbarkeit */
.farbe-egal-checkbox {
    transform: scale(1.5);
    margin-right: 12px;
    cursor: pointer;
}

/* Info-Text unter der Checkbox */
.farbe-egal-info {
    font-size: 14px;
    color: #2e7d32;
    margin-top: 10px;
    padding: 10px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 5px;
    transition: all 0.3s ease;
    cursor: pointer;
    user-select: none;
}

/* Highlight Animation */
.farbe-egal-info.highlight-animation {
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 2px 5px rgba(76, 175, 80, 0.3);
}

/* Spezielle Styles für Checkout */
.woocommerce-checkout .farbe-egal-container,
.checkout-farbe-egal {
    margin: 8px 0 0 0;
    padding: 8px 0;
    background: transparent;
    border: none;
    border-top: 1px solid #e0e0e0;
    border-radius: 0;
    font-size: 13px;
}

.woocommerce-checkout .farbe-egal-container label,
.checkout-farbe-egal label {
    font-size: 13px;
    color: #2e7d32;
    font-weight: normal;
    margin: 0;
}

/* In der Checkout-Tabelle */
.shop_table .farbe-egal-container {
    display: block;
    width: 100%;
    margin-top: 5px;
    clear: both;
}

/* Produktbild-Container */
.product-item-thumbnail {
    float: left;
    margin-right: 15px;
}

/* Produktname-Container neben Bild */
.cg-checkout-table-product-name {
    overflow: hidden;
}

/* Aktiver Zustand */
.farbe-egal-container.active {
    background: #e8f5e9;
    border-color: #2e7d32;
    box-shadow: 0 2px 10px rgba(76, 175, 80, 0.2);
}

/* Loading State */
.farbe-egal-container.loading {
    opacity: 0.7;
    pointer-events: none;
}

.farbe-egal-container.loading::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.5), transparent);
    animation: loading-slide 1.5s infinite;
}

@keyframes loading-slide {
    to {
        left: 100%;
    }
}

/* Success Animation */
.farbe-egal-container.success {
    animation: success-pulse 0.5s ease;
}

@keyframes success-pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.02);
    }
    100% {
        transform: scale(1);
    }
}

/* Hover Effects */
.farbe-egal-container:hover {
    border-color: #388E3C;
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.15);
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    /* Checkout-spezifische Mobile Styles - inline unter Produktname */
    .woocommerce-checkout .farbe-egal-container,
    .checkout-farbe-egal,
    .shop_table .farbe-egal-container {
        margin: 5px 0 0 0;
        padding: 5px 0;
        background: transparent;
        border: none;
        border-top: 1px solid #e0e0e0;
        border-radius: 0;
        box-shadow: none;
    }
    
    .woocommerce-checkout .farbe-egal-container label,
    .checkout-farbe-egal label,
    .shop_table .farbe-egal-container label {
        margin: 0;
        font-size: 13px;
        font-weight: normal;
        color: #2e7d32;
        display: flex;
        align-items: center;
        min-height: auto;
        padding: 0;
    }
    
    .woocommerce-checkout .farbe-egal-checkbox,
    .checkout-farbe-egal .farbe-egal-checkout-checkbox,
    .shop_table .farbe-egal-checkbox {
        transform: scale(1);
        margin-right: 8px;
        flex-shrink: 0;
        accent-color: #4CAF50;
    }
    
    /* Info-Text entfernen auf Mobile Checkout */
    .woocommerce-checkout .farbe-egal-info,
    .checkout-farbe-egal .farbe-egal-info,
    .shop_table .farbe-egal-info {
        display: none;
    }
    
    /* Active state auf Mobile Checkout - dezent */
    .woocommerce-checkout .farbe-egal-container.active,
    .checkout-farbe-egal.active,
    .shop_table .farbe-egal-container.active {
        background: transparent;
        border-top-color: #4CAF50;
    }
    
    /* Produktname und Checkbox-Container */
    .cg-checkout-table-product-name {
        display: block;
        width: 100%;
    }
    
    /* Clear float nach Checkbox */
    .clear {
        clear: both;
        margin-bottom: 5px;
    }
    
    /* Produktbild in Tabelle */
    .shop_table .product-item-thumbnail {
        display: block !important;
        float: left;
        margin-right: 10px;
        margin-bottom: 5px;
    }
    
    /* Produktname neben Bild */
    .shop_table .cg-checkout-table-product-name {
        display: block;
        overflow: hidden;
    }
    
    /* Checkout-Tabelle Mobile Anpassungen */
    .shop_table td.product-name {
        padding: 10px 5px;
    }
    
    /* Standard Mobile Styles für Produktseiten */
    .single-product .farbe-egal-container {
        margin: 15px 0;
        padding: 15px 12px;
        background: #ffffff;
        border: 2px solid #4CAF50;
        box-shadow: 0 2px 8px rgba(76, 175, 80, 0.1);
    }
    
    .single-product .farbe-egal-container label {
        font-size: 15px;
        line-height: 1.4;
        color: #2e7d32;
        font-weight: 600;
        padding: 5px 0;
        min-height: 44px;
        align-items: center;
    }
    
    .single-product .farbe-egal-checkbox {
        transform: scale(1.2);
        margin-right: 12px;
        flex-shrink: 0;
        accent-color: #4CAF50;
    }
    
    .single-product .farbe-egal-info {
        font-size: 13px;
        background: #f0f8f0;
        margin-top: 8px;
        padding: 8px;
        line-height: 1.5;
    }
}

/* Disabled State */
.farbe-egal-checkbox:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Eco Icon Animation */
.farbe-egal-container label span::after {
    content: ' ';
    display: inline-block;
    margin-left: 5px;
    animation: eco-bounce 2s infinite;
}

@keyframes eco-bounce {
    0%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-3px);
    }
}

/* Additional styling for better integration */
.single-product .farbe-egal-container {
    clear: both;
    margin-top: 25px;
}

/* Ensure proper spacing with other elements */
.woocommerce-variation-add-to-cart + .farbe-egal-container,
.single_add_to_cart_button + .farbe-egal-container {
    margin-top: 20px;
}