* {
    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;
    padding: 20px;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

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

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

.tagline {
    font-size: 1.2rem;
    opacity: 0.9;
}

main {
    background: white;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.upload-section {
    margin-bottom: 30px;
}

.upload-box {
    border: 3px dashed #667eea;
    border-radius: 15px;
    padding: 60px 40px;
    text-align: center;
    transition: all 0.3s ease;
    background: #f8f9ff;
}

.upload-box:hover {
    border-color: #764ba2;
    background: #f0f2ff;
    transform: scale(1.01);
}

.upload-box.dragover {
    border-color: #764ba2;
    background: #e8ebff;
    transform: scale(1.02);
}

.upload-label {
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    color: #667eea;
}

.upload-label svg {
    transition: transform 0.3s ease;
}

.upload-label:hover svg {
    transform: translateY(-5px);
}

.upload-label span {
    display: block;
    font-size: 1.1rem;
    font-weight: 500;
}

.upload-hint {
    font-size: 0.9rem !important;
    color: #999;
    font-weight: 400 !important;
}

.controls {
    display: flex;
    flex-direction: column;
    gap: 15px;
    align-items: center;
    margin: 30px 0;
}

.model-selector {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
    max-width: 400px;
}

.model-selector label {
    font-weight: 600;
    color: #667eea;
}

.model-dropdown {
    padding: 10px 15px;
    border: 2px solid #667eea;
    border-radius: 8px;
    font-size: 1rem;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
}

.model-dropdown:hover {
    border-color: #764ba2;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.2);
}

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

.btn-group {
    display: flex;
    gap: 15px;
    width: 100%;
    max-width: 400px;
}

.btn-group .btn {
    flex: 1;
}

.info-box {
    background: #dbeafe;
    border: 2px solid #3b82f6;
    border-radius: 8px;
    padding: 12px;
    margin-top: 10px;
    font-size: 0.9rem;
    color: #1e40af;
    text-align: center;
}


.btn {
    padding: 12px 30px;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

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

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-secondary {
    background: #e0e7ff;
    color: #667eea;
}

.btn-secondary:hover {
    background: #c7d2fe;
    transform: translateY(-2px);
}

.btn-download {
    background: #10b981;
    color: white;
    margin-top: 15px;
}

.btn-download:hover {
    background: #059669;
    transform: translateY(-2px);
}

.btn-loader {
    display: inline-flex;
    align-items: center;
}

.btn-loader::after {
    content: '';
    width: 12px;
    height: 12px;
    border: 2px solid #ffffff;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-left: 8px;
}

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

.canvas-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-top: 30px;
}

.canvas-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.canvas-wrapper h3 {
    margin-bottom: 15px;
    color: #667eea;
    font-size: 1.3rem;
}

canvas {
    max-width: 100%;
    height: auto;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    background: #f8f9ff;
}

.status {
    text-align: center;
    margin-top: 20px;
    padding: 15px;
    border-radius: 10px;
    font-weight: 500;
}

.status.info {
    background: #dbeafe;
    color: #1e40af;
}

.status.success {
    background: #d1fae5;
    color: #065f46;
}

.status.error {
    background: #fee2e2;
    color: #991b1b;
}

footer {
    text-align: center;
    margin-top: 30px;
    color: white;
    opacity: 0.8;
    font-size: 0.9rem;
}

@media (max-width: 768px) {
    header h1 {
        font-size: 2.5rem;
    }

    main {
        padding: 25px;
    }

    .canvas-container {
        grid-template-columns: 1fr;
    }

    .controls {
        width: 100%;
    }

    .btn-group {
        flex-direction: column;
    }

    .btn {
        width: 100%;
    }
}
