/* --- CORRECTED CSS FOR MOBILE ALIGNMENT & COLOR --- */

:root {
    --primary: #2e7d32; /* Deep Green */
    --secondary: #388e3c; /* Medium Green */
    --accent: #7cb342; /* Light Green/Accent */
    --header-bg: var(--primary); /* Use primary color for header background */
    --text-on-header: white;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
    background-color: #f8f9fa; /* Light background color */
}

header {
    background-color: var(--header-bg);
    color: var(--text-on-header);
    padding: 15px 20px;
    margin-bottom: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    display: flex; /* Ensure the header style works */
    justify-content: space-between;
    align-items: center;
}

h1 {
    color: var(--text-on-header); /* Ensure h1 is white */
    margin: 0;
}

.dashboard {
    display: grid;
    grid-template-columns: 1fr 1fr; /* Default: Two columns for desktop */
    gap: 20px;
}
.card {
    background: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}
.card-header {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 15px;
    color: var(--primary); /* Keep header text color green */
    display: flex;
    justify-content: space-between;
    align-items: center;
}
input, select {
    width: 100%;
    padding: 10px;
    margin: 8px 0;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-sizing: border-box;
}
button {
    background-color: var(--primary);
    color: white;
    border: none;
    padding: 12px 15px;
    margin: 10px 0;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    transition: background-color 0.3s;
}
button:hover {
    background-color: var(--secondary);
}
.health-metrics {
    grid-column: span 2;
}
/* This targets the inline style div in index.html to ensure it spans 4 columns on large screens */
.health-metrics form > div {
    display: grid;
    grid-template-columns: repeat(4, 1fr); 
    gap: 15px;
}
.chart-container {
    height: 300px;
    max-height: 500px;
    overflow-y: auto;
    margin-top: 20px;
    position: relative;
}
.tips-container {
    /* Using a lighter green accent for containers */
    background-color: var(--accent); 
    padding: 15px;
    border-radius: 8px;
    margin-top: 15px;
}
#auth-container {
    max-width: 400px;
    margin: 20px auto;
}
#dashboard {
    /* The JS handles the display, but this style remains */
}

/* === MOBILE FIX START === */
@media (max-width: 768px) {
    /* Stack the main dashboard cards vertically */
    .dashboard {
        grid-template-columns: 1fr;
    }
    
    /* Make the entire health metrics section span one column */
    .health-metrics {
        grid-column: 1 / -1; 
    }

    /* FIX 1: Override the inline style to force a single column layout for input fields on mobile */
    .health-metrics form > div {
        grid-template-columns: 1fr !important; /* Forces one field per row */
        gap: 10px;
    }
    
    /* Make the chart responsive */
    #health-chart {
        width: 100% !important;
        height: auto !important;
    }
    
    /* Reset body padding for better full-screen use on mobile */
    body {
        padding: 10px;
    }
}
/* --- CORRECTED CSS ENDS HERE --- */