/* Basic CSS Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: linear-gradient(135deg, #4c6ef5, #5f3dc4);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    padding: 2rem;
    color: #333;
}

.app-container {
    background: white;
    width: 100%;
    max-width: 1000px;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    min-height: 80vh;
}

header {
    text-align: center;
    margin-bottom: 2rem;
}

header h1 {
    font-size: 2.5rem;
    color: #212529;
    margin-bottom: 0.5rem;
}

header p {
    color: #6c757d;
}

/* Search Form */
#search-form {
    max-width: 600px;
    margin: 0 auto 2rem;
}

.input-group {
    display: flex;
    gap: 10px;
}

#search-input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid #ced4da;
    border-radius: 6px;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.2s;
}

#search-input:focus {
    border-color: #5f3dc4;
}

#search-btn {
    padding: 12px 24px;
    background-color: #6741d9;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    cursor: pointer;
    font-weight: 600;
    transition: background-color 0.2s;
}

#search-btn:hover {
    background-color: #5f3dc4;
}

.error-text {
    color: #e03131;
    font-size: 0.875rem;
    margin-top: 8px;
    text-align: center;
}

/* Utilities */
.hidden {
    display: none !important;
}

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

/* Loading Spinner */
#loading {
    text-align: center;
    margin: 2rem 0;
}

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

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

    100% {
        transform: rotate(360deg);
    }
}

/* Results Grid */
#results-section h2 {
    text-align: center;
    margin-bottom: 1.5rem;
}

.grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.meal-card {
    border: 1px solid #e9ecef;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    background: white;
}

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

.meal-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.meal-info {
    padding: 1rem;
}

.meal-info h3 {
    margin-bottom: 0.5rem;
    font-size: 1.2rem;
}

.pill {
    display: inline-block;
    padding: 4px 10px;
    background-color: #6741d9;
    color: white;
    border-radius: 20px;
    font-size: 0.8rem;
    margin-right: 5px;
}

.pill.area {
    background-color: #f1f3f5;
    color: #495057;
}

/* Detail Section */
.outline-btn {
    background: transparent;
    border: 1px solid #6741d9;
    color: #6741d9;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    margin-bottom: 1.5rem;
    transition: all 0.2s;
}

.outline-btn:hover {
    background: #6741d9;
    color: white;
}

.detail-container {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
}

.detail-image {
    flex: 1;
    min-width: 300px;
}

.detail-image img {
    width: 100%;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.detail-content {
    flex: 1.5;
    min-width: 300px;
}

.detail-content h2 {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.tags {
    margin-bottom: 1.5rem;
}

.ingredients-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 1rem;
    margin-bottom: 2rem;
}

.ingredient-item {
    background: #f8f9fa;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 0.9rem;
}

.instructions {
    line-height: 1.6;
    margin-bottom: 2rem;
    white-space: pre-line;
}

.youtube-btn {
    display: inline-block;
    background-color: #ff0000;
    color: white;
    text-decoration: none;
    padding: 10px 20px;
    border-radius: 6px;
    font-weight: bold;
}

.youtube-btn:hover {
    background-color: #cc0000;
}