:root {
    --primary-color: #4a90e2;
    --primary-dark: #3a70b2;
    --secondary-color: #f8f9fa;
    --text-color: #333;
    --border-color: #ddd;
    --success-color: #28a745;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --background-color: #f4f6f8;
}

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

body {
    font-family: 'Arial', sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--background-color);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

header {
    background-color: var(--primary-color);
    color: white;
    text-align: center;
    padding: 1.2rem 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    position: sticky;
    top: 0;
    z-index: 100;
}

.container {
    max-width: 900px;
    margin: 1.5rem auto;
    padding: 0 1rem;
}

.section-title {
    text-align: center;
    margin-bottom: 0.5rem;
    color: var(--primary-dark);
    font-size: 1.5rem;
}

.section-description {
    text-align: center;
    color: #666;
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
}

/* Loading state */
.loading-container {
    text-align: center;
    padding: 2rem;
}

.spinner {
    border: 4px solid rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    border-top: 4px solid var(--primary-color);
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

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

/* Error state */
.error-container {
    text-align: center;
    padding: 2rem;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.error-message {
    color: var(--danger-color);
    margin-bottom: 1rem;
}

.retry-button {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.retry-button:hover {
    background-color: var(--primary-dark);
}

/* Meal grid */
.meal-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    max-width: 800px;
    margin: 0 auto;
}

.meal-item {
    background-color: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.15);
    transition: transform 0.3s, box-shadow 0.3s;
    cursor: pointer;
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 1.2rem;
    min-height: 220px;
}

.meal-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.meal-image {
    width: 95%;
    height: auto;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 50%;
    margin-bottom: 0.8rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.meal-name {
    font-weight: bold;
    font-size: 1.1rem;
    margin-top: 0.5rem;
    color: var(--text-color);
}

/* Meal details modal */
.meal-details {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 1;
    transition: opacity 0.3s ease-in-out;
    -webkit-backdrop-filter: blur(3px);
    backdrop-filter: blur(3px);
}

.meal-details-content {
    background-color: white;
    border-radius: 8px;
    padding: 2rem;
    max-width: 500px;
    width: 90%;
    text-align: center;
    position: relative;
}

.meal-details-content h2 {
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.meal-details-content img {
    width: 280px;
    height: 280px;
    object-fit: cover;
    border-radius: 8px;
    margin: 1rem 0;
}

.close-button {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    margin-top: 1rem;
}

.close-button:hover {
    background-color: var(--primary-dark);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .container {
        padding: 0 0.5rem;
        margin: 1rem auto;
    }

    .meal-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.8rem;
    }

    .meal-item {
        min-height: 180px;
        padding: 1rem;
    }

    .meal-image {
        width: 90%;
    }

    .meal-name {
        font-size: 0.9rem;
    }

    .meal-details-content {
        padding: 1.5rem;
        width: 95%;
    }

    .meal-details-content img {
        width: 200px;
        height: 200px;
    }
}

/* Large screen adjustments */
@media (min-width: 1200px) {
    .container {
        max-width: 900px;
    }

    .meal-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }

    .meal-item {
        min-height: 250px;
    }

    .meal-image {
        width: 95%;
    }

    .meal-name {
        font-size: 1.3rem;
        margin-top: 0.8rem;
    }
}

/* Alerts section */
.alerts-section {
    margin-top: 3rem;
    padding: 2rem;
    background-color: var(--secondary-color);
    border-radius: 12px;
    text-align: center;
}

.alerts-button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background-color: var(--primary-color);
    color: white;
    padding: 1rem 2rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: background-color 0.3s, transform 0.2s;
    margin-top: 1rem;
}

.alerts-button:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
}

.alerts-icon {
    font-size: 1.5rem;
}

footer {
    text-align: center;
    padding: 2rem 0;
    margin-top: 2rem;
    background-color: var(--secondary-color);
    border-top: 1px solid var(--border-color);
}