/* Fence Estimator Custom Styles */

#canvas-container {
    border: 1px solid #e5e7eb;
    position: relative;
    overflow: hidden;
}

.tool-btn.btn-primary {
    background-color: #3b82f6;
    border-color: #3b82f6;
    color: white;
}

.properties-panel-enter {
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.estimate-item {
    transition: all 0.2s ease;
}

.estimate-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    background-color: #f1f5f9;
}

.estimate-item.highlighted {
    background-color: #fef3c7;
    border: 2px solid #fbbf24;
}

.estimate-item .btn-xs {
    opacity: 0;
    transition: opacity 0.2s ease;
}

.estimate-item:hover .btn-xs {
    opacity: 1;
}

.modal-open {
    display: flex !important;
    align-items: center;
    justify-content: center;
}

.konvajs-content {
    background-color: white;
}

/* Dimension label improvements */
.dimension-label {
    cursor: pointer;
    transition: all 0.2s ease;
}

.dimension-label:hover {
    transform: scale(1.1);
}

/* Corner snap indicator */
.corner-snap-indicator {
    position: absolute;
    width: 8px;
    height: 8px;
    background-color: #10b981;
    border: 2px solid #059669;
    border-radius: 50%;
    pointer-events: none;
    z-index: 900;
    transform: translate(-50%, -50%);
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
    50% { transform: translate(-50%, -50%) scale(1.2); opacity: 0.7; }
    100% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
}

/* Zoom controls */
#zoom-controls {
    user-select: none;
    z-index: 950;
}

/* Modal z-index hierarchy */
.modal {
    z-index: 1000;
}

.modal-box {
    z-index: 1001;
}

#zoom-controls button {
    min-height: 32px;
    width: 40px;
    padding: 4px;
    font-size: 12px;
}

#zoom-indicator {
    padding: 2px 4px;
    background-color: #f8fafc;
    border-radius: 4px;
    border: 1px solid #e2e8f0;
    margin-top: 4px;
}

/* Canvas cursor styles */
.konvajs-content {
    cursor: default;
}

.konvajs-content.panning {
    cursor: grab !important;
}

.konvajs-content.panning:active {
    cursor: grabbing !important;
}

/* Corner point styles */
.corner-point {
    transition: all 0.2s ease;
}

.corner-point:hover {
    transform: scale(1.2);
}

.corner-point.selected {
    animation: pulse-corner 1s infinite;
}

@keyframes pulse-corner {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.3); opacity: 0.8; }
    100% { transform: scale(1); opacity: 1; }
}

/* Connection instruction */
#connection-instruction {
    animation: slideInDown 0.3s ease-out;
}

@keyframes slideInDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Responsive adjustments */
@media (max-width: 1024px) {
    .w-64 {
        width: 12rem;
    }
    
    .w-96 {
        width: 20rem;
    }
}

@media (max-width: 768px) {
    .flex {
        flex-direction: column;
    }
    
    .w-64, .w-96 {
        width: 100%;
    }
    
    #canvas-container {
        height: 400px;
    }
}
