
:root {
    --primary-color: #d4a373; 
    --secondary-color: #a5a58d; 
    --dark-color: #3a3a3a; 
    --light-color: #f8f4e9; 
    --accent-color: #c9a66b; 
    --text-color: #3a3a3a;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    --transition: all 0.3s ease;
}

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

html, body {
    height: 100%;
}

body {
    font-family: 'Lora', serif;
    line-height: 1.6;
    background-color: var(--light-color);
    color: var(--text-color);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

body.dark-mode {
    --light-color: #2b2b2b;
    --text-color: #e9e9e9;
    --dark-color: #e9e9e9;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.5rem;
    flex: 1;
}

/* Header Styles */
header {
    background-color: var(--light-color);
    padding: 1.5rem 0;
    box-shadow: var(--shadow);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.dark-mode header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

h1 {
    font-size: 2rem;
    font-weight: 600;
    color: var(--primary-color);
    letter-spacing: 0.5px;
}

/* Button Styles */
.btn {
    padding: 0.6rem 1.2rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-family: 'Lora', serif;
    letter-spacing: 0.3px;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

.primary-btn {
    background-color: var(--primary-color);
    color: white;
}

.secondary-btn {
    background-color: var(--secondary-color);
    color: white;
}

.theme-btn {
    background-color: transparent;
    color: var(--text-color);
    border: 1px solid var(--text-color);
}

.dark-mode .theme-btn {
    border-color: var(--accent-color);
    color: var(--accent-color);
}

/* Search Section */
.search-section {
    margin-bottom: 2.5rem;
}

.search-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

@media (min-width: 768px) {
    .search-container {
        grid-template-columns: 1fr 1fr;
    }
}

.search-box {
    display: flex;
    gap: 0.8rem;
}

.search-box input {
    flex: 1;
    padding: 0.7rem 1rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    transition: var(--transition);
    background-color: rgba(255, 255, 255, 0.7);
    font-family: 'Lora', serif;
}

.dark-mode .search-box input {
    background-color: rgba(0, 0, 0, 0.2);
    border-color: #555;
    color: var(--light-color);
}

.search-box input:focus {
    border-color: var(--primary-color);
    outline: none;
    box-shadow: 0 0 0 2px rgba(212, 163, 115, 0.2);
}

/* Results Section */
.results-section {
    margin-bottom: 3rem;
}

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

.meal-card {
    background-color: white;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
    cursor: pointer;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.dark-mode .meal-card {
    background-color: #333;
    border-color: rgba(255, 255, 255, 0.05);
}

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

.meal-img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.dark-mode .meal-img {
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.meal-info {
    padding: 1.2rem;
}

.meal-info h3 {
    margin-bottom: 0.5rem;
    color: var(--primary-color);
    font-weight: 600;
}

.meal-info p {
    color: var(--text-color);
    opacity: 0.8;
    font-size: 0.9rem;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 100;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(3px);
}

.modal-content {
    background-color: var(--light-color);
    margin: 3% auto;
    padding: 2.5rem;
    border-radius: 8px;
    width: 90%;
    max-width: 800px;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.15);
    position: relative;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.dark-mode .modal-content {
    background-color: #333;
    border-color: rgba(255, 255, 255, 0.1);
}

.close-btn {
    position: absolute;
    top: 1.2rem;
    right: 1.5rem;
    font-size: 1.8rem;
    color: var(--text-color);
    opacity: 0.6;
    cursor: pointer;
    transition: var(--transition);
}

.close-btn:hover {
    opacity: 1;
    color: var(--primary-color);
}

#recipe-details {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2.5rem;
}

@media (min-width: 768px) {
    #recipe-details {
        grid-template-columns: 1fr 1fr;
    }
}

.recipe-img {
    width: 100%;
    max-height: 400px;
    object-fit: cover;
    border-radius: 6px;
    box-shadow: var(--shadow);
}

.recipe-info h2 {
    color: var(--primary-color);
    margin-bottom: 1.2rem;
    font-weight: 600;
    letter-spacing: 0.3px;
}

.recipe-info p {
    margin-bottom: 0.8rem;
    line-height: 1.7;
}

.recipe-info h3 {
    margin: 2rem 0 1rem;
    color: var(--accent-color);
    font-weight: 500;
    letter-spacing: 0.3px;
    position: relative;
    padding-bottom: 0.5rem;
}

.recipe-info h3::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 50px;
    height: 2px;
    background-color: var(--accent-color);
}

.ingredients-list {
    list-style-type: none;
    margin-bottom: 1.5rem;
    columns: 2;
    column-gap: 1.5rem;
}

@media (max-width: 480px) {
    .ingredients-list {
        columns: 1;
    }
}

.ingredients-list li {
    padding: 0.4rem 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    break-inside: avoid;
    font-size: 0.95rem;
}

.dark-mode .ingredients-list li {
    border-bottom-color: rgba(255, 255, 255, 0.05);
}

/* Footer Styles */
footer {
    background-color: var(--light-color);
    color: var(--text-color);
    text-align: center;
    padding: 1.5rem 0;
    margin-top: auto;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    font-size: 0.9rem;
}

.dark-mode footer {
    background-color: #333;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

/* Loading Spinner */
.loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 300px;
    gap: 1rem;
}

.spinner {
    border: 3px solid rgba(0, 0, 0, 0.05);
    border-radius: 50%;
    border-top: 3px solid var(--primary-color);
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
}

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

/* Error Message */
.error-message {
    text-align: center;
    padding: 2rem;
    color: var(--primary-color);
    font-weight: 500;
    font-style: italic;
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Add Lora font from Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Lora:ital,wght@0,400;0,500;0,600;0,700;1,400&display=swap');
/* Add these imports at the top of your CSS */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,500;0,600;1,400&family=Alex+Brush&family=Cormorant+Garamond:ital,wght@0,400;0,500;1,400&display=swap');

/* Update the body font */
body {
    font-family: 'Cormorant Garamond', serif; /* Elegant serif with cursive flair */
    /* ... keep existing body styles ... */
}

/* Special cursive elements */
h1, h2, h3 {
    font-family: 'Playfair Display', serif;
    font-weight: 500;
    font-style: italic; /* Adds cursive-like elegance */
}

.meal-info h3 {
    font-family: 'Alex Brush', cursive; /* Actual cursive for recipe titles */
    font-size: 1.8rem;
    font-weight: normal;
}

.theme-btn, .btn {
    font-family: 'Cormorant Garamond', serif;
    font-style: italic;
}

footer {
    font-family: 'Cormorant Garamond', serif;
    font-style: italic;
}
:root {
    --primary-color: #7a5f3d; 
    --secondary-color: #5a6d4a; 
    --dark-color: #222222; 
    --light-color: #f0e6d2; 
    --accent-color: #9a7439; 
    --text-color: #222222; 
}

body.dark-mode {
    --primary-color: #a88452;
    --secondary-color: #6a7b5a; 
    --light-color: #1e1e1e;
    --text-color: #e0e0e0; 
    --accent-color: #b8934c; 
}
/* Make all text bright white in dark mode for better visibility */
.dark-mode {
    --text-color: #ffffff;
}

.dark-mode h1,
.dark-mode h2,
.dark-mode h3,
.dark-mode p,
.dark-mode .btn,
.dark-mode .theme-btn,
.dark-mode .meal-info h3,
.dark-mode .recipe-info h2,
.dark-mode .recipe-info h3,
.dark-mode .recipe-info p,
.dark-mode .ingredients-list li,
.dark-mode .close-btn,
.dark-mode .error-message {
    color: #ffffff !important;
}

/* Make search inputs turn white with black text when hovered/focused (works in both light and dark modes) */
.search-box input:hover,
.search-box input:focus {
    background-color: #ffffff !important;
    color: #000000 !important;
    border-color: var(--primary-color) !important;
    box-shadow: 0 0 0 2px rgba(212, 163, 115, 0.3);
}
