/**
 * Multi-Design Manager Styles for WooCommerce Product Page
 */

/* Container for saved designs - hidden by default when empty */
.fz-designs-container {
    margin: 20px 0;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

/* Hide the container when it's empty */
.fz-designs-container:empty {
    display: none;
}

.fz-saved-designs {
    width: 100%;
}

.fz-designs-header {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e0e0e0;
}

/* Grid layout for designs */
.fz-designs-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}

/* Individual design item */
.fz-design-item {
    position: relative;
    background: white;
    border: 2px solid #ddd;
    border-radius: 6px;
    padding: 4px;
    transition: all 0.2s ease;
}

.fz-design-item:hover {
    border-color: #0073aa;
    box-shadow: 0 2px 8px rgba(0,115,170,0.15);
}

.fz-design-thumbnail {
    position: relative;
    width: 80px;
    height: 80px;
    overflow: hidden;
    border-radius: 4px;
    background: #f5f5f5;
}

.fz-design-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.fz-design-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    font-size: 11px;
    color: #888;
    text-align: center;
}

/* Design number badge */
.fz-design-number {
    position: absolute;
    top: -8px;
    left: -8px;
    width: 24px;
    height: 24px;
    background: #0073aa;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* Action buttons */
.fz-design-actions {
    display: flex;
    gap: 2px;
    margin-top: 6px;
    justify-content: center;
}

.fz-design-actions button {
    background: white;
    border: 1px solid #ddd;
    border-radius: 3px;
    padding: 4px 6px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.fz-design-actions button:hover {
    background: #f0f0f0;
    border-color: #0073aa;
}

.fz-design-actions .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
    line-height: 16px;
}

.fz-edit-design:hover {
    color: #0073aa;
}

.fz-view-design:hover {
    color: #46b450;
}

.fz-delete-design:hover {
    color: #dc3232;
    background: #fee;
    border-color: #dc3232;
}

/* Add Another Design button */
.fz-add-another-wrapper {
    display: flex;
    align-items: center;
}

.fz-add-another-design {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: #46b450;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s;
    height: 88px;
    min-width: 88px;
    flex-direction: column;
    justify-content: center;
}

.fz-add-another-design:hover {
    background: #389e3c;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(70,180,80,0.3);
}

.fz-add-another-design .dashicons {
    font-size: 20px;
    width: 20px;
    height: 20px;
}

/* Success message */
.fz-design-saved-message {
    display: none;
    margin: 10px 0;
    padding: 12px 20px;
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    border-radius: 4px;
    position: relative;
}

.fz-design-saved-message:before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: #28a745;
}

/* Preview Modal */
.fz-preview-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 99999;
}

.fz-preview-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.8);
}

.fz-preview-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    max-width: 90%;
    max-height: 90%;
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
}

.fz-preview-content img {
    max-width: 100%;
    max-height: 80vh;
    display: block;
}

.fz-preview-close {
    position: absolute;
    top: -15px;
    right: -15px;
    width: 40px;
    height: 40px;
    background: white;
    border: 2px solid #333;
    border-radius: 50%;
    font-size: 24px;
    line-height: 36px;
    text-align: center;
    cursor: pointer;
    font-weight: bold;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.fz-preview-close:hover {
    background: #f0f0f0;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .fz-designs-grid {
        gap: 8px;
    }

    .fz-design-thumbnail {
        width: 60px;
        height: 60px;
    }

    .fz-add-another-design {
        height: 68px;
        min-width: 68px;
        font-size: 11px;
        padding: 6px 10px;
    }

    .fz-design-actions button {
        padding: 3px 4px;
    }

    .fz-design-actions .dashicons {
        font-size: 14px;
        width: 14px;
        height: 14px;
    }
}

/* Integration with WooCommerce styles */
.woocommerce-message.fz-design-saved-message {
    background-color: #d4edda;
    border-color: #c3e6cb;
}

/* Ensure designs container appears after customize button */
.fz-customize-button + .fz-designs-container {
    margin-top: 15px;
}

/* Style for when integrated with quantity input */
.quantity + .fz-designs-container {
    margin-left: 15px;
    display: inline-block;
    vertical-align: middle;
}