/* Base style for refresh buttons */
#refreshAll {
    background-color: #28a745; /* Green for "go" */
    color: white;
    padding: 5px 10px;
    font-size: 16px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}
#refreshAll:hover {
    background-color: #218838; /* Darker green on hover */
}

.refresh-btn {
    background-color: transparent;
    border: none;
    cursor: pointer;
    padding: 2px;
    transition: color 0.3s, transform 0.2s;
}

/* Column-specific refresh button styling */
.refresh-btn.column-refresh {
    color: #FFFFFF; /* White to match header */
    font-size: 16px;
}

.refresh-btn.column-refresh:hover {
    color: #FFD700; /* Gold on hover */
    transform: rotate(360deg);
}

/* Cell-specific refresh button styling */
.refresh-btn.cell-refresh {
    color: #009A6E; /* Green to match your theme */
    font-size: 14px;
    position: absolute;
    top: 5px;
    left: 5px; /* Positioned in the top-left corner of the cell */
}

.refresh-btn.cell-refresh:hover {
    color: #4CAF50; /* Lighter green on hover */
    transform: rotate(360deg);
}

/* Adjust table cells to position buttons */
#mealTable td {
    position: relative; /* Allows absolute positioning of buttons */
    padding: 10px;
    min-height: 40px; /* Ensure enough space for button */
    vertical-align: top;
}

/* Header adjustments */
#mealTable th {
    padding: 10px;
    vertical-align: middle;
    text-align: center;
}

#mealTable thead tr {
    background-color: #6a6aee;
    color: #FFFFFF;
}

#mealTable {
    width: 100%;
    border-collapse: collapse;
}

.filter-container {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: center;
    padding: 20px;
    direction: rtl;
}

.filter-group {
    position: relative;
}

.filter-btn {
    background-color: #009A6E; /* Darker green */
    color: white;
    padding: 10px 20px;
    font-size: 16px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.2s;
}

.filter-btn:hover {
    background-color: #4CAF50; /* Lighter green */
    transform: translateY(-2px);
}

.filter-content {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background-color: #FFFFFF;
    border: 1px solid #E0E0E0;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    min-width: 250px;
    max-height: 400px;
    overflow-y: auto;
    z-index: 10;
    padding: 10px;
}

.filter-group:hover .filter-content {
    display: block;
}

.collapse-btn {
    width: 100%;
    background-color: #F5F5F5;
    color: #424242;
    padding: 8px 12px;
    border: none;
    border-radius: 6px;
    text-align: right;
    font-size: 14px;
    cursor: pointer;
    margin-bottom: 5px;
}

.collapse-btn:hover {
    background-color: #E0E0E0;
}

.collapse-content {
    display: none;
    padding-right: 20px;
}

.collapse-btn.active + .collapse-content {
    display: block;
}

.tag-group {
    display: flex;
    gap: 5px;
    margin-bottom: 8px;
}

.tag-btn {
    flex: 1;
    padding: 6px 10px;
    font-size: 14px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.3s, color 0.3s;
    text-align: right;
}

.tag-btn.include {
    background-color: #E8F5E9; /* Light green */
    color: #2E7D32;
}

.tag-btn.exclude {
    background-color: #FFEBEE; /* Light red */
    color: #D32F2F;
}

.tag-btn.include:hover {
    background-color: #C8E6C9;
    color: #1B5E20;
}

.tag-btn.exclude:hover {
    background-color: #FFCDD2;
    color: #B71C1C;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .filter-container {
        flex-direction: column;
        align-items: center;
    }
    .filter-content {
        position: static;
        width: 100%;
        max-height: 300px;
    }
}

.search-container {
    display: flex;
    align-items: center;  /* Vertically centers the elements */
    gap: 8px;             /* Adds spacing between elements */
}

/* Optionally, style the input to take up available space */
.search-container .search-bar {
    flex: 1;              /* Makes the input expand to fill the container */
    padding: 8px;         /* Optional: adds padding for better appearance */
}

.qa-card {
    border: 1px solid #ddd;
    border-radius: 15px;
    background-color: #ffffff;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s, box-shadow 0.2s;
    overflow: hidden; /* Ensure content stays within the box */
}

.qa-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 10px rgba(0, 0, 0, 0.15);
}

.qa-question, .qa-answer {
    font-size: 0.9rem; /* Adjust size for better readability */
    color: #555;
    margin-bottom: 10px;
    word-wrap: break-word; /* Break words when necessary */
    overflow-wrap: break-word; /* Ensures wrapping for long words */
    text-overflow: ellipsis; /* Adds ellipsis for long content if overflow */
    white-space: normal; /* Allows text to wrap onto the next line */
}

.save-card-btn {
    background-color: #009a6e;
    color: #fff;
    border: none;
    padding: 10px;
    font-size: 16px;
    border-radius: 5px;
    cursor: pointer;
    display: block;
    margin-top: 20px;
}

.save-card-btn:hover {
    background-color: #007b57;
}

/* Buttons for category items */
.category-btn-card {
    padding: 10px 15px;
    border-radius: 10px;
    border: 1px solid #009A6E;
    background-color: #f0f0f0;
    color: #009A6E;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.category-btn-card.selected {
    background-color: #009A6E;
    color: white;
}

.category-btn-card:hover {
    background-color: #009A6E;
    color: white;
}

.button-container3 {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-bottom: 20px;
}

.type_titles-card {
    font-size: 18px;
    font-weight: bold;
    margin-top: 20px;
    margin-bottom: 10px;
    text-align: center;
    color: #333;
    font-family: 'IranSansWeb', sans-serif;
}

.disease-list-container {
    width: fit-content; /* Adjust container width to fit its content */
    margin: 0 auto; /* Center-align container horizontally */
}

.disease-item {
    background-color: #009A6E30; /* Yellow color, you can customize */
    color: #009A6E; /* Text color */
    padding: 5px 10px; /* Adjust padding for better spacing */
    border-radius: 10px; /* Rounded corners */
    margin: 0 5px;
    display: inline-block; /* Display items inline */
    font-family:'IranSansWeb';
    font-weight: 500;
    font-size: 14px;
    margin-bottom: 20px;
}

.sort-cards {
    width: 20%;
    padding: 5px;
    border: 1px solid #ccc;
    border-radius: 10px;
    font-family:'IranSansWeb';
    background-color: #009A6E;
    color: #fff;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.sort-cards:hover, .sort-cards:focus {
    background-color: #009A6Eda;
}

.tags-container {
    background-color: #f9f9f9; /* Light background for contrast */
    padding: 10px;             /* Add some padding */
    border-radius: 10px;       /* Rounded corners */
    display: flex;             /* Use flexbox for layout */
    flex-wrap: wrap;           /* Allow tags to wrap */
    gap: 5px;                  /* Space between tags */
    justify-content: flex-start; /* Align tags to the left */
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); /* Optional shadow for depth */
}

.card-tag-each {
    display: inline-flex;       /* Use inline-flex for better spacing */
    align-items: center;        /* Center content vertically */
    background-color: #009A6E;  /* Green background */
    color: #fff;                 /* White text */
    padding: 7px;          /* Consistent padding */
    margin: 3px;                /* Uniform margins */
    border-radius: 10px;        /* Rounded corners */
    font-size: 11px;            /* Consistent font size */
    font-family: 'IranSansWeb'; /* Font family */
    transition: background-color 0.3s ease; /* Smooth transition */
}

.card-tag-each:hover {
    background-color: #007B5F; /* Darker shade on hover */
}

body {
    font-family: 'IranSansWeb', sans-serif;
}

.table-container {
    display: flex;
}

.meal-table {
    margin-right: 20px;
}

#mealTable thead th {
    position: sticky;
    top: 0;
    z-index: 2;
}

.nutrient-details {
    display: none;
    max-width: 300px;
    padding: 10px;
    background-color: #f9f9f9;
    border: 1px solid #ddd;
    justify-content: center;
    align-items: center;
    align-content: center;
    align-self: center;
    border-radius: 20px;
    margin-top: 10px;
    margin-left: auto;
    margin-right: auto;
}

.nutrient-details.visible {
    display: block;
}

/* General Styles */
.content {
    background-color: #e3e4e7;
    font-family: 'IranSansWeb', sans-serif;
    margin: 0;
    padding: 0;
}

.card-box {
    max-width: 1500px;
    margin: 20px auto;
    padding: 20px;
    background-color: #fff;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    font-family:'IranSansWeb';
    font-weight: 500;
    font-size: 14px;
}

.titles {
    text-align: right;
    font-size: 24px;
    margin-bottom: 10px;
    font-family: 'IranSansWeb', sans-serif;
    color: #009A6E;
}

.type_titles {
    text-align: center;
    font-size: 16px;
    margin-bottom: 10px;
    font-family: 'IranSansWeb', sans-serif;
}

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

.align-items-center {
    display: flex;
    align-items: center;
    justify-content: center;
}

.submit-btn {
    background-color: #009A6E;
    border-color: #009A6E;
    color: #fff;
    border-radius: 10px;
    padding: 10px 20px;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.submit-btn:hover {
    background-color: #009A6Eda;
}

.save-btn {
    background-color: #009A6E;
    border-color: #009A6E;
    color: #fff;
    border-radius: 10px;
    padding: 10px 20px;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    margin-right: 10px;
}

.save-btn:hover {
    background-color: #009A6Eda;
}

.load-btn {
    background-color: #009A6E;
    border-color: #009A6E;
    color: #fff;
    border-radius: 10px;
    padding: 10px 20px;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.load-btn:hover {
    background-color: #009A6Eda;
}

.btn-edit {
    background-color: #cfd8e6; /* Blue color, you can customize */
    color: #009A6E; /* Text color */
    border-radius: 10px; /* Rounded corners */
    text-decoration: none; /* Remove underline from link */
    transition: background-color 0.3s ease; /* Smooth transition on hover */
    display: inline-flex; /* Align icon and text horizontally */
    align-items: center; /* Center alignment for icon and text */
    margin-left: 10px;
}

.btn-delete {
    background-color: #cfd8e6; /* Blue color, you can customize */
    color: red; /* Text color */
    border-radius: 10px; /* Rounded corners */
    text-decoration: none; /* Remove underline from link */
    transition: background-color 0.3s ease; /* Smooth transition on hover */
    display: inline-flex; /* Align icon and text horizontally */
    align-items: center; /* Center alignment for icon and text */
    margin-left: 10px;
}

.btn-edit:hover {
    background-color: #009A6Eda; /* Darker shade of blue */
    color: #fff; /* Text color on hover */
    border: none;
}

.btn-delete:hover {
    background-color: red; /* Darker shade of blue */
    color: #fff; /* Text color on hover */
    border: none;
}

/* Drag and Drop Styles */
.drag-drop-container {
    display: flex;
    justify-content: center;
    margin-top: 20px;
}

.drag-drop-container ul {
    list-style-type: none;
    padding: 0;
}

.drag-drop-container li {
    padding: 8px;
    margin-bottom: 5px;
    border: 1px solid #ccc;
    cursor: move;
    background-color: #f9f9f9;
}

/* Table Styles */
#mealTable {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

#mealTable th, #mealTable td {
    border: 1px solid #ccc;
    padding: 10px;
    text-align: center;
}

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

.modal-content {
    background-color: #fefefe;
    margin: 5% auto;
    padding: 20px;
    border: 1px solid #888;
    width: 80%;
    max-width: 500px;
    border-radius: 10px;
}

/* Modal styles */
.modal {
    display: none; /* Hidden by default */
    position: fixed; /* Stay in place */
    z-index: 1; /* Sit on top */
    left: 0;
    top: 0;
    width: 100%; /* Full width */
    height: 100%; /* Full height */
    overflow: auto; /* Enable scroll if needed */
    background-color: rgba(0, 0, 0, 0.5); /* Black w/ opacity */
    align-items: center; /* Center vertically */
    justify-content: center; /* Center horizontally */
    margin-left: 100px;
}

.modal-content {
    background-color: #fefefe;
    padding: 20px;
    border: 1px solid #888;
    width: 90%;
    max-width: 500px;
    max-height: 80vh; /* Maximum height of the modal content */
    overflow-y: auto; /* Enable vertical scrolling if content exceeds max-height */
    border-radius: 50px;
    text-align: center;
    box-sizing: border-box; /* Ensure padding and border are included in the element's total width and height */
}

.close {
    color: #aaaaaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
}

.close:hover,
.close:focus {
    color: #000;
    text-decoration: none;
    cursor: pointer;
}

/* Button container to align all buttons in a grid-like format */
.button-container2 {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;  /* Add space between buttons */
    justify-content: flex-start;
    align-items: flex-start;
    margin-bottom: 10px;
}

/* Buttons for category items */
.category-btn {
    padding: 5px 5px;
    border-radius: 10px;
    border: 2px solid #009A6E;
    background-color: #f0f0f0;
    color: #009A6E;
    font-size: 13px;
    cursor: pointer;
    transition: background-color 0.3s ease, color 0.3s ease;
    margin: 5px;
}

.category-btn.selected {
    background-color: #009A6E;
    color: white;
}

.category-btn:hover {
    background-color: #009A6E;
    color: white;
}

/* Scrollable Modal */
.modal-content {
    max-height: 80%;
    overflow-y: auto;
}

.btn-submit {
    background-color: #009A6E;
    border: none;
    color: #fff;
    padding: 10px 20px;
    border-radius: 10px;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.btn-submit:hover,
.btn-submit:focus {
    background-color: #009A6Eda;
}

.scrollable-list-container {
    max-height: 500px;
    overflow-y: auto;
}

.scrollable-list-container::-webkit-scrollbar {
    width: 6px;
}

.scrollable-list-container::-webkit-scrollbar-thumb {
    background-color: #6a6aee;
    border-radius: 3px;
}

/* Simplified CSS for troubleshooting */
.list-group-item {
    display: block; /* Ensure items are block by default */
    cursor: pointer;
}

.hidden {
    display: none !important; /* Use !important to override other rules */
}

.list-group-item.hidden {
    display: none !important; /* Use !important to override other rules */
}

.search-bar {
    width: 100%;
    padding: 10px;
    margin-bottom: 10px;
    border: 1px solid #ccc;
    border-radius: 10px;
    font-family:'IranSansWeb';
}

.sort-btn {
    width: 100%;
    padding: 5px;
    border: 1px solid #ccc;
    border-radius: 10px;
    font-family:'IranSansWeb';
    background-color: #009A6E;
    color: #fff;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.sort-btn:hover, .sort-btn:focus {
    background-color: #009A6Eda;
}

.reset-btn {
    width: 30%;
    padding: 5px;
    border: 1px solid #ccc;
    border-radius: 10px;
    font-family:'IranSansWeb';
    background-color: #dadada;
    color: #009A6E;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.reset-btn:hover, .reset-btn:focus {
    background-color: rgba(116,116,147,0.85);
    color: #FFFFFF;
}

.button-container {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

button {
    padding: 10px 20px;
    margin: 10px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

#saveBtn {
    background-color: #4CAF50;
    color: white;
}

#deleteBtn {
    background-color: #f44336;
    color: white;
}

.unit-switch {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}

.unit-btn {
    flex: 1;
    padding: 10px;
    margin: 5px;
    border: 1px solid #ccc;
    border-radius: 20px;
    background-color: #e9e9e9;
    cursor: pointer;
}

.unit-btn.active {
    background-color: #28a745;
    color: white;
}

.nutrition-info {
    display: flex;
    justify-content: space-around;
    margin-bottom: 20px;
}

.info-item {
    text-align: center;
}

.info-item span {
    display: block;
    font-size: 24px;
    margin-bottom: 5px;
}

.nutrition-info-card {
    display: flex;
    justify-content: space-evenly;
}

.info-item-card {
    text-align: center;
}

.info-item-card span {
    display: block;
    font-size: 12px;
}

#meal-contents-list {
    list-style: none;
    padding: 0;
}

#meal-contents-list li {
    padding: 5px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#meal-contents-list li .actions {
    display: flex;
    gap: 10px;
}

#meal-contents-list li .actions .btn {
    padding: 3px 7px;
    font-size: 12px;
}

.fat-card {
    background-color: #5CC93650;
    color: #5CC936;
    padding: 10px;
    border-radius: 10px;
}

.calories-card {
    background-color: #7366E350;
    color: #7366E3;
    padding: 10px;
    border-radius: 10px;
}

.protein-card {
    background-color: #FF990050;
    color: #FF9900;
    padding: 10px;
    border-radius: 10px;
}

.carb-card {
    background-color: #28CCF750;
    color: #28CCF7;
    padding: 10px;
    border-radius: 10px;
}

.scrollable-list-container {
    max-height: 400px; /* Adjust as needed */
    overflow-y: auto;
}

.list-group-item {
    border: none; /* Remove default border */
    padding: 10px 15px;
}

.card-header {
    background-color: #eef; /* Light blue background */
    border-radius: 5px 5px 0 0;
    padding: 10px;
    font-weight: bold;
}

.card-body {
    background-color: #fff; /* White background */
    border: 1px solid #ddd;
    border-top: none;
    border-radius: 0 0 5px 5px;
    padding: 10px;
}

.card-box .sort-btn {
    border: none;
    color: #fff;
    cursor: pointer;
    border-radius: 10px;
}

.card-box .sort-btn.active {
    background-color: #d0eeda;
    color: #009A6E;
    transition: background-color 0.3s ease;
    box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2);
    font-weight: bolder;
    font-size: medium;
    border-radius: 20px;
}

.card-name {
    padding: 5px;
    border-radius: 10px;
    font-family:'IranSansWeb';
    font-size: 14px;
    color: #009A6E;
    transition: background-color 0.3s ease;
}

/* Add these styles to your CSS */
.dropdown-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: space-evenly; /* Center horizontally */
    align-items: center; /* Center vertically */
    margin: 10px; /* Optional: Add some margin for spacing */
}

.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-btn {
    background-color: #009A6E;
    color: white;
    padding: 5px 15px 5px 15px;
    font-size: 16px;
    border: none;
    cursor: pointer;
    border-radius: 15px;
    text-align: right;
}

.dropdown-content {
    display: none;
    position: absolute;
    background-color: rgb(133, 118, 255);
    min-width: 160px;
    box-shadow: 0px 8px 16px 0px rgba(0, 0, 0, 0.2);
    z-index: 1;
    right: 0; /* Align dropdown to the right */
    text-align: right;
    border-radius: 10px;
    max-height: 300px; /* Set a maximum height */
    overflow-y: auto; /* Make the dropdown scrollable */
}

.dropdown-content button {
    color: black;
    padding: 10px;
    text-decoration: none;
    display: block;
    border: none;
    background: none;
    width: 100%;
    text-align: right;
    cursor: pointer;
}

.dropdown-content button:hover {
    background-color: #d0eeda;
    color: #009A6E;
}

.dropdown:hover .dropdown-content {
    display: block;
}

.dropdown:hover .dropdown-btn {
    background-color: #d0eeda;
    color: #009A6E;
}

.selected-tag {
    display: inline-block;
    margin: 5px;
    padding: 5px 10px;
    border-radius: 15px;
    background-color: #d3d3d3; /* default background color */
    color: #000;
    cursor: pointer;
    font-size: 12px;
}

.include-tag {
    background-color: #4CAF50; /* green background for include tags */
    color: #fff;
}

.exclude-tag {
    background-color: #f44336; /* red background for exclude tags */
    color: #fff;
}

.selected-tag:hover {
    opacity: 0.8;
}

@media (max-width: 768px) {
    .dropdown-container {
        flex-direction: column;
        align-items: center;
    }
    .col-md-8, .col-md-4 {
        flex: 0 0 100%;
        max-width: 100%;
    }
    .card-box {
        margin-bottom: 10px;
    }
}

.card-title {
    font-size: 16px;
    font-weight: black;
    color: #009A6E;
    text-align: right;
}

.toggle-icon {
    width: 5px; /* Very small width */
    height: 5px; /* Very small height */
    padding: 0; /* Remove padding */
    text-align: center; /* Center the icon */
    vertical-align: middle; /* Align icon vertically */
    cursor: pointer; /* Pointer cursor on hover */
}

.toggle-icon i {
    font-size: 10px; /* Smaller icon size */
    margin: 0; /* Remove margin */
}

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

.form-group label {
    font-weight: 600;
    font-size: 16px;
    color: #555;
    margin-bottom: 8px;
    display: block;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.stylish-input {
    width: 100%;
    padding: 12px 15px;
    font-size: 15px;
    border-radius: 6px;
    border: 1px solid #ced4da;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    background-color: #f9f9f9;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
}

.stylish-input:focus {
    border-color: #007bff;
    background-color: #fff;
    box-shadow: 0 0 8px rgba(0, 123, 255, 0.3);
    outline: none;
}

.stylish-input:hover {
    border-color: #80bdff;
} 