/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
.header {
    text-align: center;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 40px 20px;
    border-radius: 15px;
    margin-bottom: 30px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
}

.header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.header p {
    font-size: 1.2rem;
    opacity: 0.9;
}

/* Navigation */
.nav {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.nav-btn {
    background: white;
    border: 2px solid #667eea;
    color: #667eea;
    padding: 12px 24px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: bold;
    transition: all 0.3s ease;
}

.nav-btn:hover {
    background: #667eea;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.2);
}

.nav-btn.active {
    background: #667eea;
    color: white;
}

/* Main content */
.main {
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
    min-height: 500px;
}

.page {
    display: none;
}

.page.active {
    display: block;
}

.page h2 {
    color: #667eea;
    margin-bottom: 20px;
    font-size: 2rem;
}

/* Content grid */
.content-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.content-card {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 10px;
    border-left: 4px solid #667eea;
}

.content-card h3 {
    color: #667eea;
    margin-bottom: 15px;
}

.content-card ul {
    margin-left: 20px;
}

.content-card li {
    margin-bottom: 8px;
}

/* Stats */
.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 15px;
}

.stat-item {
    text-align: center;
}

.stat-number {
    display: block;
    font-size: 2rem;
    font-weight: bold;
    color: #667eea;
}

.stat-label {
    font-size: 0.9rem;
    color: #666;
}

/* Upload area */
.upload-area {
    text-align: center;
    margin: 30px 0;
}

.upload-box {
    border: 3px dashed #667eea;
    border-radius: 15px;
    padding: 60px 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #f8f9fa;
}

.upload-box:hover {
    border-color: #764ba2;
    background: #e9ecef;
}

.upload-icon {
    font-size: 3rem;
    margin-bottom: 15px;
}

.upload-hint {
    color: #666;
    font-size: 0.9rem;
    margin-top: 10px;
}

/* Image preview */
.image-preview {
    text-align: center;
    margin: 30px 0;
}

.image-preview img {
    max-width: 300px;
    border-radius: 10px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.analyze-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 25px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.analyze-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.2);
}

/* Results */
.results {
    margin-top: 30px;
}

.results h3 {
    color: #667eea;
    margin-bottom: 20px;
}

.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.result-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 25px;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 4px 16px rgba(0,0,0,0.2);
}

.result-label {
    display: block;
    font-size: 0.9rem;
    opacity: 0.9;
    margin-bottom: 10px;
}

.result-value {
    display: block;
    font-size: 1.5rem;
    font-weight: bold;
}

/* Data table */
.data-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}

.data-table th,
.data-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.data-table th {
    background: #667eea;
    color: white;
    font-weight: bold;
}

.data-table tr:hover {
    background: #f5f5f5;
}

/* Chart container */
.chart-container {
    text-align: center;
    margin-top: 20px;
}

#chartCanvas {
    border: 1px solid #ddd;
    border-radius: 10px;
    background: white;
}

/* Footer */
.footer {
    text-align: center;
    margin-top: 40px;
    padding: 20px;
    color: #666;
    border-top: 1px solid #ddd;
}

/* Responsive design */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .header h1 {
        font-size: 2rem;
    }
    
    .nav {
        flex-direction: column;
        align-items: center;
    }
    
    .nav-btn {
        width: 100%;
        max-width: 200px;
    }
    
    .content-grid {
        grid-template-columns: 1fr;
    }
    
    .main {
        padding: 20px;
    }
    
    .upload-box {
        padding: 40px 20px;
    }
    
    .results-grid {
        grid-template-columns: 1fr;
    }
}
