* {
    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;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #333;
}

#app {
    width: 100%;
    height: 100vh;
    position: relative;
}

/* Upload Panel */
.panel {
    background: white;
    border-radius: 20px;
    padding: 40px;
    max-width: 600px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    text-align: center;
}

.panel h1 {
    color: #667eea;
    margin-bottom: 10px;
    font-size: 2.5em;
    font-weight: 700;
}

.panel p {
    color: #666;
    margin-bottom: 30px;
    font-size: 1.1em;
}

/* Upload Area */
.upload-area {
    margin: 30px 0;
}

.upload-button {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    border: 3px dashed #667eea;
    border-radius: 15px;
    background: #f8f9ff;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #667eea;
}

.upload-button:hover {
    background: #eef0ff;
    border-color: #764ba2;
    transform: translateY(-2px);
}

.upload-button:active {
    transform: translateY(0);
}

.upload-button svg {
    margin-bottom: 15px;
}

.upload-button span {
    font-size: 1.1em;
    font-weight: 500;
}

.upload-area.drag-over {
    border-color: #764ba2;
    background: #eef0ff;
}

/* Preview Container */
.preview-container {
    margin-top: 20px;
    position: relative;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.preview-container img {
    width: 100%;
    height: auto;
    display: block;
    max-height: 400px;
    object-fit: contain;
    background: #f5f5f5;
}

.remove-button {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(255, 0, 0, 0.8);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
}

.remove-button:hover {
    background: rgba(255, 0, 0, 1);
    transform: scale(1.05);
}

/* Buttons */
.start-button, .stop-button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 15px 40px;
    font-size: 1.2em;
    font-weight: 600;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
    margin-top: 20px;
    width: 100%;
}

.start-button:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.6);
}

.start-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.stop-button, .toggle-button {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    box-shadow: 0 5px 15px rgba(245, 87, 108, 0.4);
}

.stop-button:hover, .toggle-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(245, 87, 108, 0.6);
}

.toggle-button {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    box-shadow: 0 5px 15px rgba(79, 172, 254, 0.4);
    margin-bottom: 10px;
}

.toggle-button:hover {
    box-shadow: 0 8px 20px rgba(79, 172, 254, 0.6);
}

/* Error Message */
.error-message {
    margin-top: 20px;
    padding: 15px;
    background: #fee;
    color: #c33;
    border-radius: 8px;
    display: none;
    font-weight: 500;
    white-space: pre-line;
    text-align: left;
    max-height: 300px;
    overflow-y: auto;
    font-size: 0.9em;
    line-height: 1.6;
}

/* AR Container */
.ar-container {
    width: 100%;
    height: 100vh;
    position: relative;
    background: #000;
}

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

.ar-controls {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.info-text {
    color: white;
    background: rgba(0, 0, 0, 0.6);
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 0.9em;
    backdrop-filter: blur(10px);
}

/* Loading Indicator */
.loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    color: white;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading p {
    font-size: 1.2em;
    font-weight: 500;
}

/* Responsive */
@media (max-width: 768px) {
    .panel {
        padding: 30px 20px;
    }

    .panel h1 {
        font-size: 2em;
    }

    .upload-button {
        padding: 30px 20px;
    }
}

