/* CookOut Calculator Styles v1.1 */

#cookout-app {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    position: relative;
    /* Context for absolute positioning if needed */
}

/* Header */
.cookout-header {
    text-align: center;
    margin-bottom: 30px;
}

.cookout-header h2 {
    color: #e31b23;
    /* CookOut Red */
    font-size: 2.5rem;
    margin-bottom: 20px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Navigation */
.cookout-category-nav {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 30px;
}

.cookout-cat-btn {
    background: #fff;
    color: #333;
    border: 2px solid #eee;
    padding: 10px 20px;
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    font-size: 0.95rem;
}

.cookout-cat-btn:hover {
    border-color: #e31b23;
    color: #e31b23;
}

.cookout-cat-btn.active {
    background: #e31b23;
    color: #fff;
    border-color: #e31b23;
    box-shadow: 0 4px 10px rgba(227, 27, 35, 0.3);
}

/* Grid */
.cookout-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
    padding-bottom: 80px;
    /* Space for footer */
}

/* Item Card */
.cookout-item-card {
    background: #fff;
    border: 1px solid #f0f0f0;
    border-radius: 12px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: transform 0.2s, box-shadow 0.2s;
    position: relative;
    overflow: hidden;
}

.cookout-item-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.08);
    border-color: #e31b23;
}

.best-value-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #27ae60;
    color: #fff;
    font-size: 0.7rem;
    padding: 4px 8px;
    border-radius: 4px;
    font-weight: bold;
    z-index: 10;
}

.cookout-item-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #222;
    margin-bottom: 15px;
    line-height: 1.3;
}

.cookout-item-meta {
    font-size: 0.9rem;
    color: #555;
    margin-bottom: 20px;
    background: #fdfdfd;
    padding: 10px;
    border-radius: 6px;
    border: 1px solid #f5f5f5;
}

.cookout-item-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
}

.cookout-item-price {
    font-weight: 800;
    color: #e31b23;
    font-size: 1.4rem;
}

.cookout-add-btn {
    padding: 10px 18px;
    background: #333;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.2s;
}

.cookout-add-btn:hover {
    background: #e31b23;
}

/* Sticky Footer Summary */
.cookout-tray-summary {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 1000px;
    background: #222;
    color: #fff;
    padding: 15px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 1000;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    border-radius: 50px;
    backdrop-filter: blur(10px);
}

.summary-stats {
    display: flex;
    gap: 30px;
}

.stat-box span {
    display: block;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.7;
}

.stat-box strong {
    font-size: 1.4rem;
    color: #fff;
}

.tray-total-price {
    font-size: 1.8rem;
    font-weight: 800;
    color: #f1c40f;
    /* Gold for price */
}

.tray-controls {
    display: flex;
    gap: 10px;
}

.cookout-btn-secondary,
.cookout-btn-reset {
    padding: 8px 16px;
    border-radius: 20px;
    border: none;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
}

.cookout-btn-secondary {
    background: #fff;
    color: #333;
}

.cookout-btn-secondary:hover {
    background: #f1c40f;
}

.cookout-btn-reset {
    background: #e74c3c;
    color: #fff;
}

.cookout-btn-reset:hover {
    background: #c0392b;
}

/* Modal */
.cookout-modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
}

.cookout-modal-content {
    background-color: #fefefe;
    margin: 10% auto;
    padding: 30px;
    border: 1px solid #888;
    width: 90%;
    max-width: 500px;
    border-radius: 12px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
    position: relative;
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.close-modal {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    position: absolute;
    right: 20px;
    top: 15px;
}

.close-modal:hover {
    color: #000;
}

#tray-list {
    list-style: none;
    padding: 0;
    margin-top: 20px;
    max-height: 400px;
    overflow-y: auto;
}

#tray-list li {
    padding: 12px 0;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    font-size: 1rem;
}

#tray-list li:last-child {
    border-bottom: none;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .cookout-tray-summary {
        flex-direction: column;
        gap: 15px;
        border-radius: 20px 20px 0 0;
        bottom: 0;
        width: 100%;
        left: 0;
        transform: none;
        padding: 20px;
    }

    .summary-stats {
        width: 100%;
        justify-content: space-between;
    }

    .tray-controls {
        width: 100%;
    }

    .cookout-btn-secondary,
    .cookout-btn-reset {
        flex: 1;
        text-align: center;
    }

    #cookout-app {
        padding-bottom: 220px;
        /* Increased for mobile footer */
    }
}

/* --- New Features v1.2 --- */

/* Filters Container */
.cookout-filters-container {
    background: #fff;
    padding: 25px;
    border-radius: 12px;
    margin-bottom: 30px;
    border: 1px solid #eee;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
}

.filter-group-title {
    font-size: 0.9rem;
    text-transform: uppercase;
    color: #888;
    margin-bottom: 15px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

/* Segmented Toggle (Life Stage) */
.life-stage-toggles {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 5px;
    margin-bottom: 25px;
}

.life-stage-btn {
    flex: 1;
    min-width: 100px;
    padding: 12px;
    border: 2px solid #eee;
    background: #fff;
    border-radius: 8px;
    text-align: center;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
    font-size: 0.9rem;
}

.life-stage-btn:hover {
    border-color: #ddd;
}

.life-stage-btn.active {
    border-color: #e31b23;
    background: #fff5f5;
    color: #e31b23;
}

/* Diet Goals (Chips) */
.diet-goals-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.diet-chip {
    padding: 8px 16px;
    background: #f5f5f5;
    border-radius: 20px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
    user-select: none;
    border: 1px solid transparent;
}

.diet-chip:hover {
    background: #e9e9e9;
}

.diet-chip.active {
    background: #333;
    color: #fff;
    border-color: #333;
}

/* Calorie Burner Box */
.calorie-burn-box {
    margin-top: 15px;
    background: #eefbf3;
    color: #27ae60;
    padding: 12px;
    border-radius: 8px;
    font-size: 0.9rem;
    text-align: center;
    border: 1px solid #c8e6c9;
}

/* Ingredient Toggles (Modal) */
.ingredient-toggles {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.ing-toggle {
    font-size: 0.8rem;
    padding: 4px 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    background: #fff;
}

.ing-toggle.active {
    background: #e74c3c;
    color: #fff;
    border-color: #e74c3c;
    text-decoration: line-through;
}

/* Recommended Pairing Highlight */
.recommended-highlight {
    border: 2px solid #f1c40f !important;
    position: relative;
}

.recommended-highlight::after {
    content: 'RECOMMENDED';
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    background: #f1c40f;
    color: #333;
    font-size: 0.65rem;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 800;
}

/* Shared Tray Textarea */
#share-summary-text {
    width: 100%;
    height: 100px;
    margin-top: 15px;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-family: monospace;
    font-size: 0.85rem;
}