/* ========================================
           ELEMENT SELECTION SYSTEM
           ======================================== */

        /* Editable elements in preview */
        [data-cv-element] {
            position: relative;
            cursor: pointer;
            transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
        }

        /* Hover state */
        [data-cv-element].cv-element-hover {
            outline: 2px dashed rgba(59, 130, 246, 0.5);
            outline-offset: 2px;
            background: rgba(59, 130, 246, 0.02);
        }

        /* Selected state */
        [data-cv-element].cv-element-selected {
            outline: 3px solid #8b5cf6 !important;
            outline-offset: 2px;
            box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.1);
            background: rgba(139, 92, 246, 0.03) !important;
        }

        /* Highlight animation (for temporary highlights) */
        [data-cv-element].cv-element-highlight {
            animation: elementHighlight 1s ease-out;
        }

        @keyframes elementHighlight {
            0%, 100% {
                outline: 3px solid transparent;
                background: transparent;
            }
            50% {
                outline: 3px solid #10b981;
                background: rgba(16, 185, 129, 0.1);
            }
        }

        /* Element badge (shows on hover) */
        [data-cv-element].cv-element-hover::before {
            content: attr(data-cv-type);
            position: absolute;
            top: -28px;
            left: 0;
            background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
            color: white;
            padding: 4px 10px;
            font-size: 11px;
            font-weight: 600;
            border-radius: 6px;
            text-transform: capitalize;
            z-index: 100;
            box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
            letter-spacing: 0.5px;
            pointer-events: none;
            white-space: nowrap;
        }

        /* Inline action buttons container */
        .inline-actions {
            position: absolute;
            top: -2px;
            right: -5px;
            display: flex;
            gap: 4px;
            z-index: 100;
            opacity: 0;
            transition: opacity 0.2s ease;
        }

        [data-cv-element]:hover .inline-actions {
            opacity: 1;
        }

        /* Inline action button */
        .inline-action-btn {
            width: 24px;
            height: 24px;
            background: white;
            border: 1px solid #e5e7eb;
            border-radius: 4px;
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            transition: all 0.2s ease;
            font-size: 11px;
            color: #6b7280;
            box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
        }

        .inline-action-btn:hover {
            background: #f9fafb;
            border-color: #8b5cf6;
            color: #8b5cf6;
            transform: scale(1.1);
        }

        .inline-action-btn:active {
            transform: scale(0.95);
        }

        /* Specific inline action colors */
        .inline-action-btn.delete:hover {
            border-color: #ef4444;
            color: #ef4444;
        }

        .inline-action-btn.duplicate:hover {
            border-color: #10b981;
            color: #10b981;
        }

        .inline-action-btn.move:hover {
            border-color: #f59e0b;
            color: #f59e0b;
            cursor: move;
        }

        /* Properties panel form fields */
        .form-field-group {
            margin-bottom: 1rem;
        }

        .form-field-group label {
            display: block;
            font-size: 0.875rem;
            font-weight: 500;
            margin-bottom: 0.375rem;
            color: var(--text-label);
        }

        .form-field-group input,
        .form-field-group textarea {
            width: 100%;
            padding: 0.625rem 0.875rem;
            border-radius: 8px;
            font-size: 0.875rem;
            transition: all 0.2s ease;
        }

        .form-field-group input:focus,
        .form-field-group textarea:focus {
            outline: none;
            border-color: #8b5cf6;
            box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
        }

        /* Disable selection styles for actual CV content (only show on hover/click) */
        /* Disable pointer events on children EXCEPT nested [data-cv-element] */
        #cv-preview [data-cv-element] *:not([data-cv-element]) {
            pointer-events: none;
        }

        #cv-preview [data-cv-element] {
            pointer-events: auto;
        }

        /* Ensure nested editable elements are clickable */
        #cv-preview [data-cv-element] [data-cv-element] {
            pointer-events: auto;
        }
