* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

header {
    background: white;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

header h1 {
    font-size: 28px;
    margin-bottom: 15px;
    color: #667eea;
}

.controls {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    align-items: center;
}

#modelSelector {
    padding: 10px 15px;
    border: 2px solid #667eea;
    border-radius: 8px;
    background: white;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: #333;
    transition: all 0.3s ease;
    min-width: 200px;
}

#modelSelector:hover {
    border-color: #764ba2;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

#modelSelector:focus {
    outline: none;
    border-color: #764ba2;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

#fileInput {
    padding: 10px 15px;
    border: 2px dashed #667eea;
    border-radius: 8px;
    background: #f8f9fa;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
}

#fileInput:hover {
    background: #e9ecef;
    border-color: #764ba2;
}

#resetView {
    padding: 10px 20px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
}

#resetView:hover {
    background: #764ba2;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.zoom-controls {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-left: 10px;
    padding-left: 15px;
    border-left: 2px solid #e9ecef;
}

#zoomIn, #zoomOut {
    padding: 10px 15px;
    background: #28a745;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    transition: all 0.3s ease;
    min-width: 50px;
}

#zoomOut {
    background: #dc3545;
}

#zoomIn:hover {
    background: #218838;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

#zoomOut:hover {
    background: #c82333;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.ar-button {
    padding: 10px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
    margin-left: 10px;
}

.ar-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

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

.qr-modal-content {
    background: white;
    padding: 30px;
    border-radius: 20px;
    max-width: 400px;
    width: 90%;
    text-align: center;
    position: relative;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.qr-close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 28px;
    font-weight: bold;
    color: #999;
    cursor: pointer;
    transition: color 0.3s;
}

.qr-close:hover {
    color: #333;
}

.qr-modal-content h2 {
    color: #667eea;
    margin-bottom: 15px;
    font-size: 24px;
}

.qr-modal-content p {
    color: #666;
    margin-bottom: 20px;
    font-size: 14px;
}

#qrcode {
    display: flex;
    justify-content: center;
    margin: 20px 0;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
}

.qr-link {
    color: #666;
    font-size: 12px;
    margin-top: 15px;
    display: block;
}

.ar-link {
    display: block;
    color: #667eea;
    text-decoration: none;
    word-break: break-all;
    margin: 10px 0;
    font-size: 12px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 5px;
}

.ar-link:hover {
    text-decoration: underline;
}

.open-ar-button {
    margin-top: 15px;
    padding: 12px 24px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
    width: 100%;
}

.open-ar-button:hover {
    background: #764ba2;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

#canvas-container {
    width: 100%;
    height: 70vh;
    min-height: 500px;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
    position: relative;
    overflow: hidden;
}

#canvas-container canvas {
    display: block;
    width: 100%;
    height: 100%;
}

#loadingIndicator {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    z-index: 10;
    color: white;
    font-size: 16px;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.info {
    background: white;
    border-radius: 12px;
    padding: 15px;
    margin-top: 20px;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.info p {
    color: #666;
    font-size: 14px;
}

/* Zone de drop */
#canvas-container.drag-over {
    background: #2a2a2a;
    border: 3px dashed #667eea;
}

.version-info {
    position: fixed;
    bottom: 10px;
    right: 10px;
    background: rgba(255, 255, 255, 0.9);
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 11px;
    color: #666;
    font-family: 'Courier New', monospace;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    z-index: 100;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.version-info:hover {
    background: rgba(255, 255, 255, 1);
    color: #333;
}

@media (max-width: 768px) {
    header h1 {
        font-size: 22px;
    }
    
    #canvas-container {
        height: 60vh;
        min-height: 400px;
    }
    
    .version-info {
        font-size: 10px;
        padding: 4px 8px;
        bottom: 5px;
        right: 5px;
    }
}
