/**
 * Inventory Link Manager Styles
 * Styles for Master/Slave product linking UI
 */

/* =========================================================================
   Frontend Styles - Product Page
   ========================================================================= */

/* Link Box Container */
.inventory-link-box {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    margin: 20px 0;
    border-radius: 12px;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border: 1px solid #e2e8f0;
    transition: all 0.3s ease;
}

.inventory-link-box:hover {
    border-color: #cbd5e1;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    transform: translateY(-2px);
}

/* Bulk variant styling */
.inventory-link-box--bulk {
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    border-color: #bfdbfe;
}

.inventory-link-box--bulk:hover {
    border-color: #93c5fd;
}

/* Detail variant styling */
.inventory-link-box--detail {
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    border-color: #bbf7d0;
}

.inventory-link-box--detail:hover {
    border-color: #86efac;
}

/* Icon */
.inventory-link-box__icon {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.inventory-link-box--bulk .inventory-link-box__icon {
    color: #2563eb;
}

.inventory-link-box--detail .inventory-link-box__icon {
    color: #16a34a;
}

.inventory-link-box__icon svg {
    width: 24px;
    height: 24px;
}

/* Content */
.inventory-link-box__content {
    flex: 1;
    min-width: 0;
}

.inventory-link-box__title {
    margin: 0 0 4px 0;
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
    line-height: 1.3;
}

.inventory-link-box__description {
    margin: 0 0 8px 0;
    font-size: 14px;
    color: #64748b;
    line-height: 1.4;
}

.inventory-link-box__details {
    margin: 0;
    font-size: 13px;
    color: #475569;
    font-weight: 500;
}

/* Button */
.inventory-link-box__button {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.inventory-link-box--bulk .inventory-link-box__button {
    background: #2563eb;
    color: white;
}

.inventory-link-box--bulk .inventory-link-box__button:hover {
    background: #1d4ed8;
    color: white;
}

.inventory-link-box--detail .inventory-link-box__button {
    background: #16a34a;
    color: white;
}

.inventory-link-box--detail .inventory-link-box__button:hover {
    background: #15803d;
    color: white;
}

.inventory-link-box__button svg {
    transition: transform 0.2s ease;
}

.inventory-link-box__button:hover svg {
    transform: translateX(4px);
}

/* Alternative Link (near add to cart) */
.alternative-purchase-link {
    margin-top: 12px;
    text-align: center;
}

.alternative-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.alternative-link--bulk {
    color: #2563eb;
    background: #eff6ff;
}

.alternative-link--bulk:hover {
    background: #dbeafe;
    color: #1d4ed8;
}

.alternative-link--detail {
    color: #16a34a;
    background: #f0fdf4;
}

.alternative-link--detail:hover {
    background: #dcfce7;
    color: #15803d;
}

/* Inline Alternative Link (in quantity label) */
.inline-alternative-link {
    color: var(--custom-woo-mods-primary-color);
    text-decoration: underline !important;
    font-weight: 500 !important;
    transition: color 0.2s ease !important;
}

.inline-alternative-link:hover {
    color: var(--custom-woo-mods-primary-color-hover);
    text-decoration: none !important;
}

/* =========================================================================
   Responsive Styles
   ========================================================================= */

@media (max-width: 768px) {
    .inventory-link-box {
        flex-direction: column;
        text-align: center;
        gap: 12px;
        padding: 16px;
    }

    .inventory-link-box__icon {
        margin: 0 auto;
    }

    .inventory-link-box__content {
        width: 100%;
    }

    .inventory-link-box__button {
        width: 100%;
        justify-content: center;
    }
}

/* =========================================================================
   Admin Styles - Product List
   ========================================================================= */

.inventory-link-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    margin-right: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.inventory-link-badge--master {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fcd34d;
}

.inventory-link-badge--slave {
    background: #dbeafe;
    color: #1e40af;
    border: 1px solid #93c5fd;
}

.inventory-link-badge--bulk {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #6ee7b7;
}

.inventory-link-badge--none {
    background: #f1f5f9;
    color: #94a3b8;
    border: 1px solid #e2e8f0;
}

/* =========================================================================
   Admin Styles - Product Edit Page
   ========================================================================= */

.inventory-link-group {
    background: #f8f9fa;
    border-left: 4px solid #0073aa;
    margin: 10px 0;
    padding-bottom: 10px;
}

.inventory-link-group h4 {
    color: #0073aa;
    font-weight: 600;
    padding-left: 12px;
    margin-bottom: 10px;
}

/* Availability Text Modifications */
.woocommerce-product-details__short-description .availability.out-of-stock {
    color: #dc2626;
    font-weight: 500;
}

.woocommerce-product-details__short-description .availability.in-stock {
    color: #16a34a;
    font-weight: 500;
}

/* Out of stock message for linked products */
.linked-product-unavailable {
    padding: 16px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    color: #991b1b;
    font-size: 14px;
    margin: 16px 0;
}

.linked-product-unavailable strong {
    display: block;
    margin-bottom: 4px;
}


/* Stock info display */
.inventory-link-stock-info {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 8px;
    margin: 12px 0;
    font-size: 14px;
    color: #166534;
}

.inventory-link-stock-info svg {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
}

.inventory-link-stock-info--low {
    background: #fffbeb;
    border-color: #fcd34d;
    color: #92400e;
}

.inventory-link-stock-info--out {
    background: #fef2f2;
    border-color: #fecaca;
    color: #991b1b;
}

