/* Reset and base styles */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family:'Montserrat', Arial, sans-serif;
    background-color: #f4f6f9;
    color: #333;
    line-height: 1.6;
    display: flex;
    justify-content: center;
}

.container {
    max-width: 100%;
    margin: 2rem auto;
    padding: 2rem;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

#items-table th {
    background-color: #4caf50; /* Зеленый фон для заголовков столбцов */
    color: white;
    text-align: center;

}
#items-table tr:hover {
    background-color: bisque;
}


h1 {
    font-size: 1.8rem;
    color: black;
    text-align: center;
    margin-bottom: 20px;
    font-family:'Montserrat', Arial, sans-serif;

}

h2 {
    text-align: center;
    font-family:'Montserrat', Arial, sans-serif;

}

form {
    display: flex;
    flex-direction: column;
}

form label {
    margin-bottom: 0.5rem;
    color: #555;
}

form input,
form select,
form textarea {
    padding: 0.75rem;
    font-size: 1rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-bottom: 1rem;
    transition: border-color 0.3s ease;
}

form input:focus,
form select:focus,
form textarea:focus {
    border-color: #007bff;
    outline: none;
}

button,
a {
    display: inline-block;
    margin: 5px 10px;
    padding: 10px 20px;
    font-size: 17px;
    border: none;
    border-radius: 10px;
    background-color: blue;
    color: white;
    cursor: pointer;
    text-decoration: none;
    transition: background-color 0.3s ease;
}

button:hover,
a:hover {
    background-color: black;
}

.button-container {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin: 20px 0;
}

a[href="/items"] {
    background-color: #ff5733;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

table, th, td {
    border: 1px solid #ddd;
    padding: 8px;
}

th {
    background-color: #4caf50;
    color: white;
    text-align: center;
}


td {
    width: 100px; /* Ширина ячейки */
    height: 100px; /* Высота ячейки */
    text-align: center; /* Центрирование текста и изображений */
}


td img {
    max-width: 100%; /* Позволяет изображению занимать всю ширину ячейки */
    max-height: 100%; /* Ограничивает высоту изображения */
    height: auto; /* Сохраняет пропорции изображения */
    width: auto; /* Сохраняет пропорции изображения */
}



td img:hover {
    transform: scale(1.5);
}

.alert {
    padding: 0.75rem 1rem;
    border-radius: 4px;
    margin-top: 1rem;
    background-color: #f8d7da;
    color: #721c24;
}

#suggestions {
    border: 1px solid #ccc;
    max-height: 200px;
    overflow-y: auto;
    background-color: #fff;
    position: absolute;
    width: calc(100% - 2px);
    z-index: 1000;
}

#suggestions div {
    padding: 0.5rem;
    cursor: pointer;
    border-bottom: 1px solid #ddd;
}

#suggestions div:last-child {
    border-bottom: none;
}

#suggestions div:hover {
    background-color: #f1f1f1;
}

@media (max-width: 600px) {
    .container {
        padding: 1.5rem;
    }
}

.btn-primary,
.btn-secondary,
.btn-success {
    font-size: 16px;
    padding: 10px 20px;
    border-radius: 6px;
    transition: all 0.3s ease;
    display: inline-block;
    margin-top: 10px;
}

a {
    text-decoration: none;
}

a:hover {
    color: white;
}

.nav-buttons {
    display: flex;
    justify-content: space-between;
    margin-top: 15px;
}

.nav-buttons a {
    padding: 10px 15px;
    color: white;
    font-weight: bold;
}

.nav-buttons a:first-child {
    background-color: #17a2b8;
    border-radius: 5px;
}

.nav-buttons a:last-child {
    background-color: #28a745;
    border-radius: 5px;
}

.nav-buttons a:hover {
    opacity: 0.8;
}


/* Styling for the sorting buttons */
.sort-buttons {
    text-align: center;
    margin-bottom: 15px;
}

.sort-buttons button {
    padding: 10px 15px;
    margin: 0 5px;
    font-size: 14px;
    cursor: pointer;
}

.sort-buttons button:hover {
    background-color: #007BFF;
    color: white;
}

.out-of-stock {
    background-color: #f8d7da;
}


/* Styling for the table */
#history-table {
    width: 100%;
    margin: 0 auto;
    border-collapse: collapse;
    border: 1px solid #ddd;
    font-size: 16px;
}

#history-table th, #history-table td {
    padding: 10px;
    text-align: center;
    border-bottom: 1px solid #ddd;

}
#history-table th {
    background-color: #4caf50;
}

#history-table tr:hover {
    background-color: bisque;
}


.modal-body .item-row {
    margin-bottom: 10px;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
}

.suggestions-box {
    position: absolute;
    background: #f4f6f9;
    border: 1px solid #ddd;
    max-height: 200px;
    overflow-y: auto;
    width: calc(100% - 20px);
    z-index: 1000;
}

.suggestions-box div {
    padding: 8px;
    cursor: pointer;
}

.suggestions-box div:hover {
    background-color: #e9ecef;
}
