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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #333;
    background: #f5f5f5;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

header {
    background: #fff;
    padding: 1rem 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
}

header h1 {
    display: inline-block;
    margin-right: 2rem;
}

nav {
    display: inline-block;
}

nav a {
    text-decoration: none;
    color: #666;
    margin-right: 1rem;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    transition: all 0.3s;
}

nav a.active, nav a:hover {
    background: #007bff;
    color: white;
}

.btn {
    background: #007bff;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    transition: background 0.3s;
}

.btn:hover {
    background: #0056b3;
}

.btn.secondary {
    background: #6c757d;
}

.btn.secondary:hover {
    background: #545b62;
}

.btn.delete-btn {
    background: #dc3545;
    margin-left: 1rem;
}

.btn.delete-btn:hover {
    background: #c82333;
}

.edit-section {
    margin-top: 1rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 4px;
}

.edit-section input,
.edit-section textarea {
    width: 100%;
    padding: 0.75rem;
    margin: 0.5rem 0;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.edit-section textarea {
    height: 80px;
    resize: vertical;
}

.edit-buttons {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.recipe-actions {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 4px;
    margin: 1rem 0;
}

.rating-section {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.stars {
    display: flex;
    gap: 2px;
}

.star {
    font-size: 1.5rem;
    color: #ddd;
    cursor: pointer;
    transition: color 0.2s;
}

.star.active,
.star:hover {
    color: #ffc107;
}

.favorite-btn {
    background: #e91e63;
    font-size: 1.2rem;
}

.favorite-btn.active {
    background: #c2185b;
}

.favorite-btn.active::before {
    content: '♥ ';
}

.favorite-btn:not(.active)::before {
    content: '';
}

.recipe-card .rating {
    color: #ffc107;
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

.recipe-card .collection {
    background: #007bff;
    color: white;
    padding: 0.2rem 0.5rem;
    border-radius: 12px;
    font-size: 0.8rem;
    display: inline-block;
    margin-top: 0.5rem;
}

.recipe-card .favorite-heart {
    color: #e91e63;
    font-size: 1.2rem;
}

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

.add-methods {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 1rem;
}

.add-section {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    margin-bottom: 2rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

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

.photo-capture input[type="file"] {
    display: none;
}

.photo-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-bottom: 1rem;
}

#photoPreview {
    margin: 1rem 0;
    text-align: center;
}

#photoPreview img {
    max-width: 100%;
    max-height: 400px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.recipe-management {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.manage-recipe-card {
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 1rem;
    padding-top: 2.5rem;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
}

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

.manage-recipe-card .recipe-actions {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    display: flex;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.9);
    padding: 0.25rem;
    border-radius: 4px;
    opacity: 0;
    transition: opacity 0.3s;
}

.manage-recipe-card:hover .recipe-actions {
    opacity: 1;
}

.recipe-actions button {
    padding: 0.25rem 0.5rem;
    font-size: 0.8rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.edit-recipe-btn {
    background: #007bff;
    color: white;
}

.delete-recipe-btn {
    background: #dc3545;
    color: white;
}

.hero {
    text-align: center;
    padding: 3rem 0;
    background: white;
    border-radius: 8px;
    margin-bottom: 2rem;
}

.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.feature-card {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.add-recipe-section {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    margin-bottom: 2rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.add-recipe-section form {
    display: grid;
    gap: 1rem;
}

.add-recipe-section input, .add-recipe-section textarea {
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.search-section {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    margin-bottom: 2rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.search-controls {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.search-controls input {
    flex: 1;
    min-width: 200px;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
}

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

.recipe-card {
    background: white;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    cursor: pointer;
    transition: transform 0.3s;
}

.recipe-card:hover {
    transform: translateY(-2px);
}

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 2rem;
    border-radius: 8px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 1001;
    background: white;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close:hover {
    color: black;
    background: #f0f0f0;
}

.serving-controls {
    margin: 1rem 0;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 4px;
}

.serving-controls input {
    width: 80px;
    padding: 0.5rem;
    margin: 0 1rem;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.modifications textarea {
    width: 100%;
    height: 100px;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin: 0.5rem 0;
}

.add-tabs {
    display: flex;
    margin-bottom: 1rem;
}

.tab-btn {
    flex: 1;
    padding: 0.75rem;
    border: 1px solid #ddd;
    background: #f8f9fa;
    cursor: pointer;
    transition: all 0.3s;
}

.tab-btn.active {
    background: #007bff;
    color: white;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.shopping-list {
    background: white;
    border-radius: 8px;
    padding: 1rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.shopping-item {
    display: flex;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid #eee;
    cursor: pointer;
    transition: all 0.3s;
}

.shopping-item:hover {
    background: #f8f9fa;
}

.shopping-item.checked {
    opacity: 0.5;
    text-decoration: line-through;
}

.shopping-item input[type="checkbox"] {
    margin-right: 1rem;
    transform: scale(1.2);
}

.empty-state {
    text-align: center;
    padding: 3rem;
    color: #666;
}

.version {
    font-size: 0.5rem;
    color: #999;
    font-weight: normal;
    vertical-align: super;
}

.selected-recipes {
    background: white;
    border-radius: 8px;
    padding: 1rem;
    margin-top: 2rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.store-controls {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
}

.store-controls select {
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    min-width: 150px;
}

.store-management {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 4px;
    margin-bottom: 1rem;
}

.store-management input {
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-right: 1rem;
    width: 200px;
}

.current-store {
    background: white;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.list-actions {
    display: flex;
    gap: 1rem;
    margin-top: 0.5rem;
}

.remove-item-btn {
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    margin-left: auto;
}

.shopping-item {
    position: relative;
}

.shopping-item .remove-item-btn {
    opacity: 0;
    transition: opacity 0.3s;
}

.shopping-item:hover .remove-item-btn {
    opacity: 1;
}

.recipe-count {
    color: #666;
    font-size: 0.8em;
    margin-left: 0.5rem;
}

.collections-section {
    margin-bottom: 1rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 4px;
}

.collection-checkboxes {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 0.5rem;
    margin: 0.5rem 0;
}

.collection-checkboxes label {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.9rem;
}

.floating-actions {
    position: sticky;
    top: 1rem;
    z-index: 100;
    margin-bottom: 2rem;
}

.action-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    background: white;
    padding: 1rem;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    max-width: 600px;
    margin: 0 auto;
}

.action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem;
    text-decoration: none;
    color: #333;
    border: none;
    background: none;
    border-radius: 8px;
    transition: all 0.3s;
    flex: 1;
    min-width: 120px;
    cursor: pointer;
}

.action-btn:hover {
    background: #f8f9fa;
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.action-btn .icon {
    font-size: 2rem;
}

.action-btn .label {
    font-size: 0.9rem;
    font-weight: 500;
    text-align: center;
}

.add-collection {
    margin-bottom: 2rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 4px;
}

.add-collection input {
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-right: 1rem;
    width: 200px;
}

.collections-list {
    max-height: 300px;
    overflow-y: auto;
}

.collection-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    border-bottom: 1px solid #eee;
}

.collection-name {
    font-weight: 500;
    text-transform: capitalize;
}

.default-label {
    color: #666;
    font-size: 0.8rem;
    font-style: italic;
}

.collection-item .delete-btn {
    padding: 0.25rem 0.5rem;
    font-size: 0.8rem;
}

@media (max-width: 768px) {
    .container {
        padding: 0 10px;
    }
    
    header h1 {
        display: block;
        margin-bottom: 1rem;
    }
    
    nav {
        display: block;
    }
    
    .search-controls {
        flex-direction: column;
    }
    
    .search-controls input {
        min-width: auto;
    }
    
    .modal-content {
        margin: 10% auto;
        width: 95%;
    }
}