* {
    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, #ff7900 0%, #800080 100%);
    color: #333;
    min-height: 100vh;
}

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

header {
    text-align: center;
    margin-bottom: 30px;
    color: white;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

header p {
    font-size: 1.1rem;
    opacity: 0.9;
}

main {
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: 20px;
    height: calc(100vh - 200px);
}

.controls {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    overflow-y: auto;
}

.file-input-container {
    margin-bottom: 25px;
}

.button-group {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
}

.action-btn {
    flex: 1;
    padding: 12px 16px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.convert-btn {
    background: linear-gradient(90deg, #ff7900 0%, #800080 100%);
    color: white;
}

.convert-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.load-btn {
    background: linear-gradient(90deg, #ff7900 0%, #800080 100%);
    color: white;
}

.load-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(245, 87, 108, 0.4);
}

.btn-icon {
    font-size: 16px;
}

.file-info {
    text-align: center;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 6px;
    font-size: 14px;
    color: #666;
}

.file-info #fileName {
    font-weight: 500;
    color: #333;
}

.controls-panel {
    margin-bottom: 25px;
}

.control-group {
    margin-bottom: 15px;
}

.control-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #555;
}

.control-group input[type="range"] {
    width: 100%;
    margin-bottom: 5px;
}

.control-group span {
    font-size: 0.9rem;
    color: #777;
}

.control-group button {
    background: #ff7900;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    margin-right: 10px;
    transition: background 0.3s ease;
}

.control-group button:hover {
    background: #800080;
}

.info-panel {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
}

.info-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
}

.info-label {
    font-weight: 600;
    color: #555;
}

.canvas-container {
    position: relative;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    overflow: hidden;
}

#renderCanvas {
    width: 100%;
    height: 100%;
    display: block;
    outline: none;
}

.loading-indicator {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    display: none;
}

.loading-indicator.active {
    display: block;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

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

@media (max-width: 768px) {
    main {
        grid-template-columns: 1fr;
        height: auto;
    }
    
    .controls {
        order: 2;
    }
    
    .canvas-container {
        order: 1;
        height: 400px;
    }
    
    header h1 {
        font-size: 2rem;
    }
}
