/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Georgia', 'Times New Roman', serif;
    line-height: 1.6;
    color: #333;
    background-color: #faf9f7;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    color: #2c3e50;
    margin-bottom: 0.5em;
    font-weight: 600;
}

h1 { font-size: 2.5em; }
h2 { font-size: 2em; }
h3 { font-size: 1.5em; }

p {
    margin-bottom: 1em;
}

a {
    color: #d35400;
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: #e67e22;
    text-decoration: underline;
}

/* Header */
header {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    color: white;
    padding: 1rem 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

header nav {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

header h1 {
    margin: 0;
    color: white;
}

header h1 a {
    color: white;
    text-decoration: none;
}

header h1 a:hover {
    color: #ecf0f1;
    text-decoration: none;
}

/* Main content */
main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    min-height: calc(100vh - 140px);
}

.container {
    width: 100%;
}

/* Search functionality */
.search-section {
    margin-bottom: 2rem;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    padding: 1.5rem;
    border: 1px solid #e8e8e8;
}

.search-field {
    position: relative;
    margin-bottom: 1rem;
}

#ingredient-search {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid #e8e8e8;
    border-radius: 8px;
    font-size: 1rem;
    background: #fafafa;
    transition: all 0.3s ease;
}

#ingredient-search:focus {
    outline: none;
    border-color: #d35400;
    background: white;
    box-shadow: 0 0 0 3px rgba(211, 84, 0, 0.1);
}

.suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #e8e8e8;
    border-top: none;
    border-radius: 0 0 8px 8px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 100;
    display: none;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.suggestion-item {
    padding: 0.75rem 1rem;
    cursor: pointer;
    transition: background-color 0.2s ease;
    border-bottom: 1px solid #f8f9fa;
}

.suggestion-item:hover {
    background-color: #f8f9fa;
}

.suggestion-item:last-child {
    border-bottom: none;
}

.selected-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    min-height: 1rem;
}

.ingredient-tag {
    display: inline-flex;
    align-items: center;
    background: linear-gradient(135deg, #d35400 0%, #e67e22 100%);
    color: white;
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-size: 0.85em;
    font-weight: 500;
    box-shadow: 0 2px 8px rgba(211, 84, 0, 0.3);
    transition: all 0.3s ease;
}

.ingredient-tag:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(211, 84, 0, 0.4);
}

.remove-tag {
    margin-left: 0.5rem;
    cursor: pointer;
    font-weight: bold;
    font-size: 1.1em;
    padding: 0 0.2rem;
    border-radius: 50%;
    transition: background-color 0.2s ease;
}

.remove-tag:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

/* Recipe grid (homepage) */
.recipe-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.recipe-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    padding: 1.5rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid #e8e8e8;
}

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

.recipe-card h3 {
    margin-bottom: 0.5rem;
    color: #2c3e50;
}

.recipe-card h3 a {
    color: #2c3e50;
    text-decoration: none;
}

.recipe-card h3 a:hover {
    color: #d35400;
}

.recipe-date {
    color: #7f8c8d;
    font-size: 0.9em;
    margin-bottom: 1rem;
    font-style: italic;
}

/* Tags */
.recipe-tags {
    margin-top: 1rem;
}

.tag-group {
    margin-bottom: 0.5rem;
}

.tag-group strong {
    color: #2c3e50;
    font-size: 0.9em;
    margin-right: 0.5rem;
}

.tag {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8em;
    margin-right: 0.5rem;
    margin-bottom: 0.25rem;
    font-weight: 500;
}

.cuisine-tag {
    background-color: #e8f4fd;
    color: #2980b9;
    border: 1px solid #d6eaf8;
}

.protein-tag {
    background-color: #e8f5e8;
    color: #27ae60;
    border: 1px solid #d5f4e6;
}

/* Individual recipe pages */
.recipe-content {
    max-width: 800px;
    margin: 0 auto;
}

.back-link {
    display: inline-block;
    margin-bottom: 2rem;
    color: #7f8c8d;
    font-size: 0.9em;
    padding: 0.5rem 1rem;
    border: 1px solid #bdc3c7;
    border-radius: 5px;
    transition: all 0.3s ease;
}

.back-link:hover {
    background-color: #ecf0f1;
    color: #2c3e50;
    text-decoration: none;
}

.recipe {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    overflow: hidden;
}

.recipe-header {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 2rem;
    border-bottom: 1px solid #dee2e6;
}

.recipe-header h1 {
    color: #2c3e50;
    margin-bottom: 1rem;
    font-size: 2.5em;
}

.recipe-meta {
    color: #6c757d;
}

.recipe-body {
    padding: 2rem;
}

/* Recipe content styling */
.recipe-body h1,
.recipe-body h2,
.recipe-body h3 {
    color: #2c3e50;
    margin-top: 2rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #ecf0f1;
}

.recipe-body h1:first-child,
.recipe-body h2:first-child,
.recipe-body h3:first-child {
    margin-top: 0;
}

.recipe-body ul,
.recipe-body ol {
    margin-left: 2rem;
    margin-bottom: 1.5rem;
}

.recipe-body li {
    margin-bottom: 0.5rem;
}

.recipe-body p {
    margin-bottom: 1rem;
    text-align: justify;
}

/* Footer */
footer {
    background-color: #34495e;
    color: white;
    text-align: center;
    padding: 1.5rem 0;
    margin-top: 3rem;
}

footer p {
    margin: 0;
    font-size: 0.9em;
}

/* Responsive design */
@media (max-width: 768px) {
    main {
        padding: 1rem;
    }
    
    .search-section {
        padding: 1rem;
        margin-bottom: 1.5rem;
    }
    
    #ingredient-search {
        font-size: 0.9rem;
    }
    
    .ingredient-tag {
        font-size: 0.8em;
        padding: 0.3rem 0.6rem;
    }
    
    .recipe-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .recipe-card {
        padding: 1rem;
    }
    
    .recipe-header {
        padding: 1.5rem;
    }
    
    .recipe-header h1 {
        font-size: 2em;
    }
    
    .recipe-body {
        padding: 1.5rem;
    }
    
    header nav {
        padding: 0 1rem;
    }
    
    header h1 {
        font-size: 1.8em;
    }
}

@media (max-width: 480px) {
    header h1 {
        font-size: 1.5em;
    }
    
    .recipe-header h1 {
        font-size: 1.8em;
    }
    
    .recipe-grid {
        gap: 1rem;
    }
    
    .recipe-card {
        padding: 0.75rem;
    }
    
    .recipe-body {
        padding: 1rem;
    }
    
    .recipe-header {
        padding: 1rem;
    }
}

/* Print styles */
@media print {
    header, footer, .back-link {
        display: none;
    }
    
    .recipe {
        box-shadow: none;
        border: 1px solid #ccc;
    }
    
    body {
        background: white;
    }
    
    .recipe-body {
        padding: 1rem;
    }
}