﻿body {
    font-family: Arial, sans-serif;
    background-color: #f5f5f5;
    margin: 0;
    padding: 0;
    font-size: 14px;
}

.container {
    width: 80%;
    margin: 0 auto;
    max-width: 1200px;
}

header {
    background-color: #4a4a4a;
    color: white;
    padding: 5px 0;
    text-align: center;
    font-size: 18px;
}

nav ul {
    list-style: none;
    padding: 0;
    display: flex;
    justify-content: center;
    gap: 15px;
}

nav ul li {
    display: inline;
}

nav ul li a {
    color: white;
    text-decoration: none;
    font-weight: bold;
}

main {
    background-color: white;
    padding: 15px;
    margin: 15px 0;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    font-size: 14px;
}

form {
    display: flex;
    flex-direction: column;
    align-items: center; /* Центрирование формы */
}

form label {
    margin-top: 10px;
    width: 100%;
    text-align: left; /* Выровнять текст по левому краю */
}

form input[type="text"],
form input[type="password"],
form input[type="datetime-local"],
form input[type="file"],
form textarea {
    margin-top: 5px;
    padding: 10px;
    font-size: 14px;
    border: 1px solid #ccc;
    border-radius: 4px;
    width: 100%;
}

form input[type="date"] {
    padding: 10px;
    font-size: 14px;
    border: 1px solid #ccc;
    border-radius: 4px;
}

form textarea {
    height: 200px;
    resize: vertical;
}

form button {
    margin-top: 20px;
    padding: 10px;
    font-size: 14px;
    background-color: #4a4a4a;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

form button:hover {
    background-color: #6a6a6a;
}

footer {
    background-color: #4a4a4a;
    color: white;
    text-align: center;
    padding: 5px 0;
    margin-top: 15px;
    border-radius: 0 0 8px 8px;
}

ul {
    list-style: none;
    padding: 0;
}

ul li {
    margin: 10px 0;
}

img.paperclip {
    width: 16px;
    height: 16px;
    vertical-align: middle;
    margin-right: 5px;
}

/* Медиазапросы для адаптации под мобильные устройства */
@media (max-width: 768px) {
    .container {
        width: 90%;
    }

    nav ul {
        flex-direction: column;
        align-items: center;
    }

    form button {
        width: 100%;
    }
}

/* Стили для таблицы */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

table, th, td {
    border: 1px solid #ccc;
}

th, td {
    padding: 10px;
    text-align: left;
}

thead {
    background-color: #f4f4f4;
}

th {
    background-color: #4a4a4a;
    color: white;
    font-size: 14px;
}

tr:nth-child(even) {
    background-color: #f9f9f9;
}

/* Стили для разделов */
.sections {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: space-between;
}

.section {
    flex: 1 1 calc(50% - 20px);
    background-color: #fff;
    padding: 20px;
    border: 1px solid #ccc;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    transition: box-shadow 0.3s ease;
}

.section:hover {
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.2);
}

.section h3 a {
    text-decoration: none;
    color: #4a4a4a;
}

.section p {
    margin: 10px 0 0;
}

/* Адаптация разделов под мобильные устройства */
@media (max-width: 768px) {
    .section {
        flex: 1 1 100%;
    }
}

/* Стили для действий */
.actions a {
    margin-right: 10px;
    text-decoration: none;
    color: #007bff;
}

.actions a:hover {
    text-decoration: underline;
}

.actions img {
    width: 16px;
    height: 16px;
    vertical-align: middle;
    margin-right: 5px;
}

/* Стили для кнопок действий */
.action-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.action-buttons a {
    display: inline-block;
    padding: 5px 10px;
    color: white;
    border-radius: 4px;
    text-decoration: none;
}

.action-buttons a.edit {
    background-color: #007bff;
}

.action-buttons a.delete {
    background-color: #dc3545;
}

.action-buttons a.mark {
    background-color: #28a745;
}

/* Стили для состояния покупок */
.purchase-row.purchased {
    background-color: #d4edda;
}

.purchase-row.not-purchased {
    background-color: #f8d7da;
}

/* Адаптация таблиц под мобильные устройства */
@media (max-width: 768px) {
    table, th, td {
        display: block;
        width: 100%;
    }

    th {
        display: none;
    }

    td {
        border: none;
        position: relative;
        padding-left: 50%;
        text-align: right;
    }

    td::before {
        content: attr(data-label);
        position: absolute;
        left: 0;
        width: 50%;
        padding-left: 10px;
        font-weight: bold;
        text-align: left;
    }

    .actions a {
        display: block;
        margin-bottom: 5px;
    }
}

/* Стили для страницы входа */
.login-container {
    background-color: #fff;
    padding: 20px;
    border: 1px solid #ccc;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    max-width: 400px;
    margin: 50px auto;
}

.login-container h2 {
    text-align: center;
    margin-bottom: 20px;
}

.login-container form {
    display: flex;
    flex-direction: column;
}

.login-container form label {
    margin-top: 10px;
    text-align: left; /* Выровнять текст по левому краю */
}

.login-container form input[type="text"],
.login-container form input[type="password"] {
    margin-top: 5px;
    padding: 10px;
    font-size: 14px;
    border: 1px solid #ccc;
    border-radius: 4px;
    width: 100%;
}

.login-container form button {
    margin-top: 20px;
    padding: 10px;
    font-size: 14px;
    background-color: #4a4a4a;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.login-container form button:hover {
    background-color: #6a6a6a;
}

/* Медиазапросы для страницы входа */
@media (max-width: 768px) {
    .login-container {
        width: 90%;
    }
}
