/**
 * Enhanced Admin Controls CSS
 * Elementor-style controls for Product Display admin
 */

/* Dimensions Control */
.proddisp-control-dimensions {
    position: relative;
}

.proddisp-dimensions-list {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 12px;
}

.proddisp-control-dimension {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    flex: 1;
}

.proddisp-control-dimension input {
    width: 50px;
    height: 32px;
    text-align: center;
    border: 1px solid #ccd0d4;
    border-radius: 3px;
    font-size: 12px;
    padding: 0 4px;
    background: #fff;
}

.proddisp-control-dimension input:focus {
    border-color: #0073aa;
    box-shadow: 0 0 0 1px #0073aa;
    outline: none;
}

.proddisp-dimension-label {
    font-size: 10px;
    color: #666;
    text-transform: uppercase;
    font-weight: 500;
    letter-spacing: 0.5px;
    margin: 0;
}

.proddisp-link-dimensions-wrapper {
    display: flex;
    align-items: center;
    margin-left: 8px;
}

.proddisp-link-dimensions {
    width: 32px;
    height: 32px;
    border: 1px solid #ccd0d4;
    border-radius: 3px;
    background: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    position: relative;
}

.proddisp-link-dimensions:hover {
    border-color: #0073aa;
    background: #f0f8ff;
}

.proddisp-link-dimensions.linked .proddisp-unlinked,
.proddisp-link-dimensions:not(.linked) .proddisp-linked {
    display: none;
}

.proddisp-link-dimensions .dashicons {
    font-size: 16px;
    color: #666;
}

.proddisp-link-dimensions.linked .dashicons {
    color: #0073aa;
}

/* Alignment Control */
.proddisp-control-input-wrapper {
    position: relative;
}

.proddisp-choices {
    display: flex;
    gap: 2px;
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 4px;
    width: fit-content;
}

.proddisp-choices input[type="radio"] {
    display: none;
}

.proddisp-choices-label {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 32px;
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: transparent;
    border: 1px solid transparent;
    position: relative;
}

.proddisp-choices-label:hover {
    background: #e8f4f8;
    border-color: #b8d4e0;
}

.proddisp-choices input[type="radio"]:checked+.proddisp-choices-label {
    background: #0073aa;
    border-color: #0073aa;
    color: #fff;
}

.proddisp-choices input[type="radio"]:checked+.proddisp-choices-label .dashicons {
    color: #fff;
}

.proddisp-choices-label .dashicons {
    font-size: 16px;
    color: #666;
    transition: color 0.2s ease;
}

.proddisp-choices-label:hover .dashicons {
    color: #0073aa;
}

/* Enhanced Color Picker */
.proddisp-color-control {
    position: relative;
    display: block;
}

.proddisp-color-input-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}



/* Integration with existing admin styles */
.wcps-admin .proddisp-control-dimensions,
.wcps-admin .proddisp-control-input-wrapper,
.wcps-admin .proddisp-color-control {
    margin-bottom: 0;
}

/* Animation for linked state */
.proddisp-link-dimensions {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.proddisp-link-dimensions.linked {
    background: #e8f4f8;
    border-color: #0073aa;
    transform: scale(1.05);
}

/* Focus states for accessibility */
.proddisp-link-dimensions:focus {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
}

.proddisp-choices-label:focus-within {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
}

/* Loading state */
.proddisp-control-dimensions.loading {
    opacity: 0.6;
    pointer-events: none;
}

.proddisp-control-dimensions.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #0073aa;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}