/* Kita Mealplan Module Styles */

.kita-mealplan {
    margin: 20px 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* Header */
.mealplan-header {
    margin-bottom: 20px;
}

.mealplan-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.week-title {
    margin: 0;
    font-size: 1.5rem;
    color: #333;
}

.btn-nav {
    padding: 10px 20px;
    background: #4CAF50;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.3s;
}

.btn-nav:hover {
    background: #45a049;
}

.mealplan-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.btn-action {
    padding: 8px 15px;
    background: #2196F3;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
}

.btn-action:hover {
    background: #0b7dda;
}

/* Table */
.mealplan-table {
    overflow-x: auto;
}

.mealplan-table table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.mealplan-table th {
    background: #4CAF50;
    color: white;
    padding: 15px;
    text-align: center;
}

.day-header {
    display: flex;
    flex-direction: column;
}

.day-name {
    font-weight: bold;
    font-size: 16px;
}

.day-date {
    font-size: 14px;
    opacity: 0.9;
}

.meal-cell {
    padding: 15px;
    vertical-align: top;
    border: 1px solid #ddd;
    background: #f9f9f9;
}

.meal-card {
    background: white;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.meal-title {
    font-weight: bold;
    font-size: 16px;
    margin-bottom: 10px;
    color: #333;
}

.meal-icons {
    font-size: 18px;
    margin-bottom: 8px;
}

.meal-allergens {
    color: #666;
    margin-bottom: 10px;
}

.meal-rating-display {
    margin: 10px 0;
    font-size: 14px;
}

.meal-actions {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
    margin-top: 10px;
}

.btn-small {
    padding: 5px 10px;
    background: #2196F3;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
}

.btn-small:hover {
    background: #0b7dda;
}

.btn-delete {
    background: #f44336;
}

.btn-delete:hover {
    background: #da190b;
}

.meal-empty {
    text-align: center;
    padding: 20px;
    color: #999;
}

.btn-add {
    margin-top: 10px;
    padding: 8px 15px;
    background: #4CAF50;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
}

.btn-add:hover {
    background: #45a049;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.4);
}

.modal.active {
    display: block;
}

.modal-content {
    background-color: #fefefe;
    margin: 5% auto;
    padding: 30px;
    border: 1px solid #888;
    border-radius: 10px;
    width: 90%;
    max-width: 600px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.modal-close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.modal-close:hover {
    color: black;
}

/* Form */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #333;
}

.form-group input[type="text"],
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
}

.form-divider {
    text-align: center;
    margin: 20px 0;
    color: #999;
    position: relative;
}

.form-divider::before,
.form-divider::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 40%;
    height: 1px;
    background: #ddd;
}

.form-divider::before {
    left: 0;
}

.form-divider::after {
    right: 0;
}

.dish-results {
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid #ddd;
    border-radius: 5px;
    margin-top: 5px;
    display: none;
}

.dish-results.active {
    display: block;
}

.dish-item {
    padding: 10px;
    cursor: pointer;
    border-bottom: 1px solid #eee;
}

.dish-item:hover {
    background: #f0f0f0;
}

.allergen-grid,
.icon-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 5px;
    font-weight: normal !important;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}

.btn-primary,
.btn-secondary {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
}

.btn-primary {
    background: #4CAF50;
    color: white;
}

.btn-primary:hover {
    background: #45a049;
}

.btn-secondary {
    background: #999;
    color: white;
}

.btn-secondary:hover {
    background: #777;
}

/* Rating Stars */
.rating-stars {
    text-align: center;
    font-size: 40px;
    margin: 20px 0;
}

.star {
    cursor: pointer;
    transition: color 0.2s;
}

.star:hover,
.star.active {
    color: #FFD700;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .mealplan-nav {
        flex-direction: column;
        gap: 10px;
    }

    .week-title {
        font-size: 1.2rem;
        text-align: center;
    }

    .mealplan-table table {
        display: block;
    }

    .mealplan-table thead {
        display: none;
    }

    .mealplan-table tbody,
    .mealplan-table tr,
    .mealplan-table td {
        display: block;
        width: 100%;
    }

    .meal-cell {
        margin-bottom: 15px;
        position: relative;
    }

    .meal-cell::before {
        content: attr(data-day);
        display: block;
        font-weight: bold;
        font-size: 16px;
        margin-bottom: 10px;
        padding: 10px;
        background: #4CAF50;
        color: white;
        border-radius: 5px;
    }

    .allergen-grid,
    .icon-grid {
        grid-template-columns: 1fr;
    }

    .modal-content {
        width: 95%;
        margin: 10% auto;
        padding: 20px;
    }
}

/* Print Styles */
@media print {

    .btn-nav,
    .mealplan-actions,
    .meal-actions,
    .modal {
        display: none !important;
    }

    .kita-mealplan {
        max-width: 100%;
    }

    .mealplan-table table {
        page-break-inside: avoid;
    }
}