/* common.css */
body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 20px;
    background-image: url('https://recipe-base-html.s3.us-east-1.amazonaws.com/purpleKitchen.gif');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    background-repeat: no-repeat;
}

.header {
    text-align: center;
    padding: 20px;
    margin-bottom: 30px;
}

.header h1 {
    color: #ffffff; /* Changed to white */
    margin: 0;
    font-size: 2.5em;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5); /* Added shadow for better readability */
}

.header p {
    color: #ffffff; /* Changed to white */
    margin-top: 10px;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.5); /* Added shadow for better readability */
}

.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    padding: 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.category-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

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

.category-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 5px;
    background: #4CAF50;
}

.category-icon {
    font-size: 2.5em;
    margin-bottom: 15px;
    color: #4CAF50;
}

.category-name {
    font-size: 1.2em;
    color: #333;
    margin: 0;
    padding: 10px 0;
}

.recipe-count {
    color: #666;
    font-size: 0.9em;
    margin-top: 5px;
}

.loading {
    text-align: center;
    color: #666;
    font-size: 1.2em;
    padding: 40px;
}

/* Custom colors for different categories */
.category-card[data-category="desserts"]::before { background: #FF69B4; }
.category-card[data-category="main-dishes"]::before { background: #FF6B6B; }
.category-card[data-category="side-dishes"]::before { background: #4ECDC4; }
.category-card[data-category="appetizers"]::before { background: #45B7D1; }
.category-card[data-category="soups"]::before { background: #96CEB4; }
.category-card[data-category="salads"]::before { background: #7ABD7E; }
.category-card[data-category="breads"]::before { background: #D4A373; }
.category-card[data-category="breakfast"]::before { background: #FFB347; }
.category-card[data-category="beverages"]::before { background: #9B59B6; }
.category-card[data-category="sauces"]::before { background: #E67E22; }

/* Responsive adjustments */
@media (max-width: 768px) {
    .categories-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        padding: 10px;
    }

    .header h1 {
        font-size: 2em;
    }
}

/* Button styles */
.btn {
    transition: all 0.3s ease;
}

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

/* Button text layout styles */
.action-button {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    padding: 0.5rem;
    min-width: 100px;
    text-align: center;
}

.action-button .icon {
    font-size: 1.5rem;
    margin-bottom: 0.25rem;
}

.action-button .text {
    font-size: 0.875rem;
    white-space: normal;
    line-height: 1.2;
}

/* Responsive adjustments for buttons */
@media (max-width: 768px) {
    .action-buttons-container {
        display: flex;
        gap: 0.5rem;
    }
    
    .action-button {
        flex: 1;
    }
}

/* Recipe card and image styles */
.recipe-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    padding: 20px;
}

.recipe-card {
    background: white;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    transition: transform 0.2s;
}

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

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

.recipe-name {
    margin: 10px 0;
    color: #333;
    font-size: 1.2em;
}

.no-recipes {
    text-align: center;
    color: #666;
    font-size: 1.2em;
    padding: 40px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .recipe-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 15px;
        padding: 15px;
    }

    .recipe-card {
        padding: 10px;
    }

    .recipe-image {
        height: 150px;  /* Smaller height on mobile */
    }

    .recipe-name {
        font-size: 1em;  /* Slightly smaller font on mobile */
    }
}


/* Shopping List Styles */
.shopping-items li {
    padding: 8px 0;
    border-bottom: 1px solid #eee;
}

.shopping-items li:last-child {
    border-bottom: none;
}

.form-check-input:checked + .form-check-label {
    text-decoration: line-through;
    color: #6c757d;
}

.quantity-label {
    color: #6c757d;
    font-size: 0.9em;
}

.form-check {
    margin-bottom: 0;
}

.form-check-label {
    margin-left: 8px;
    cursor: pointer;
}

.recipe-selection {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 15px;
    margin-bottom: 20px;
}

.shopping-list {
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 15px;
}

.category-group {
    margin-bottom: 20px;
}

.category-title {
    background-color: #f8f9fa;
    padding: 8px;
    margin-bottom: 10px;
    border-radius: 4px;
    font-weight: bold;
}

.recipe-card.selected {
    background-color: #e7f5ff;
    border-color: #4dabf7;
}

.print-section {
    display: none;
}

/* Print styles */
@media print {
    .no-print {
        display: none;
    }
    
    .print-section {
        display: block;
    }

    .form-check-input {
        -webkit-appearance: none;
        -moz-appearance: none;
        appearance: none;
        width: 16px;
        height: 16px;
        border: 1px solid #000;
        display: inline-block;
        margin-right: 8px;
    }

    .form-check-input:checked {
        background-color: #fff;
        border: 1px solid #000;
        position: relative;
    }

    .form-check-input:checked::after {
        content: '✓';
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        font-size: 12px;
    }
}

/* Container styles */
.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

/* Search Page Styles */
.search-container {
    margin-bottom: 30px;
}

.search-type-toggle {
    margin-bottom: 20px;
}

.ingredient-match {
    background-color: #e7f5ff;
    padding: 2px 6px;
    border-radius: 4px;
    margin-right: 5px;
    margin-bottom: 5px;
    display: inline-block;
    font-size: 0.9em;
}

.ingredients-list {
    margin-top: 10px;
    font-size: 0.9em;
    color: #6c757d;
}

.no-results {
    text-align: center;
    padding: 40px;
    color: #6c757d;
}

/* Recipe Card Styles (if not already in common.css) */
.recipe-details {
    padding: 15px;
}

/* Note: Some styles might already exist in your common.css, 
   such as .recipe-card, .recipe-image, and .loading. 
   Make sure there are no conflicts */


/* Add Recipe Page Styles */
.ingredients-list {
    border: 1px solid #ddd;
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 15px;
}

.ingredient-row {
    border-bottom: 1px solid #eee;
    padding-bottom: 15px;
    margin-bottom: 15px;
}

.image-preview {
    max-width: 300px;
    margin: 10px 0;
    border-radius: 4px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.remove-ingredient {
    color: red;
    cursor: pointer;
}

/* Loading States */
.loading {
    opacity: 0.5;
    pointer-events: none;
}

.loading-spinner {
    display: none;
    margin-left: 10px;
}

.loading .loading-spinner {
    display: inline-block;
}

/* If container max-width needs to be different for add recipe page */
.container.add-recipe {
    max-width: 1000px;  /* Specific width for add recipe page */
}
