/* Base Styles */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f9f9f9;
    color: #333;
}

/* Navigation Bar Styles */
.navbar {
    background-color: #ff6b6b;
    color: white;
    padding: 1rem 2rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
}

.nav-logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: white;
    text-decoration: none;
}

.nav-links {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.nav-link {
    color: white;
    text-decoration: none;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    transition: background-color 0.3s;
}

.nav-link:hover {
    background-color: rgba(255,255,255,0.2);
}

.nav-link.active {
    background-color: rgba(255,255,255,0.3);
}

.theme-toggle {
    background: none;
    border: none;
    color: white;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    transition: background-color 0.3s;
}

.theme-toggle:hover {
    background-color: rgba(255,255,255,0.2);
}

/* Dark Theme Styles */
body.dark-theme {
    background-color: #121212;
    color: #e0e0e0;
}

body.dark-theme .recipe-card,
body.dark-theme .filters {
    background-color: #1e1e1e;
    color: #e0e0e0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

body.dark-theme .recipe-title,
body.dark-theme .filter-group h3 {
    color: #ffffff;
}

body.dark-theme .recipe-description,
body.dark-theme .recipe-details span {
    color: #b0b0b0;
}

body.dark-theme .navbar {
    background-color: #1a1a1a;
}

body.dark-theme .search-container input {
    background-color: #2d2d2d;
    color: #e0e0e0;
}

body.dark-theme .recipe-tag {
    background-color: #333;
    color: #e0e0e0;
}

body.dark-theme .back-button,
body.dark-theme #reset-filters {
    background-color: #333;
    color: #e0e0e0;
}

body.dark-theme .back-button:hover,
body.dark-theme #reset-filters:hover {
    background-color: #444;
}

header {
    background-color: #9b0808ac;
    color: white;
    padding: 1.5rem;
    text-align: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.search-container {
    display: flex;
    max-width: 600px;
    margin: 1rem auto;
}

#search-input {
    flex: 1;
    padding: 0.75rem;
    border: none;
    border-radius: 4px 0 0 4px;
    font-size: 1rem;
}

#search-btn {
    padding: 0 1.5rem;
    background-color: #0f0e0e;
    border: none;
    border-radius: 0 4px 4px 0;
    color: white;
    cursor: pointer;
    transition: background-color 0.3s;
}

#search-btn:hover {
    background-color: #ff5252;
}

main {
    display: flex;
    flex-wrap: wrap;
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1rem;
}

.filters {
    flex: 0 0 250px;
    background: rgb(255, 255, 255);
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    margin-right: 2rem;
    margin-bottom: 2rem;
}

.filter-group {
    margin-bottom: 1.5rem;
}

.filter-group h3 {
    margin-top: 0;
    margin-bottom: 0.75rem;
    font-size: 1.1rem;
    color: #555;
}

.filter-options {
    display: flex;
    flex-direction: column;
}

.filter-options label {
    margin-bottom: 0.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
}

.filter-options input {
    margin-right: 0.5rem;
}

#reset-filters {
    width: 100%;
    padding: 0.75rem;
    background-color: #f0f0f0;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
}

#reset-filters:hover {
    background-color: #e0e0e0;
}

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

.recipe-card {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
}

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

.recipe-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.recipe-content {
    padding: 1.5rem;
}

.recipe-title {
    margin: 0 0 0.5rem;
    font-size: 1.25rem;
    color: #333;
}

.recipe-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.recipe-tag {
    display: inline-block;
    background-color: #f0f0f0;
    padding: 0.25rem 0.5rem;
    border-radius: 20px;
    font-size: 0.75rem;
    color: #666;
}

.recipe-description {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 1rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.recipe-details {
    display: flex;
    justify-content: space-between;
    color: #888;
    font-size: 0.85rem;
}

/* Loading and Error States */
.loading, .error {
    text-align: center;
    padding: 2rem;
    font-size: 1.1rem;
    color: #555;
    width: 100%;
}

.error {
    color: #ff5252;
    background: #fff0f0;
    border-radius: 8px;
}

.fa-spinner {
    margin-right: 0.5rem;
}

.fa-exclamation-triangle {
    margin-right: 0.5rem;
    color: #ff5252;
}

/* Back Button */
.back-button {
    background: #f0f0f0;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 4px;
    margin: 1rem 0;
    cursor: pointer;
    transition: background-color 0.3s;
    font-size: 1rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.back-button:hover {
    background: #e0e0e0;
}

.back-button i {
    font-size: 0.9rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    main {
        flex-direction: column;
    }
    
    .filters {
        flex: 1;
        margin-right: 0;
        margin-bottom: 1.5rem;
    }
    
    .recipes-container {
        grid-template-columns: 1fr;
    }
}