/**
 * Checklist Display Widget Styles
 *
 * @package Voxel_Toolkit
 */

/* Container */
.vt-checklist-display {
    width: 100%;
}

/* Progress Section */
.vt-checklist-progress {
    margin-bottom: 20px;
}

.vt-checklist-progress-bar {
    width: 100%;
    height: 8px;
    background: #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
}

.vt-checklist-progress-fill {
    height: 100%;
    background: #2271b1;
    border-radius: 4px;
    transition: width 0.3s ease;
}

.vt-checklist-progress-text {
    margin-top: 8px;
    font-size: 14px;
    color: #666666;
}

/* Items List */
.vt-checklist-items {
    display: flex;
    flex-direction: column;
}

/* Individual Item */
.vt-checklist-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 16px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background: #ffffff;
    transition: all 0.2s ease;
}

.vt-checklist-item + .vt-checklist-item {
    margin-top: 10px;
}

.vt-checklist-item.can-check {
    cursor: pointer;
}

.vt-checklist-item.can-check:hover {
    border-color: #2271b1;
}

.vt-checklist-item.is-checked {
    opacity: 0.8;
}

/* Checkbox */
.vt-checklist-checkbox {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    border: 2px solid #d0d0d0;
    border-radius: 4px;
    background: #ffffff;
    position: relative;
    transition: all 0.2s ease;
    margin-top: 2px;
}

.vt-checklist-item.can-check:hover .vt-checklist-checkbox {
    border-color: #2271b1;
}

.vt-checklist-checkbox.is-checked {
    background-color: #2271b1;
    border-color: #2271b1;
}

.vt-checklist-checkbox.is-checked::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 12px;
    height: 12px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

/* Content */
.vt-checklist-content {
    flex: 1;
    min-width: 0;
}

/* Title */
.vt-checklist-title {
    font-size: 16px;
    font-weight: 500;
    color: #333333;
    line-height: 1.4;
    transition: all 0.2s ease;
}

.vt-checklist-item.is-checked .vt-checklist-title {
    color: #888888;
    text-decoration: line-through;
}

/* Description */
.vt-checklist-description {
    font-size: 14px;
    color: #666666;
    line-height: 1.5;
    margin-top: 4px;
    transition: all 0.2s ease;
}

.vt-checklist-item.is-checked .vt-checklist-description {
    color: #999999;
}

/* Timestamp */
.vt-checklist-timestamp {
    font-size: 12px;
    color: #999999;
    margin-top: 6px;
}

/* Loading State */
.vt-checklist-item.is-loading {
    pointer-events: none;
    opacity: 0.6;
}

.vt-checklist-item.is-loading .vt-checklist-checkbox::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 14px;
    height: 14px;
    margin-top: -7px;
    margin-left: -7px;
    border: 2px solid #2271b1;
    border-top-color: transparent;
    border-radius: 50%;
    animation: vt-checklist-spin 0.6s linear infinite;
}

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

/* Disabled State */
.vt-checklist-item:not(.can-check) {
    cursor: default;
}

.vt-checklist-item:not(.can-check) .vt-checklist-checkbox {
    cursor: default;
}

/* Animation for check state */
.vt-checklist-checkbox {
    transform: scale(1);
}

.vt-checklist-item.can-check:active .vt-checklist-checkbox {
    transform: scale(0.9);
}

/* Backend Editor Styles */
.vt-checklist-input .vt-checklist-items {
    margin-bottom: 15px;
}

.vt-checklist-input .vt-checklist-item-row {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
    padding: 10px;
    background: #f9f9f9;
    border-radius: 6px;
}

.vt-checklist-input .vt-checklist-item-inputs {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.vt-checklist-input .vt-checklist-title-input,
.vt-checklist-input .vt-checklist-desc-input {
    width: 100%;
}
