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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

header {
    text-align: center;
    margin-bottom: 30px;
}

/* Two-column layout */
.main-content {
    display: flex;
    gap: 30px;
    align-items: flex-start;
}

.left-panel {
    flex: 0 0 400px;
    position: sticky;
    top: 20px;
}

.right-panel {
    flex: 1;
    min-width: 0;
}

@media (max-width: 900px) {
    .main-content {
        flex-direction: column;
    }

    .left-panel {
        flex: none;
        width: 100%;
        position: static;
    }

    .right-panel {
        width: 100%;
    }
}

header h1 {
    font-size: 2rem;
    margin-bottom: 8px;
}

header p {
    color: #666;
}

/* Upload Section */
.upload-section {
    background: white;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 15px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.upload-area {
    border: 2px dashed #ddd;
    border-radius: 8px;
    padding: 40px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
}

.upload-area:hover,
.upload-area.dragover {
    border-color: #4285f4;
    background: #f8f9ff;
}

.upload-icon {
    font-size: 48px;
    display: block;
    margin-bottom: 10px;
}

.upload-prompt p {
    color: #666;
}

.image-preview {
    max-width: 100%;
    max-height: 300px;
    border-radius: 4px;
}

.analyze-btn {
    width: 100%;
    margin-top: 15px;
    padding: 14px;
    background: #4285f4;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.2s;
}

.analyze-btn:hover:not(:disabled) {
    background: #3367d6;
}

.analyze-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* Results Section */
.results-section {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.results-section h2 {
    margin-bottom: 15px;
}

.product-info {
    padding: 15px;
    background: #f8f9fa;
    border-radius: 4px;
    margin-bottom: 20px;
}

.product-info h3 {
    margin-bottom: 5px;
}

.ingredients-grid {
    display: grid;
    gap: 15px;
}

/* Ingredient Card */
.ingredient-card {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 15px;
    border-left: 4px solid #ccc;
}

.ingredient-card.status-normal {
    border-left-color: #34a853;
}

.ingredient-card.status-high {
    border-left-color: #fbbc04;
}

.ingredient-card.status-excessive {
    border-left-color: #ea4335;
}

.ingredient-card.status-unknown {
    border-left-color: #9e9e9e;
}

.ingredient-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.ingredient-name {
    font-size: 1.1rem;
    font-weight: 600;
}

.ingredient-dose {
    font-size: 0.9rem;
    color: #666;
    text-align: right;
}

.ingredient-dv {
    font-weight: 600;
}

.ingredient-detail {
    margin-bottom: 10px;
}

.ingredient-detail-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: #888;
    margin-bottom: 2px;
}

.ingredient-detail-value {
    font-size: 0.9rem;
}

.dosage-assessment {
    background: #f8f9fa;
    padding: 10px;
    border-radius: 4px;
    font-size: 0.9rem;
}

.dosage-rda {
    font-size: 0.85rem;
    color: #666;
    margin-top: 5px;
}

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

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

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

/* Error */
.error {
    background: #fce8e6;
    color: #c5221f;
    padding: 15px;
    border-radius: 4px;
    margin-top: 20px;
}

/* Summary Section */
.summary-section {
    background: linear-gradient(135deg, #e8f5e9 0%, #e3f2fd 100%);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 25px;
}

.summary-section h3 {
    font-size: 1.1rem;
    margin-bottom: 15px;
    color: #1a73e8;
}

.summary-benefits {
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 15px;
}

.summary-best-for {
    background: white;
    padding: 12px 15px;
    border-radius: 6px;
    margin-bottom: 15px;
    font-size: 0.95rem;
}

.summary-best-for strong {
    color: #1a73e8;
}

.summary-highlights {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 15px;
}

.summary-highlight {
    background: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    border: 1px solid #c8e6c9;
}

.summary-considerations {
    font-size: 0.9rem;
    color: #5f6368;
    padding: 10px 15px;
    background: rgba(255,255,255,0.7);
    border-left: 3px solid #fbbc04;
    border-radius: 4px;
}

.ingredients-heading {
    font-size: 1.1rem;
    margin-bottom: 15px;
    color: #333;
}

/* Other Ingredients Section */
.other-ingredients-section {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
}

.other-ingredients-section h3 {
    font-size: 1.2rem;
    margin-bottom: 5px;
}

.section-description {
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 15px;
}

.other-ingredients-grid {
    display: grid;
    gap: 10px;
}

.other-ingredient-card {
    background: #f8f9fa;
    border-radius: 6px;
    padding: 12px 15px;
    border-left: 3px solid #9e9e9e;
}

.other-ingredient-name {
    font-weight: 600;
    margin-bottom: 4px;
}

.other-ingredient-purpose {
    font-size: 0.85rem;
    color: #4285f4;
    margin-bottom: 6px;
}

.other-ingredient-description {
    font-size: 0.9rem;
    margin-bottom: 6px;
}

.other-ingredient-concerns {
    font-size: 0.85rem;
    color: #666;
    font-style: italic;
}

/* Allergen Info */
.allergen-info {
    margin-top: 20px;
    padding: 12px 15px;
    background: #fff3e0;
    border-left: 3px solid #ff9800;
    border-radius: 4px;
    font-size: 0.9rem;
}

.allergen-info strong {
    color: #e65100;
}
