/* Custom styles for Recipe Manager */

:root {
    --primary-color: #007bff;
    --success-color: #28a745;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --info-color: #17a2b8;
    --dark-color: #343a40;
    --light-color: #f8f9fa;
}

body {
    background-color: var(--light-color);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

/* Navigation */
.navbar-brand {
    font-weight: 600;
}

.nav-link {
    font-weight: 500;
}

.nav-link.active {
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 0.375rem;
}

/* Cards */
.card {
    border: none;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    border-radius: 0.5rem;
    transition: box-shadow 0.15s ease-in-out;
}

.card:hover {
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.card-header {
    background-color: transparent;
    border-bottom: 1px solid rgba(0, 0, 0, 0.125);
    font-weight: 600;
}

/* Buttons */
.btn {
    font-weight: 500;
    border-radius: 0.375rem;
}

.btn-floating {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 1000;
    width: 3.5rem;
    height: 3.5rem;
    border-radius: 50%;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

/* Recipe cards */
.recipe-card {
    transition: transform 0.2s ease-in-out;
    cursor: pointer;
}

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

.recipe-card .card-img-top {
    height: 200px;
    object-fit: cover;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 3rem;
}

.recipe-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    margin-bottom: 0.5rem;
}

.tag-badge {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: 1rem;
}

.favorite-button {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    width: 2.5rem;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.favorite-button:hover {
    background: white;
    transform: scale(1.1);
}

.favorite-button.favorited {
    color: var(--danger-color);
}

/* Meal plan calendar */
.meal-calendar {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.meal-day {
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    padding: 0.75rem;
    min-height: 150px;
    background: white;
    transition: box-shadow 0.15s ease-in-out;
}

.meal-day:hover {
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

.meal-day-header {
    font-weight: 600;
    text-align: center;
    margin-bottom: 0.5rem;
    padding-bottom: 0.25rem;
    border-bottom: 1px solid #dee2e6;
}

.meal-item {
    background: var(--light-color);
    border-radius: 0.25rem;
    padding: 0.25rem 0.5rem;
    margin-bottom: 0.25rem;
    font-size: 0.875rem;
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.meal-item:hover {
    background: #e9ecef;
}

.meal-item.breakfast { border-left: 3px solid #ffc107; }
.meal-item.lunch { border-left: 3px solid #28a745; }
.meal-item.dinner { border-left: 3px solid #007bff; }
.meal-item.snack { border-left: 3px solid #6c757d; }
.meal-item.drinks { border-left: 3px solid #6f42c1; }

/* Grocery list */
.grocery-category {
    margin-bottom: 1.5rem;
}

.grocery-category-header {
    background: var(--primary-color);
    color: white;
    padding: 0.5rem 0.75rem;
    border-radius: 0.375rem 0.375rem 0 0;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 0.875rem;
}

.grocery-items {
    border: 1px solid #dee2e6;
    border-top: none;
    border-radius: 0 0 0.375rem 0.375rem;
    background: white;
}

.grocery-item {
    padding: 0.75rem;
    border-bottom: 1px solid #f8f9fa;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transition: background-color 0.15s ease;
}

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

.grocery-item:hover {
    background: var(--light-color);
}

.grocery-item.purchased {
    opacity: 0.6;
    text-decoration: line-through;
}

.grocery-checkbox {
    transform: scale(1.2);
}

/* Forms */
.form-floating {
    margin-bottom: 1rem;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

/* Ingredients list */
.ingredient-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid #f8f9fa;
}

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

.ingredient-quantity {
    font-weight: 600;
    color: var(--primary-color);
    min-width: 4rem;
}

.ingredient-unit {
    color: var(--info-color);
    min-width: 3rem;
}

.ingredient-name {
    flex: 1;
}

.ingredient-notes {
    font-style: italic;
    color: var(--dark-color);
    font-size: 0.875rem;
}

/* Instructions */
.instruction-list {
    counter-reset: step-counter;
    list-style: none;
    padding: 0;
}

.instruction-item {
    counter-increment: step-counter;
    margin-bottom: 1rem;
    padding-left: 3rem;
    position: relative;
}

.instruction-item::before {
    content: counter(step-counter);
    position: absolute;
    left: 0;
    top: 0;
    background: var(--primary-color);
    color: white;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.875rem;
}

/* Equipment list */
.equipment-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.equipment-item {
    background: var(--light-color);
    border: 1px solid #dee2e6;
    border-radius: 1rem;
    padding: 0.25rem 0.75rem;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

/* Loading states */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.spinner {
    display: inline-block;
    width: 1rem;
    height: 1rem;
    border: 2px solid #f3f3f3;
    border-top: 2px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Responsive adjustments */
@media (max-width: 768px) {
    .meal-calendar {
        grid-template-columns: 1fr;
    }
    
    .meal-day {
        min-height: auto;
    }
    
    .btn-floating {
        bottom: 1rem;
        right: 1rem;
    }
    
    .ingredient-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }
    
    .ingredient-quantity,
    .ingredient-unit {
        min-width: auto;
    }
}

/* Print styles */
@media print {
    .navbar,
    .btn,
    .btn-floating {
        display: none !important;
    }
    
    .card {
        box-shadow: none;
        border: 1px solid #dee2e6;
    }
    
    .container {
        max-width: none;
    }
}