/* Element List Styles */
.element-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.element-item {
    padding: 1rem;
    background: #f7fafc;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    cursor: grab;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 500;
    color: #4a5568;
}

.element-item:hover {
    background: #edf2f7;
    border-color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
}

.element-item:active {
    cursor: grabbing;
    transform: scale(0.98);
}

.element-item i {
    color: #667eea;
    font-size: 1.2rem;
    width: 20px;
    text-align: center;
}

/* Properties Panel */
.properties-panel {
    background: #f7fafc;
    border-radius: 8px;
    padding: 1rem;
    min-height: 200px;
}

.no-selection {
    color: #a0aec0;
    font-style: italic;
    text-align: center;
    margin-top: 2rem;
}

.property-group {
    margin-bottom: 1.5rem;
}

.property-group h4 {
    color: #4a5568;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.property-input {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.property-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.color-input {
    width: 100%;
    height: 40px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
}

.range-input {
    width: 100%;
    margin: 0.5rem 0;
}

/* Card Template Styles */
.card-template {
    width: 300px;
    height: 420px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    position: relative;
    margin: 0 auto;
    overflow: hidden;
    border: 2px solid #e2e8f0;
}

.card-template.selected {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
}

.card-element {
    position: absolute;
    cursor: move;
    user-select: none;
}

.card-element.selected {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

.card-element:hover {
    outline: 1px solid #a0aec0;
    outline-offset: 1px;
}

/* Board Template Styles */
.board-template {
    width: 600px;
    height: 600px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    position: relative;
    margin: 0 auto;
    overflow: hidden;
    border: 2px solid #e2e8f0;
}

.board-template.selected {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
}

.board-element {
    position: absolute;
    cursor: move;
    user-select: none;
}

.board-element.selected {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

.board-element:hover {
    outline: 1px solid #a0aec0;
    outline-offset: 1px;
}

/* Grid System */
.grid-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    opacity: 0.3;
}

.grid-line {
    position: absolute;
    background: #e2e8f0;
}

.grid-line.horizontal {
    width: 100%;
    height: 1px;
}

.grid-line.vertical {
    height: 100%;
    width: 1px;
}

/* Element Types */
.text-element {
    padding: 0.5rem;
    border-radius: 4px;
    background: transparent;
    border: none;
    font-family: inherit;
    resize: none;
    overflow: hidden;
}

.text-element:focus {
    outline: none;
    background: rgba(102, 126, 234, 0.1);
}

.image-element {
    border-radius: 4px;
    object-fit: cover;
}

.shape-element {
    border-radius: 4px;
}

.icon-element {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: #667eea;
}

/* Drag and Drop States */
.drag-over {
    background: rgba(102, 126, 234, 0.1) !important;
    border-color: #667eea !important;
}

.dragging {
    opacity: 0.5;
    transform: rotate(5deg);
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow: hidden;
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    color: #4a5568;
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #a0aec0;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.modal-close:hover {
    background: #f7fafc;
    color: #4a5568;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    padding: 1.5rem;
    border-top: 1px solid #e2e8f0;
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

/* Image Upload Styles */
.image-preview {
    margin-top: 1rem;
    text-align: center;
}

.image-preview img {
    max-width: 100%;
    max-height: 200px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Loading States */
.loading {
    position: relative;
    overflow: hidden;
}

.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* Success/Error States */
.success {
    background: #48bb78 !important;
    color: white !important;
}

.error {
    background: #f56565 !important;
    color: white !important;
}

/* Responsive Components */
@media (max-width: 768px) {
    .card-template {
        width: 250px;
        height: 350px;
    }
    
    .board-template {
        width: 400px;
        height: 400px;
    }
    
    .modal-content {
        width: 95%;
        margin: 1rem;
    }
    
    .modal-header,
    .modal-body,
    .modal-footer {
        padding: 1rem;
    }
}
