/**
 * Geometry Analysis Tooltip Styles
 * Mouse-following tooltip for 3D mesh analysis results
 */

.geometry-tooltip {
    position: absolute;
    z-index: 10000;
    background: rgba(255, 255, 255, 0.98);
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(20px);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 13px;
    line-height: 1.4;
    max-width: 320px;
    min-width: 280px;
    opacity: 0;
    transform: translateY(10px) scale(0.95);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}

.geometry-tooltip.show {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.geometry-tooltip.error {
    border-color: #ff6b6b;
    background: rgba(255, 245, 245, 0.98);
}

/* Header */
.tooltip-header {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid #f0f0f0;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 12px 12px 0 0;
    position: relative;
}

.tooltip-header.error {
    background: linear-gradient(135deg, #ffe0e0 0%, #ffcccb 100%);
    border-bottom-color: #ffb3b3;
}

.tooltip-icon {
    font-size: 18px;
    margin-right: 8px;
    display: flex;
    align-items: center;
}

.tooltip-title {
    font-weight: 600;
    color: #2c3e50;
    flex: 1;
    font-size: 14px;
}

.tooltip-close {
    position: absolute;
    top: 8px;
    right: 12px;
    background: none;
    border: none;
    font-size: 20px;
    color: #666;
    cursor: pointer;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.tooltip-close:hover {
    background: rgba(0, 0, 0, 0.1);
    color: #333;
}

/* Content */
.tooltip-content {
    padding: 16px;
}

.tooltip-section {
    margin-bottom: 16px;
}

.tooltip-section:last-child {
    margin-bottom: 0;
}

.section-title {
    font-weight: 600;
    color: #34495e;
    margin-bottom: 8px;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
}

.section-value {
    color: #2980b9;
    font-weight: 500;
    font-size: 14px;
    padding: 6px 12px;
    background: rgba(52, 152, 219, 0.1);
    border-radius: 6px;
    border-left: 3px solid #3498db;
}

/* Properties Grid */
.properties-grid {
    display: grid;
    gap: 6px;
}

.property-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    border-bottom: 1px solid #f8f9fa;
}

.property-item:last-child {
    border-bottom: none;
}

.property-label {
    color: #7f8c8d;
    font-size: 12px;
    font-weight: 500;
}

.property-value {
    color: #2c3e50;
    font-weight: 600;
    font-size: 12px;
    background: rgba(52, 152, 219, 0.1);
    padding: 2px 8px;
    border-radius: 4px;
}

/* Mesh Details */
.mesh-details {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.detail-item {
    background: rgba(155, 89, 182, 0.1);
    color: #8e44ad;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
    border: 1px solid rgba(155, 89, 182, 0.2);
}

/* Animations */
@keyframes tooltipSlideIn {
    from {
        opacity: 0;
        transform: translateY(15px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes tooltipSlideOut {
    from {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    to {
        opacity: 0;
        transform: translateY(-10px) scale(0.95);
    }
}

/* Responsive */
@media (max-width: 768px) {
    .geometry-tooltip {
        max-width: 280px;
        min-width: 240px;
        font-size: 12px;
    }
    
    .tooltip-header {
        padding: 10px 14px;
    }
    
    .tooltip-content {
        padding: 14px;
    }
    
    .tooltip-title {
        font-size: 13px;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .geometry-tooltip {
        background: rgba(45, 45, 45, 0.98);
        border-color: #555;
        color: #e0e0e0;
    }
    
    .tooltip-header {
        background: linear-gradient(135deg, #3a3a3a 0%, #2a2a2a 100%);
        border-bottom-color: #555;
    }
    
    .tooltip-title {
        color: #e0e0e0;
    }
    
    .section-title {
        color: #b0b0b0;
    }
    
    .section-value {
        background: rgba(52, 152, 219, 0.2);
        color: #5dade2;
    }
    
    .property-label {
        color: #999;
    }
    
    .property-value {
        background: rgba(52, 152, 219, 0.2);
        color: #e0e0e0;
    }
    
    .detail-item {
        background: rgba(155, 89, 182, 0.2);
        color: #bb8fce;
        border-color: rgba(155, 89, 182, 0.3);
    }

    .copy-coordinates-btn {
        background: linear-gradient(135deg, #4a90e2 0%, #357abd 100%);
    }

    .copy-coordinates-btn:hover {
        background: linear-gradient(135deg, #357abd 0%, #2968a3 100%);
    }
}

/* Copy coordinates button */
.copy-coordinates-btn {
    width: 100%;
    padding: 10px 16px;
    background: linear-gradient(135deg, #2196f3 0%, #1976d2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 8px;
}

.copy-coordinates-btn:hover {
    background: linear-gradient(135deg, #1976d2 0%, #1565c0 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(33, 150, 243, 0.3);
}

.copy-coordinates-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(33, 150, 243, 0.2);
}
