/* Default reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box; /* Add box-sizing to include padding and border in the width calculation */
}

html,
body {
    height: 100%; /* Set height to 100% */
    width: 100%; /* Set width to 100% */
    -ms-overflow-style: none;
    overflow: auto; /* Enable vertical scrolling */
    scroll-behavior: auto !important; /* Disables default smooth scrolling */
}

body {
    font-family: 'Poppins', sans-serif; /* Use Poppins as the main font */
    background-color: #f4f5f7;
    color: #545454;
    font-size: 1rem; /* Base font size for the body */
}

/* Hide scrollbar for Chrome, Safari, and Edge */
::-webkit-scrollbar {
    display: none;
}

h1 {
    font-size: 2rem;
    font-weight: 700;
    margin: 0;
}

h2,
h3,
h4 {
    margin: 0 !important;
}

ul {
    margin: 0 !important;
    padding: 0;
}

layout {
    display: flex;
    height: 100vh; /* Keeps the container height fixed to the viewport */
    width: 100%;
    background-color: #f4f5f7;
    color: #545454;
    overflow: hidden; /* Prevents unwanted overflow */
}

aside {
    width: 15%;
    height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 20px;
}

nav {
    justify-content: start;
    align-items: start;
}

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

nav ul {
    display: flex;
    flex-direction: column;
    width: 100%;
    gap: 30px;
    padding: 0;
    justify-content: center;
    text-align: center;
}

nav ul a {
    font-weight: 400;
    color: #545454;
    text-decoration: none;
}

nav li {
    display: flex;
    justify-content: start;
    align-items: center;
    font-weight: 500;
    gap: 10px;
    color: #87888c;
}

nav li a {
    display: flex;
    justify-content: start;
    align-items: center;
    font-weight: 500;
    padding: 10px;
    gap: 10px;
    border-radius: 5px;
    width: 100%;
    transition: background-color 0.3s ease-in-out;
}

nav li a:hover {
    background-color: #229dbc; /* Change background color on hover */
    color: white !important;
}

li svg {
    width: 16px;
}

main {
    display: flex;
    flex-direction: column;
    padding: 20px 20px 150px 20px;
    width: 100%;
    overflow-y: auto; /* Enable vertical scroll in the content area */
}

.container {
    width: 100% !important;
    padding: 0 !important;
}

.card-container {
    display: flex;
    width: 100%;
    gap: 20px;
    padding-bottom: 20px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-padding: 20px;
    position: relative;
}

.card {
    scroll-snap-align: start;
    height: 400px; /* Fixed height for the card container */
    width: 100%;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.1);
    transition: transform 0.3s ease;
    padding: 20px;
    color: white;
    display: flex;
    align-items: flex-end;
    justify-content: flex-end;
    font-size: 1.5rem;
    font-weight: bold;
}

/* Hover effect */
.card:hover {
    transform: translateY(-10px);
}

/* Ensure the scroll bar is shown in the content area when needed */
.card-container::after {
    content: '';
    position: absolute;
    right: 0;
    top: 0;
    height: 100%;
    width: 30px;
    pointer-events: none;
    display: none;
}

.card p {
    text-align: right;
}

@media (max-width: 768px) {
    h1 {
        font-size: 1.5rem;
    }
    main {
        padding: 0 0 100px 0;
    }

    aside {
        display: none;
    }

    .card {
        height: 200px;
    }

    .card-workout h1 {
        font-size: 1rem;
    }

    .card-progress h1,
    .card-progress p {
        font-size: 1rem;
    }

    .card-nutrition h1,
    .card-nutrition p {
        font-size: 1rem;
    }

    .card p {
        text-align: right;
        font-size: 0.8rem;
        margin: 0;
    }
}

.mobile-footer-container {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 60px;
    background-color: #ffffff;
    border-top: 1px solid #ddd;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 999;
}

.footer-btn {
    color: #555;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
    transition: color 0.2s ease;
}

.footer-btn:hover {
    color: #007bff;
}

.footer-btn svg {
    width: 24px;
    height: 24px;
}

.footer-btn svg path {
    fill: #c2c2c2;
    transition: fill 0.3s ease;
}

.active svg path {
    fill: #545454 !important;
}

.login-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
    width: 100%;
    padding: 40px 20px;
}

.login-card {
    background: rgba(255, 255, 255, 0.75); /* Vetro chiaro */
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-radius: 20px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.1);
    padding: 40px;
    width: 100%;
    max-width: 600px;
    text-align: center;
    color: #333;
}

.login-card h1 {
    font-size: 2rem;
    font-weight: bold;
    margin-bottom: 30px;
    color: #000;
}

.input-group {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 20px;
}

.input-group input {
    flex: 1 1 45%;
    padding: 14px 16px;
    font-size: 1rem;
    border: 1px solid #ddd;
    background-color: #f9f9f9;
    color: #333;
    transition: all 0.3s ease;
}

.input-group input::placeholder {
    color: #aaa;
}

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

.input-group input:not(:placeholder-shown) {
    border-color: #007bff;
}

.submit-btn {
    width: 100%;
    padding: 16px;
    font-size: 1rem;
    font-weight: bold;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.submit-btn:hover {
    background-color: #14b8a6;
    box-shadow: 0 8px 16px rgba(0, 123, 255, 0.2);
    transform: translateY(-2px);
}

.submit-btn:active {
    background-color: #004a99;
    box-shadow: 0 4px 8px rgba(0, 123, 255, 0.1);
    transform: translateY(0);
}

.error-message {
    color: #e74c3c;
    font-size: 14px;
    margin-top: 15px;
    font-weight: bold;
}

/* Responsive */
@media (max-width: 768px) {
    layout {
        height: auto;
    }
    .login-wrapper {
        padding: 20px;
    }

    .login-card {
        padding: 24px;
    }

    .input-group input {
        flex: 1 1 100%;
    }

    .login-card h1 {
        font-size: 1.5rem;
    }

    .submit-btn {
        padding: 14px;
    }
}
/* Base table styling */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 0 !important;
}

.table-container {
    display: flex;
    flex-direction: column;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 15px 20px;
    border-radius: 15px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    color: white;
    margin: 20px 0;
  
}

th,
td {
    padding: 8px 12px;
    border: 1px solid #ddd;
    text-align: center;
    word-wrap: break-word; /* Ensures long words will wrap to the next line */
    word-break: break-word; /* Breaks words if necessary */
    white-space: normal; /* Allows the text to wrap */
    background-color: rgba(255, 255, 255, 0.08) !important;
}

thead {
    background-color: #f8f8f8;
}

/* Toggle button styling */
.toggle-btn {
    background-color: #229dbc;
    color: white;
    border: none;
    padding: 8px;
    cursor: pointer;
    width: 100%;
    font-size: 16px;
    transition: all 0.3s ease;
}

.toggle-btn:focus {
    outline: none;
}

.toggle-btn:hover {
    background-color: #229dbc;
    border-color: #229dbc;
    box-shadow: 0 8px 12px rgba(0, 0, 0, 0.2);
    transform: translateY(-2px);
}

/* Hide rows by default */
.collapsed {
    display: none;
}

/* Mobile view adjustments */
@media (max-width: 768px) {
    main {
        padding: 20px 20px 100px 20px;
    }

    .table-container {
          overflow-x: auto; /* Permette lo scroll orizzontale */
    width: 100%;
    }
    table {
        max-width: 100%;
    }
    td {
        font-size: 0.6rem;
        word-wrap: break-word; /* Ensure text wraps in mobile view */
    }
}

.table-form {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
}

.table-form select,
.table-form input,
.table-form textarea {
    padding: 8px 12px;
    border: 1px solid #ddd;
    text-align: center;
    word-wrap: break-word;
    word-break: break-word;
    white-space: normal;
    background-color: rgba(255, 255, 255, 0.08);
    color: black;
    border-radius: 5px;
    font-size: 0.9rem;
    flex: 1 1 calc(14% - 10px);
    height: 80px;
    min-width: 120px;
}

.table-form select {
    border: 1px solid #ddd;
    text-align: center;
    word-wrap: break-word;
    word-break: break-word;
    white-space: normal;
    background-color: rgba(255, 255, 255, 0.08);
    color: #7d8191;
    border-radius: 5px;
    font-size: 0.9rem;
    flex: 1 1 calc(14% - 10px);
    height: 80px;
    min-width: 120px;

    /* Hide default chevron icon */
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;

    /* Ensure the select has padding on the right for the icon */
    background: transparent
        url('data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 8 5"%3E%3Cpolygon points="0,0 8,0 4,5" fill="black"/%3E%3C/svg%3E')
        no-repeat;
    background-position: right 12px center; /* Position the icon */
    background-size: 0.6rem; /* Size the icon */
}

/* For the dropdown arrow using Font Awesome or Bootstrap Icons */
.table-form select::-ms-expand {
    display: none; /* Remove default arrow on IE */
}

/* Override Choices.js default styles */
.choices {
    padding: 0;
    border: none;
    background: none;
}

.choices__inner {
    display: flex;
    align-items: center;
    height: 80px;
    padding: 8px 12px;
    border: 1px solid #ddd;
    text-align: center;
    word-wrap: break-word;
    word-break: break-word;
    white-space: normal;
    background-color: rgba(255, 255, 255, 0.08);
    color: black;
    border-radius: 5px;
    font-size: 0.9rem;
    min-width: 120px;
}

/* Make dropdown list match style */
.choices__list--dropdown {
    background-color: rgba(255, 255, 255, 0.95);
    color: black;
    border: 1px solid #ddd;
    border-radius: 5px;
}

.choices__item--selectable {
    padding: 8px 12px;
    cursor: pointer;
}

#search-user-input {
    padding: 8px 12px;
    border: 1px solid #ddd;
    text-align: center;
    word-wrap: break-word;
    word-break: break-word;
    white-space: normal;
    background-color: none;
    color: black;
    border-radius: 5px;
    font-size: 0.9rem;
    flex: 1 1 calc(14% - 10px);
    min-width: 250px;
}

.table-form textarea {
    resize: none;
}

.table-form select option {
    color: black;
    background: rgba(255, 255, 255, 0.9);
}

.table-form button {
    flex: 1 1 100%;
    margin-top: 10px;
    border-radius: 10px;
}

.edit-exercise-btn,
.delete-exercise-btn {
    padding: 5px 10px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    margin: 0 2px;
    color: white;
    font-size: 0.8rem;
}

.edit-exercise-btn {
    background-color: #4caf50;
}

.delete-exercise-btn {
    background-color: #f44336;
}

.save-exercise-btn {
    padding: 5px 10px;
    background-color: #229dbc;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    margin-left: 5px;
    font-size: 0.8rem;
}

.save-exercise-btn:hover {
    background-color: #229dbc;
}

/* Style for input fields */
td input[type='text'],
td input[type='number'],
td select {
    width: 100%; /* Full width */
    padding: 8px 12px;
    margin: 2px 0;
    border: 1px solid #ddd;
    border-radius: 8px; /* Rounded corners */
    background-color: rgba(255, 255, 255, 0.15);
    color: black;
    font-size: 1rem;
    text-align: center;
    box-sizing: border-box; /* Prevents padding from affecting the width */
}

/* Ensuring consistency with readonly inputs */
td input[readonly],
td select[readonly] {
    background-color: rgba(255, 255, 255, 0.2);
    color: #bbb;
    cursor: not-allowed;
}

/* Adjust the file input button text for consistency */
.table-form input[type='file']::file-selector-button {
    padding: 6px 10px;
    border: none;
    border-radius: 5px;
    background-color: rgba(255, 255, 255, 0.15);
    color: black;
    font-size: 0.85rem;
    cursor: pointer;
}

.table-form input[type='file']::file-selector-button:hover {
    background-color: rgba(255, 255, 255, 0.25);
}

/* Responsive inputs on smaller screens */
@media (max-width: 768px) {
    td input[type='text'],
    td input[type='number'],
    td select {
        font-size: 0.9rem; /* Slightly smaller text for mobile */
        padding: 6px;
        width: calc(100% - 12px); /* Accounts for padding and margin */
    }
}

/* Ensuring the cell looks similar to the original table cell style */
td {
    padding: 8px 12px;
    border: 1px solid #ddd;
    text-align: center;
    word-wrap: break-word;
    word-break: break-word;
    white-space: normal;
    background-color: rgba(255, 255, 255, 0.08);
    color: black;
    border-radius: 5px; /* Slightly rounded corners for the cell */
    font-size: 0.9rem;
    flex: 1 1 calc(14% - 10px);
}

@media (max-width: 768px) {
    td {
        font-size: 0.7rem;
    }
}

@media (max-width: 768px) {
    .mb-3 {
        color: #000000;
        display: flex;
        flex-direction: column !important;
        width: 100%;
    }

    .mb-3 label {
        font-weight: bold;
    }
}

.pagination-container {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 15px 20px;
    border-radius: 15px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    color: black;
    margin: 20px 0;
}

@media (max-width: 768px) {
    .pagination-container {
        width: 100% !important;
    }
}
/* Dropdown Styling */
#user-filter {
    background: rgba(255, 255, 255, 0.15);
    color: black;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 10px 15px;
    border-radius: 10px;
    font-size: 1rem;
    outline: none;
    backdrop-filter: blur(8px);
}

#user-filter option {
    color: black;
    background: rgba(255, 255, 255, 0.9);
}

/* Pagination button container */
.pagination-button-container {
    display: flex;
    align-items: center;
}

/* Page Selector Container */
.page-selector-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Buttons */
.page-selector-container button {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 10px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(8px);
    transition: background 0.2s ease;
    color: black;
}

.page-selector-container button:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* SVG Icons */
.page-selector-container svg {
    fill: black;
}

/* Page Number Text */
#pageNumberUser {
    font-size: 1rem;
    font-weight: bold;
    color: black;
}

/* Style for the formatting buttons */
.description-button-container {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
}

.description-button-container button {
    padding: 5px 10px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    background-color: rgba(255, 255, 255, 0.15);
    color: black;
    transition: background-color 0.2s ease;
    font-weight: bold;
}

.description-button-container button:hover {
    background-color: rgba(255, 255, 255, 0.25);
}

/* Editable content box styling */
#description {
    min-height: 150px;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 10px;
    background-color: rgba(255, 255, 255, 0.08);
    color: black;
    font-size: 1rem;
    overflow-y: auto;
    outline: none;
    box-sizing: border-box;
    white-space: pre-wrap;
}

/* Optional: Make selection stand out */
#description:focus {
    border: 1px solid #229dbc;
    box-shadow: 0 0 5px #229dbc;
}

.create-nutrition-form-container p {
   margin: 0 !important;
}

.create-nutrition-form-container li {
    display: flex;
    justify-content: start;
    align-items: center;
    font-weight: 500;
    gap: 10px;
}
