.page-builder-header {
    display: flex;
    gap: 15px;
    margin-bottom: 30px;
    align-items: center;
    flex-wrap: wrap;
}

#add-element-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 14px 28px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    position: relative;
    overflow: hidden;
}

#add-element-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

#add-element-btn:hover::before {
    width: 300px;
    height: 300px;
}

#add-element-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
}

#add-element-btn:active {
    transform: translateY(0);
}

.btn-save {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3);
}

.btn-save:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(40, 167, 69, 0.4);
}

.btn-save.has-changes {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3);
    }
    50% {
        box-shadow: 0 4px 25px rgba(40, 167, 69, 0.6);
    }
}

.page-elements-list {
    min-height: 200px;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border: 2px dashed #dee2e6;
    border-radius: 16px;
    padding: 25px;
    transition: all 0.3s ease;
}

.page-elements-list:has(.page-element:hover) {
    border-color: #667eea;
    background: linear-gradient(135deg, #f8f9ff 0%, #ffffff 100%);
}

.page-element {
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 14px;
    padding: 18px 20px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 18px;
    cursor: move;
    transition: all 0.3s ease;
    position: relative;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.page-element:hover {
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.15);
    border-color: #667eea;
    transform: translateX(-3px);
}

.page-element.dragging {
    opacity: 0.6;
    transform: scale(0.98) rotate(2deg);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
    z-index: 1000;
}

.page-element.drag-over {
    border-color: #28a745;
    background: linear-gradient(90deg, #f0fff4 0%, #ffffff 100%);
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.2);
}

.element-drag-handle {
    color: #9ca3af;
    cursor: grab;
    font-size: 20px;
    transition: all 0.2s ease;
    padding: 8px;
    border-radius: 8px;
}

.element-drag-handle:hover {
    color: #667eea;
    background: #f8f9ff;
}

.element-drag-handle:active {
    cursor: grabbing;
    color: #764ba2;
}

.element-icon {
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    color: white;
    font-size: 22px;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.page-element[data-type="wp-story-box"] .element-icon {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    box-shadow: 0 4px 12px rgba(245, 87, 108, 0.3);
}

.element-info {
    flex: 1;
    min-width: 0;
}

.element-title {
    font-weight: 600;
    color: #212529;
    margin-bottom: 6px;
    font-size: 16px;
}

.element-type {
    font-size: 13px;
    color: #6c757d;
    font-weight: 400;
}

.element-actions {
    display: flex;
    gap: 8px;
}

.element-btn {
    background: none;
    border: none;
    color: #6c757d;
    cursor: pointer;
    padding: 10px 12px;
    border-radius: 10px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
}

.element-btn:hover {
    background: #f8f9fa;
    color: #495057;
    transform: scale(1.1);
}

.element-btn.delete:hover {
    background: #fee;
    color: #dc3545;
    transform: scale(1.1);
}

.empty-state {
    text-align: center;
    padding: 60px 40px;
    color: #6c757d;
}

.empty-state i {
    font-size: 64px;
    margin-bottom: 20px;
    opacity: 0.4;
    color: #9ca3af;
}

.empty-state p {
    font-size: 16px;
    margin: 10px 0;
    color: #6c757d;
}

/* Drop Indicator */
.drop-indicator {
    background: linear-gradient(90deg, #28a745 0%, #20c997 100%);
    height: 4px;
    border-radius: 2px;
    box-shadow: 0 0 12px rgba(40, 167, 69, 0.8);
    margin: 8px 0;
    pointer-events: none;
    transition: all 0.3s ease;
    animation: dropPulse 1.5s infinite;
}

@keyframes dropPulse {
    0%, 100% {
        opacity: 1;
        transform: scaleX(1);
    }
    50% {
        opacity: 0.8;
        transform: scaleX(1.05);
    }
}

/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal.hidden {
    opacity: 0;
    visibility: hidden;
}

.modal:not(.hidden) {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: white;
    border-radius: 20px;
    width: 90%;
    max-width: 800px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    transform: scale(0.9) translateY(20px);
    transition: all 0.3s ease;
    overflow: hidden;
}

.modal:not(.hidden) .modal-content {
    transform: scale(1) translateY(0);
}

.modal-header {
    padding: 25px 30px;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.modal-header h3 {
    margin: 0;
    font-size: 22px;
    font-weight: 600;
}

.close-modal {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    font-size: 18px;
}

.close-modal:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

.modal-body {
    padding: 25px 30px;
    overflow-y: auto;
    flex: 1;
}

.element-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 25px;
    border-bottom: 2px solid #e9ecef;
    background: transparent;
}

.tab-btn {
    background: none;
    border: none;
    padding: 12px 24px;
    cursor: pointer;
    color: #6c757d;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 15px;
    font-weight: 500;
    border-radius: 8px 8px 0 0;
}

.tab-btn:hover {
    color: #495057;
    background: #f8f9fa;
}

.tab-btn.active {
    color: #667eea;
    border-bottom-color: #667eea;
    background: #f8f9ff;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.element-search {
    margin-bottom: 20px;
    position: relative;
}

.element-search input {
    width: 100%;
    padding: 14px 45px 14px 14px;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    font-size: 15px;
    transition: all 0.3s ease;
    background: #f8f9fa;
}

.element-search input:focus {
    outline: none;
    border-color: #667eea;
    background: white;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

.element-search::after {
    content: '\f002';
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    position: absolute;
    right: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: #6c757d;
    pointer-events: none;
}

.elements-list {
    max-height: 450px;
    overflow-y: auto;
    padding: 5px;
}

.elements-list::-webkit-scrollbar {
    width: 8px;
}

.elements-list::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.elements-list::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 10px;
}

.elements-list::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

.element-item {
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 15px;
    position: relative;
    overflow: hidden;
}

.element-item::before {
    content: '';
    position: absolute;
    right: 0;
    top: 0;
    width: 4px;
    height: 100%;
    background: transparent;
    transition: all 0.3s ease;
}

.element-item:hover {
    border-color: #667eea;
    background: linear-gradient(90deg, #f8f9ff 0%, #ffffff 100%);
    transform: translateX(-5px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
}

.element-item:hover::before {
    background: #667eea;
}

.element-item.selected {
    border-color: #28a745;
    background: linear-gradient(90deg, #f0fff4 0%, #ffffff 100%);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.2);
}

.element-item.selected::before {
    background: #28a745;
}

.element-item-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    color: white;
    font-size: 20px;
    flex-shrink: 0;
    box-shadow: 0 4px 10px rgba(102, 126, 234, 0.3);
}

.element-item[data-type="wp-story-box"] .element-item-icon {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    box-shadow: 0 4px 10px rgba(245, 87, 108, 0.3);
}

.element-item-info {
    flex: 1;
    min-width: 0;
}

.element-item-title {
    font-weight: 600;
    color: #212529;
    margin-bottom: 5px;
    font-size: 15px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.element-item-id {
    font-size: 12px;
    color: #6c757d;
    font-weight: 400;
}

