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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: #1a1a1a;
    background-color: #f5f5f5;
    -webkit-text-size-adjust: 100%;
}

.container {
    max-width: 480px;
    margin: 0 auto;
    padding: 1rem;
    min-height: 100vh;
}

header {
    text-align: center;
    padding: 1.5rem 0 1rem;
}

header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #2d5a27;
}

main {
    background: #fff;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.btn {
    display: block;
    width: 100%;
    padding: 0.875rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    color: #fff;
    background-color: #2d5a27;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    transition: background-color 0.2s;
}

.btn:hover {
    background-color: #1e3d1a;
}

.btn-secondary {
    background-color: #6c757d;
}

.btn-secondary:hover {
    background-color: #545b62;
}

.file-input-label {
    display: block;
    padding: 2rem 1rem;
    border: 2px dashed #ccc;
    border-radius: 8px;
    text-align: center;
    color: #666;
    cursor: pointer;
    margin-bottom: 1rem;
    transition: border-color 0.2s;
}

.file-input-label:hover {
    border-color: #2d5a27;
}

.file-input-label input[type="file"] {
    display: none;
}

.file-input-label .label-text {
    font-size: 1rem;
    display: block;
    margin-top: 0.5rem;
}

.file-input-label .label-icon {
    font-size: 2rem;
}

.ingredient-list {
    list-style: none;
    padding: 0;
}

.ingredient-list li {
    padding: 0.625rem 0;
    border-bottom: 1px solid #eee;
    font-size: 1rem;
}

.ingredient-list li:last-child {
    border-bottom: none;
}

.results-heading {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: #333;
}

.error-message {
    background-color: #fff3f3;
    border: 1px solid #e0b4b4;
    border-radius: 8px;
    padding: 1rem;
    color: #9f3a38;
    margin-bottom: 1rem;
    font-size: 0.95rem;
}

.loading-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    z-index: 100;
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

.loading-overlay.active {
    display: flex;
}

.spinner {
    width: 48px;
    height: 48px;
    border: 4px solid #e0e0e0;
    border-top-color: #2d5a27;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-text {
    margin-top: 1rem;
    font-size: 1.1rem;
    color: #555;
}

.spacing-top {
    margin-top: 1.5rem;
}

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

.text-muted {
    color: #888;
    font-size: 0.85rem;
}

/* Analysis page */
.analysis-section-heading {
    font-size: 1.15rem;
    font-weight: 600;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    padding-bottom: 0.375rem;
    border-bottom: 2px solid #eee;
}

.dangerous-heading {
    color: #c0392b;
    border-bottom-color: #e74c3c;
}

.safe-heading {
    color: #2d5a27;
    border-bottom-color: #2d5a27;
}

.dangerous-item {
    margin-bottom: 1rem;
}

.dangerous-ingredient-name {
    font-size: 1rem;
    font-weight: 600;
    color: #c0392b;
    margin-bottom: 0.25rem;
}

.dangerous-reason {
    font-size: 0.95rem;
    color: #555;
    line-height: 1.5;
}

.safe-list {
    list-style: none;
    padding: 0;
}

.safe-list li {
    padding: 0.5rem 0;
    border-bottom: 1px solid #eee;
    font-size: 1rem;
    color: #333;
}

.safe-list li:last-child {
    border-bottom: none;
}

.no-dangerous {
    background-color: #eafaf1;
    border: 1px solid #a3d9a5;
    border-radius: 8px;
    padding: 1rem;
    color: #2d5a27;
    margin-top: 1rem;
    font-size: 0.95rem;
}

.disclaimer {
    margin-top: 1.5rem;
    padding: 0.75rem;
    background-color: #fff8e1;
    border: 1px solid #ffe082;
    border-radius: 8px;
    font-size: 0.85rem;
    color: #795548;
    line-height: 1.4;
}
