/* dom-preview-popup.css - Using Theme Variables */

.dom-preview-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 0;
    height: 0;
    pointer-events: none;
    z-index: 1000;
}

.dom-preview-popup {
    position: fixed;
    width: 375px;
    min-height: 120px;
    max-height: 450px;
    background: var(--surface-glass, #1a1a2e);
    border: 2px solid var(--accent, #666);
    border-radius: var(--radius-md, 6px);
    box-shadow: var(--shadow-lg, 0 4px 20px rgba(0, 0, 0, 0.3));
    pointer-events: auto;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    backdrop-filter: blur(10px);
}

/* Header */
.dom-preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 14px;
    border-bottom: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.1));
    flex-shrink: 0;
}

.dom-preview-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary, #fff);
}

.dom-preview-pin {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: var(--radius-sm, 4px);
    cursor: pointer;
    color: var(--text-muted, #888);
    transition: all var(--transition-fast, 0.15s);
}

.dom-preview-pin:hover {
    background: var(--surface-elevated, rgba(255, 255, 255, 0.1));
    color: var(--text-primary, #fff);
}

.dom-preview-pin.pinned {
    color: var(--accent, #4a9eff);
    background: var(--accent-subtle, rgba(74, 158, 255, 0.15));
}

.dom-preview-pin.pinned:hover {
    background: var(--accent-subtle, rgba(74, 158, 255, 0.25));
}

/* Content area */
.dom-preview-content {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* Loading state */
.dom-preview-loading {
    padding: 20px;
    text-align: center;
    color: var(--text-muted, #888);
    font-size: 13px;
}

/* Empty state */
.dom-preview-empty {
    padding: 20px;
    text-align: center;
    color: var(--text-muted, #888);
    font-size: 13px;
    font-style: italic;
}

/* Checklist */
.dom-preview-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px 0;
    max-height: 270px;
}

.dom-preview-list::-webkit-scrollbar {
    width: 6px;
}

.dom-preview-list::-webkit-scrollbar-track {
    background: transparent;
}

.dom-preview-list::-webkit-scrollbar-thumb {
    background: var(--border-default, rgba(255, 255, 255, 0.2));
    border-radius: 3px;
}

.dom-preview-list::-webkit-scrollbar-thumb:hover {
    background: var(--border-hover, rgba(255, 255, 255, 0.3));
}

.dom-preview-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 14px;
    cursor: pointer;
    transition: background var(--transition-fast, 0.15s);
}

.dom-preview-item:hover {
    background: var(--surface-elevated, rgba(255, 255, 255, 0.05));
}

/* Custom checkbox styling - green square when checked */
.dom-preview-item input[type="checkbox"] {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    min-width: 18px;
    margin: 0;
    cursor: pointer;
    border: 2px solid var(--border-default, rgba(255, 255, 255, 0.3));
    border-radius: 4px;
    background: transparent;
    flex-shrink: 0;
    position: relative;
    transition: all 0.15s ease;
}

.dom-preview-item input[type="checkbox"]:hover {
    border-color: var(--accent, #4a9eff);
}

.dom-preview-item input[type="checkbox"]:checked {
    background: #22c55e;
    border-color: #22c55e;
}

.dom-preview-item input[type="checkbox"]:checked::after {
    content: '';
    position: absolute;
    left: 5px;
    top: 2px;
    width: 5px;
    height: 9px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.dom-preview-item-text {
    font-size: 14px;
    color: var(--text-primary, #fff);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    line-height: 1.3;
}

.dom-preview-item.completed .dom-preview-item-text {
    color: var(--text-muted, #888);
    text-decoration: line-through;
}

/* Image preview */
.dom-preview-image-container {
    padding: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
    overflow: hidden;
}

.dom-preview-image {
    max-width: 100%;
    max-height: 300px;
    object-fit: contain;
    border-radius: var(--radius-sm, 4px);
}

/* Animation for popup appearance - opacity only, transform handled by JS */
.dom-preview-popup {
    animation: previewFadeIn 0.15s ease-out;
}

@keyframes previewFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Time/day badges for calendar events */
.dom-preview-item-meta {
    font-size: 10px;
    color: var(--text-muted, #666);
    background: var(--surface-elevated, rgba(255, 255, 255, 0.1));
    padding: 2px 6px;
    border-radius: 3px;
    flex-shrink: 0;
}

/* Progress bar in checklist popup */
.dom-preview-progress {
    padding: 10px 14px;
    border-bottom: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.1));
}

.dom-preview-progress .progress-bar-container {
    height: 6px;
    background: var(--surface-elevated, rgba(255, 255, 255, 0.1));
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 6px;
}

.dom-preview-progress .progress-bar-fill {
    height: 100%;
    background: #22c55e;
    border-radius: 3px;
    transition: width 0.3s ease;
}

.dom-preview-progress .progress-text {
    font-size: 11px;
    color: var(--text-muted, #888);
}

/* Comments list styling */
.dom-preview-comments {
    padding: 0;
}

.dom-preview-comment {
    padding: 10px 14px;
    border-bottom: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.08));
}

.dom-preview-comment:last-child {
    border-bottom: none;
}

.dom-preview-comment-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.dom-preview-comment-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #6366f1;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 600;
    flex-shrink: 0;
}

.dom-preview-comment-meta {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.dom-preview-comment-user {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary, #fff);
}

.dom-preview-comment-time {
    font-size: 10px;
    color: var(--text-muted, #888);
}

.dom-preview-comment-text {
    font-size: 13px;
    color: var(--text-secondary, #ccc);
    line-height: 1.4;
    padding-left: 32px;
    word-wrap: break-word;
}