/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.header {
    text-align: center;
    margin-bottom: 40px;
    color: white;
}

.logo {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 10px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.tagline {
    font-size: 1.1rem;
    opacity: 0.9;
    font-weight: 300;
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Camera Section */
.camera-section {
    width: 100%;
    max-width: 600px;
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    margin-bottom: 30px;
}

.camera-container {
    text-align: center;
}

.camera-preview {
    position: relative;
    width: 100%;
    max-width: 500px;
    margin: 0 auto 30px;
    border-radius: 15px;
    overflow: hidden;
    background: #f8f9fa;
    aspect-ratio: 4/3;
}

#video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 15px;
}

.camera-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: rgba(0,0,0,0.3);
    color: white;
    border-radius: 15px;
}

.focus-frame {
    width: 200px;
    height: 150px;
    border: 3px solid white;
    border-radius: 10px;
    margin-bottom: 20px;
    opacity: 0.8;
}

.instruction {
    font-size: 1.1rem;
    font-weight: 500;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

.camera-controls {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

/* Buttons */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    font-family: inherit;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

.btn-capture {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.4);
    font-size: 1.1rem;
    padding: 15px 30px;
}

.btn-capture:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 107, 107, 0.6);
}

.btn-secondary {
    background: #f8f9fa;
    color: #666;
    border: 2px solid #e9ecef;
}

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

/* Results Section */
.results-section {
    width: 100%;
    max-width: 800px;
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
}

.results-container {
    margin-bottom: 30px;
}

.captured-image {
    text-align: center;
    margin-bottom: 30px;
}

.captured-image img {
    max-width: 100%;
    max-height: 300px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

/* Loading Animation */
.loading {
    text-align: center;
    padding: 40px;
}

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

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

/* Results Content */
.results-content h2 {
    color: #333;
    margin-bottom: 25px;
    font-size: 1.8rem;
    text-align: center;
}

.summary-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.summary-card {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 20px;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    transition: transform 0.3s ease;
}

.summary-card:hover {
    transform: translateY(-2px);
}

.card-icon {
    font-size: 2rem;
    margin-bottom: 10px;
}

.card-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #333;
    margin-bottom: 5px;
}

.card-label {
    font-size: 0.9rem;
    color: #666;
    font-weight: 500;
}

/* Content Sections */
.meal-description,
.insights-section,
.recommendations-section,
.quick-tip {
    margin-bottom: 25px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 15px;
    border-left: 4px solid #667eea;
}

.meal-description h3,
.insights-section h3,
.recommendations-section h3,
.quick-tip h3 {
    color: #333;
    margin-bottom: 15px;
    font-size: 1.2rem;
}

.meal-description p {
    color: #555;
    line-height: 1.6;
}

.insights-list,
.recommendations-list {
    list-style: none;
    padding: 0;
}

.insights-list li,
.recommendations-list li {
    background: white;
    margin-bottom: 10px;
    padding: 15px;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    border-left: 3px solid #667eea;
}

.insights-list li:before {
    content: "💡";
    margin-right: 10px;
}

.recommendations-list li:before {
    content: "🎯";
    margin-right: 10px;
}

.quick-tip {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
    border-left-color: #f39c12;
}

.quick-tip h3 {
    color: #856404;
}

.quick-tip p {
    color: #856404;
    font-weight: 500;
}

/* Action Buttons */
.action-buttons {
    text-align: center;
}

/* Camera Note */
.camera-note {
    margin-top: 20px;
    padding: 15px;
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 10px;
    text-align: center;
}

.camera-note p {
    margin: 0;
    color: #856404;
    font-size: 0.9rem;
}

/* Footer */
.footer {
    text-align: center;
    margin-top: 40px;
    color: white;
    opacity: 0.8;
    font-size: 0.9rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    .logo {
        font-size: 2rem;
    }
    
    .camera-section,
    .results-section {
        padding: 20px;
    }
    
    .camera-controls {
        flex-direction: column;
        align-items: center;
    }
    
    .btn {
        width: 100%;
        max-width: 250px;
        justify-content: center;
    }
    
    .summary-cards {
        grid-template-columns: 1fr;
    }
    
    .focus-frame {
        width: 150px;
        height: 100px;
    }
}

@media (max-width: 480px) {
    .logo {
        font-size: 1.8rem;
    }
    
    .tagline {
        font-size: 1rem;
    }
    
    .camera-section,
    .results-section {
        padding: 15px;
    }
    
    .summary-cards {
        gap: 15px;
    }
    
    .summary-card {
        padding: 15px;
    }
}

/* Hidden class */
.hidden {
    display: none !important;
}

/* Error states */
.error {
    background: #f8d7da;
    color: #721c24;
    padding: 15px;
    border-radius: 10px;
    border-left: 4px solid #dc3545;
    margin: 20px 0;
}

/* Success states */
.success {
    background: #d4edda;
    color: #155724;
    padding: 15px;
    border-radius: 10px;
    border-left: 4px solid #28a745;
    margin: 20px 0;
}