@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;500;700&display=swap');

:root {
    --primary-color: #4CAF50; /* Green */
    --secondary-color: #FFC107; /* Amber/Yellow */
    --bg-color: #f4f7f6;
    --card-bg: #ffffff;
    --text-color: #333;
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    display: flex;
    justify-content: center;
    padding: 20px;
    margin: 0;
}

.container {
    width: 100%;
    max-width: 900px;
    background: var(--card-bg);
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    padding: 30px;
}

/* --- Header --- */
header {
    text-align: center;
    margin-bottom: 25px;
}
header h1 {
    color: var(--primary-color);
    font-weight: 700;
}
header p {
    color: #666;
}

/* --- Tabs --- */
.tabs {
    display: flex;
    justify-content: center;
    margin-bottom: 30px;
    border-bottom: 2px solid #eee;
}

.tab-button {
    background: none;
    border: none;
    padding: 12px 25px;
    font-size: 1.1em;
    font-weight: 500;
    color: #999;
    cursor: pointer;
    transition: all 0.3s ease;
    border-bottom: 3px solid transparent;
    margin: 0 5px;
}

.tab-button:hover {
    color: var(--primary-color);
}

.tab-button.active {
    color: var(--primary-color);
    border-bottom: 3px solid var(--primary-color);
    font-weight: 700;
}

/* --- Meal Content --- */
.meal-tab {
    display: none; /* Hidden by JS on load, except for 'dinner' */
    animation: fadeIn 0.5s ease-out;
}

.meal-tab h2 {
    text-align: center;
    color: var(--primary-color);
    margin-bottom: 20px;
    font-size: 1.8em;
}

.meal-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.meal-component {
    background: var(--bg-color);
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

.meal-component h3 {
    color: #444;
    font-size: 1.2em;
    margin-top: 0;
    border-bottom: 1px solid #ddd;
    padding-bottom: 10px;
}

.random-display {
    min-height: 40px; /* Ensure consistent height */
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4em;
    font-weight: 700;
    color: var(--secondary-color);
    margin: 15px 0;
    transition: color 0.3s ease;
}

/* --- Buttons --- */
.random-btn, .total-random-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
    text-transform: uppercase;
    font-size: 0.9em;
}

.random-btn {
    background-color: var(--primary-color);
    color: white;
    width: 100%;
}

.random-btn:hover {
    background-color: #388E3C; /* Darker green */
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.total-random-btn {
    display: block;
    margin: 0 auto;
    background-color: var(--secondary-color);
    color: var(--text-color);
    margin-top: 20px;
    font-size: 1em;
    padding: 12px 30px;
}

.total-random-btn:hover {
    background-color: #FFD54F; /* Lighter yellow */
    transform: scale(1.02);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

/* --- Animations --- */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Flickering effect for single randomization */
@keyframes flicker {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.3; transform: scale(0.95); }
}

.flicker-animation {
    animation: flicker 0.3s ease-in-out;
}