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

body {
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #333;
    overflow-x: hidden;
}

#app {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 1rem 2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.header h1 {
    font-size: 2.5rem;
    font-weight: 800;
    color: #10B981;
    margin-bottom: 0.5rem;
}

.header p {
    color: #6B7280;
    font-size: 1.1rem;
    margin-bottom: 1rem;
}

.stats-bar {
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.stat {
    background: rgba(16, 185, 129, 0.1);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    border: 2px solid #10B981;
}

.stat.cost {
    background: rgba(245, 158, 11, 0.1);
    border-color: #F59E0B;
}

.stat.carbon {
    background: rgba(239, 68, 68, 0.1);
    border-color: #EF4444;
}

.stat .label {
    font-weight: 600;
    margin-right: 0.5rem;
}

.stat .value {
    font-weight: 800;
    font-size: 1.1rem;
}

/* Main Content */
.main-content {
    display: flex;
    flex: 1;
    gap: 1rem;
    padding: 1rem;
}

/* Left Sidebar */
.left-sidebar {
    width: 300px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    height: fit-content;
}

.left-sidebar h3 {
    color: #10B981;
    margin-bottom: 1rem;
    font-size: 1.3rem;
}

.material-tabs {
    display: flex;
    margin-bottom: 1rem;
    background: #F3F4F6;
    border-radius: 12px;
    padding: 0.25rem;
}

.tab-btn {
    flex: 1;
    padding: 0.5rem 0.75rem;
    border: none;
    background: transparent;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.tab-btn.active {
    background: #10B981;
    color: white;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.material-grid {
    display: grid;
    gap: 1rem;
    max-height: 500px;
    overflow-y: auto;
}

.material-card {
    background: #FAFAFA;
    border-radius: 12px;
    padding: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.material-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    border-color: #10B981;
}

.material-preview {
    width: 100%;
    height: 80px;
    border-radius: 8px;
    margin-bottom: 0.75rem;
    position: relative;
    overflow: hidden;
}

.material-preview img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 0.3s ease;
}

.material-info h4 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    color: #1F2937;
}

.material-score {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.eco-score {
    color: #10B981;
    font-weight: 600;
}

.cost-multiplier {
    color: #F59E0B;
    font-weight: 600;
}

.material-properties {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
}

.property-tag {
    background: #E5E7EB;
    padding: 0.25rem 0.5rem;
    border-radius: 16px;
    font-size: 0.8rem;
    color: #6B7280;
}

/* Viewport Container */
.viewport-container {
    flex: 1;
    position: relative;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

#scene-container {
    width: 100%;
    height: 100%;
}

.viewport-controls {
    position: absolute;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    padding: 0.75rem;
    border-radius: 50px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.control-btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    background: #F3F4F6;
    color: #6B7280;
}

.control-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.control-btn.primary {
    background: #10B981;
    color: white;
}

.selection-info {
    position: absolute;
    top: 1rem;
    left: 1rem;
    background: rgba(16, 185, 129, 0.9);
    backdrop-filter: blur(10px);
    color: white;
    padding: 0.75rem 1rem;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.selection-info .instruction {
    display: block;
    font-size: 0.9rem;
    opacity: 0.9;
    margin-top: 0.25rem;
}

/* Right Sidebar */
.right-sidebar {
    width: 300px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    height: fit-content;
    overflow-y: auto;
    max-height: 600px;
}

.right-sidebar h3 {
    color: #10B981;
    margin-bottom: 1rem;
    font-size: 1.3rem;
}

.analytics-card {
    background: #FAFAFA;
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 1rem;
    border-left: 4px solid #10B981;
}

.analytics-card h4 {
    color: #1F2937;
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.score-meter {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.score-bar {
    flex: 1;
    height: 12px;
    background: #E5E7EB;
    border-radius: 6px;
    overflow: hidden;
}

.score-fill {
    height: 100%;
    background: linear-gradient(90deg, #EF4444, #F59E0B, #10B981);
    border-radius: 6px;
    transition: width 0.5s ease;
}

.grade {
    font-weight: 800;
    font-size: 1.2rem;
    color: #10B981;
}

.metrics, .cost-breakdown, .urban-metrics {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.metric, .cost-item, .urban-metric {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cost-item.total {
    border-top: 2px solid #E5E7EB;
    padding-top: 0.5rem;
    font-weight: 600;
}

.roi-info {
    margin-top: 1rem;
    padding: 0.75rem;
    background: rgba(16, 185, 129, 0.1);
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
}

.score.excellent { color: #10B981; }
.score.good { color: #059669; }
.score.average { color: #F59E0B; }
.score.poor { color: #EF4444; }

/* Bottom Toolbar */
.bottom-toolbar {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
}

.preset-scenarios {
    display: flex;
    gap: 0.5rem;
}

.preset-btn {
    padding: 0.75rem 1.5rem;
    border: 2px solid #E5E7EB;
    background: white;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.preset-btn.active {
    border-color: #10B981;
    background: #10B981;
    color: white;
}

.export-controls {
    display: flex;
    gap: 0.5rem;
}

.export-btn {
    padding: 0.75rem 1.5rem;
    border: 2px solid #6B7280;
    background: white;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    color: #6B7280;
}

.export-btn:hover {
    border-color: #10B981;
    color: #10B981;
    transform: translateY(-2px);
}

/* Footer */
.footer {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 1rem;
    text-align: center;
    color: #6B7280;
}

.footer a {
    color: #10B981;
    text-decoration: none;
    font-weight: 600;
}

/* Feedback Toast */
.feedback-toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: #10B981;
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Responsive Design */
@media (max-width: 1200px) {
    .main-content {
        flex-direction: column;
    }
    
    .left-sidebar,
    .right-sidebar {
        width: 100%;
        max-height: none;
    }
    
    .viewport-container {
        height: 500px;
    }
}

@media (max-width: 768px) {
    .header h1 {
        font-size: 2rem;
    }
    
    .stats-bar {
        gap: 1rem;
    }
    
    .bottom-toolbar {
        flex-direction: column;
        gap: 1rem;
    }
    
    .preset-scenarios,
    .export-controls {
        flex-wrap: wrap;
        justify-content: center;
    }
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #F3F4F6;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #10B981;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #059669;
}