/* Editor Styles */
.font-playfair { font-family: 'Playfair Display', serif; }
.font-inter { font-family: 'Inter', sans-serif; }
.font-dancing { font-family: 'Dancing Script', cursive; }
.font-montserrat { font-family: 'Montserrat', sans-serif; }

/* Editor Canvas */
#invitation-canvas {
    transition: transform 0.3s ease;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

/* Editable Elements */
.editable-element {
    transition: all 0.2s ease;
    border-radius: 4px;
    position: relative;
}

.editable-element:hover {
    background-color: rgba(99, 102, 241, 0.05);
}

.editable-element:focus {
    outline: 2px solid #6366f1;
    outline-offset: 2px;
    background-color: rgba(99, 102, 241, 0.05);
}

.editable-element.selected {
    outline: 2px solid #6366f1;
    outline-offset: 2px;
    background-color: rgba(99, 102, 241, 0.1);
}

/* Placeholder text for empty elements */
.editable-element:empty:before {
    content: attr(data-placeholder);
    color: #9ca3af;
    font-style: italic;
}

/* Draggable Elements */
.draggable {
    cursor: move;
    user-select: none;
}

.draggable:hover {
    opacity: 0.8;
}

.dragging {
    opacity: 0.5;
    z-index: 1000;
}

/* Drop Zones */
.drop-zone {
    border: 2px dashed #d1d5db;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.drop-zone.drag-over {
    border-color: #6366f1;
    background-color: rgba(99, 102, 241, 0.05);
}

/* Element Selection Handles */
.selection-handle {
    position: absolute;
    width: 8px;
    height: 8px;
    background: #6366f1;
    border: 2px solid white;
    border-radius: 50%;
    cursor: nw-resize;
}

.selection-handle.nw { top: -4px; left: -4px; }
.selection-handle.ne { top: -4px; right: -4px; cursor: ne-resize; }
.selection-handle.sw { bottom: -4px; left: -4px; cursor: sw-resize; }
.selection-handle.se { bottom: -4px; right: -4px; cursor: se-resize; }

/* Color Picker */
.color-picker {
    transition: all 0.2s ease;
}

.color-picker:hover {
    transform: scale(1.1);
}

.color-picker.selected {
    transform: scale(1.2);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.8);
}

/* Font Preview */
.font-preview {
    padding: 8px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.font-preview:hover {
    border-color: #6366f1;
    background-color: rgba(99, 102, 241, 0.05);
}

.font-preview.selected {
    border-color: #6366f1;
    background-color: rgba(99, 102, 241, 0.1);
}

/* Property Panel */
.property-group {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 12px;
}

.property-group h4 {
    font-weight: 600;
    margin-bottom: 12px;
    color: #374151;
}

/* Slider Controls */
.slider-control {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.slider-control input[type="range"] {
    flex: 1;
    height: 4px;
    border-radius: 2px;
    background: #e5e7eb;
    outline: none;
    -webkit-appearance: none;
}

.slider-control input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #6366f1;
    cursor: pointer;
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.slider-control input[type="range"]::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #6366f1;
    cursor: pointer;
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Animation Classes */
.fade-in {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.slide-in {
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from { opacity: 0; transform: translateX(-20px); }
    to { opacity: 1; transform: translateX(0); }
}

/* Canvas Zoom */
.canvas-container {
    transition: transform 0.3s ease;
    transform-origin: center center;
}

/* 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.6),
        transparent
    );
    animation: loading 1.5s infinite;
}

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

/* Toolbar */
.toolbar {
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    padding: 8px;
    display: flex;
    gap: 4px;
}

.toolbar button {
    padding: 8px 12px;
    border: none;
    background: transparent;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #6b7280;
}

.toolbar button:hover {
    background: #f3f4f6;
    color: #374151;
}

.toolbar button.active {
    background: #6366f1;
    color: white;
}

/* Context Menu */
.context-menu {
    position: fixed;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
    padding: 8px 0;
    z-index: 1000;
    min-width: 150px;
}

.context-menu-item {
    padding: 8px 16px;
    cursor: pointer;
    font-size: 14px;
    color: #374151;
    transition: background-color 0.2s ease;
}

.context-menu-item:hover {
    background: #f3f4f6;
}

.context-menu-item.disabled {
    color: #9ca3af;
    cursor: not-allowed;
}

.context-menu-separator {
    height: 1px;
    background: #e5e7eb;
    margin: 4px 0;
}

/* Responsive Design */
@media (max-width: 1280px) {
    .w-80 {
        width: 16rem;
    }
}

@media (max-width: 1024px) {
    .w-80 {
        width: 14rem;
    }
    
    #invitation-canvas {
        width: 300px !important;
        height: 450px !important;
    }
}

@media (max-width: 768px) {
    .flex {
        flex-direction: column;
    }
    
    .w-80 {
        width: 100%;
        height: auto;
        max-height: 40vh;
    }
    
    #invitation-canvas {
        width: 280px !important;
        height: 420px !important;
    }
}
