* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1600px;
    margin: 0 auto;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.1);
    overflow: hidden;
}

.header {
    background: linear-gradient(135deg, #4285f4 0%, #34a853 50%, #fbbc05 75%, #ea4335 100%);
    color: white;
    padding: 30px;
    text-align: center;
}

.header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    font-weight: 700;
}

.header p {
    font-size: 1.1rem;
    opacity: 0.9;
}

.main-content {
    display: grid;
    grid-template-columns: 500px 1fr;
    gap: 30px;
    padding: 30px;
}

.drawing-section {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.canvas-container {
    position: relative;
    border: 3px solid #e0e0e0;
    border-radius: 15px;
    overflow: hidden;
    background: #fafafa;
    box-shadow: inset 0 2px 10px rgba(0,0,0,0.05);
}

#drawingCanvas {
    display: block;
    cursor: crosshair;
    background: white;
}

.controls {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    align-items: center;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 15px;
    border: 1px solid #e9ecef;
}

.control-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.control-group label {
    font-weight: 600;
    color: #495057;
    font-size: 0.9rem;
}

input[type="range"] {
    width: 100px;
    accent-color: #4285f4;
}

input[type="color"] {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.btn-primary {
    background: linear-gradient(135deg, #4285f4 0%, #34a853 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(66, 133, 244, 0.4);
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
    transform: translateY(-2px);
}

.results-section {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.generate-section {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 15px;
    border: 1px solid #e9ecef;
    text-align: center;
}

.generate-section h3 {
    color: #495057;
    margin-bottom: 15px;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.gemini-logo {
    font-size: 1.5rem;
}

.render-results {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 15px;
    border: 1px solid #e9ecef;
    min-height: 600px;
}

.render-results h3 {
    color: #495057;
    margin-bottom: 20px;
    font-size: 1.2rem;
}

.loading {
    display: none;
    text-align: center;
    padding: 40px;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #e9ecef;
    border-top: 4px solid #4285f4;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.result-content {
    display: none;
}

.result-grid {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 20px;
}

.rendered-image-container {
    background: white;
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    text-align: center;
}

.rendered-image-container h4 {
    color: #495057;
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.rendered-image {
    max-width: 100%;
    max-height: 400px;
    border-radius: 10px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    margin-bottom: 15px;
}

.image-placeholder {
    width: 100%;
    height: 300px;
    background: #f8f9fa;
    border: 2px dashed #dee2e6;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6c757d;
    font-size: 1.1rem;
    text-align: center;
    padding: 20px;
}

.result-info {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.info-card {
    background: white;
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.info-card h4 {
    color: #495057;
    margin-bottom: 10px;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.score-display {
    font-size: 2.5rem;
    font-weight: bold;
    color: #4285f4;
    text-align: center;
    padding: 20px;
    background: linear-gradient(135deg, rgba(66, 133, 244, 0.1) 0%, rgba(52, 168, 83, 0.1) 100%);
    border-radius: 10px;
}

.prediction-text {
    font-size: 1.2rem;
    color: #495057;
    line-height: 1.6;
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid #4285f4;
    text-align: center;
    font-weight: 600;
}

.error-message {
    color: #d93025;
    background: #fce8e6;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #f5c6cb;
    margin: 10px 0;
}

.canvas-size-info {
    font-size: 0.8rem;
    color: #6c757d;
    margin-top: 5px;
}

.download-btn {
    background: #34a853;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 10px;
    transition: all 0.3s ease;
}

.download-btn:hover {
    background: #137333;
    transform: translateY(-2px);
}

@media (max-width: 1200px) {
    .main-content {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .result-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .main-content {
        padding: 20px;
    }
    
    .header h1 {
        font-size: 2rem;
    }
    
    .controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .control-group {
        justify-content: space-between;
    }
}