/* Общие стили для контейнера заметок */
.notes-container {
    max-width: 800px;
    margin: 20px auto;
    padding: 20px;
    background-color: var(--coin-item-bg);
    border-radius: 8px;
    box-shadow: 0 2px 10px var(--main-shadow);
    color: var(--body-text);
}

/* New styles for notes app */
/* Общие стили для контейнера заметок */
.notes-container {
    max-width: 800px;
    margin: 20px auto;
    padding: 20px;
    background-color: var(--coin-item-bg);
    border-radius: 8px;
    box-shadow: 0 2px 10px var(--main-shadow);
    color: var(--body-text);
}

/* New styles for notes app */
#noteTextInput { /* Apply styles to textarea */
    width: 100%;
    padding: 15px;
    margin-bottom: 15px;
    font-size: 16px;
    border: 1px solid var(--search-border);
    border-radius: 8px;
    background-color: var(--search-bg);
    color: var(--search-text);
    box-sizing: border-box;
    resize: vertical; /* Allow vertical resizing */
    min-height: 100px; /* Increase minimum height */
    /* Removed horizontal lines */
}

/* Light mode specific styles for notes app */
.notes-container.light-mode #searchInput,
.notes-container.light-mode #categoryFilter,
.notes-container.light-mode #noteTextInput,
.notes-container.light-mode .note-input-section input[type="text"],
.notes-container.light-mode .checkbox-input-section input[type="text"],
.notes-container.light-mode .reminder-input-section input[type="text"],
.notes-container.light-mode .reminder-input-section input[type="datetime-local"],
.notes-container.light-mode .edit-input {
    background-color: #f0f0f0; /* Светлый фон для полей ввода */
    color: #333; /* Темный текст */
    border-color: #ccc; /* Светлая граница */
}

.notes-container.light-mode #categoryFilter option {
    background-color: #f0f0f0; /* Светлый фон для опций */
    color: #333; /* Темный текст */
}

#noteTextInput::placeholder {
    color: var(--search-placeholder);
}

.edit-button {
    background-color: var(--custom-button-bg);
    color: var(--custom-button-text);
    border: none;
    padding: 5px 10px; /* Match delete button padding */
    border-radius: 4px; /* Match delete button border-radius */
    cursor: pointer;
    font-size: 0.9em; /* Match delete button font-size */
    transition: all 0.3s ease;
    margin-left: 10px; /* Adjust margin to align with delete button */
    flex-shrink: 0; /* Prevent button from shrinking */
}

.edit-button:hover {
    opacity: 0.9;
    transform: translateY(-2px);
}

.delete-button {
    background-color: #f44336;
    color: white;
    border: none;
    padding: 5px 10px; /* Keep padding */
    border-radius: 4px; /* Keep border-radius */
    cursor: pointer;
    font-size: 0.9em; /* Keep font-size */
    transition: all 0.3s ease;
}

.delete-button:hover {
    opacity: 0.9;
    transform: translateY(-2px);
}

.search-filter-container {
    display: flex;
    gap: 10px; /* Уменьшаем gap */
    margin-bottom: 15px; /* Уменьшаем margin */
    flex-wrap: wrap;
}

#searchInput {
    flex-grow: 1;
    min-width: 180px; /* Немного уменьшаем min-width */
    padding: 10px; /* Уменьшаем padding */
    font-size: 15px; /* Уменьшаем шрифт */
    background-color: var(--search-bg); /* Добавлено */
    color: var(--search-text); /* Добавлено */
    border: 1px solid var(--search-border); /* Убедимся, что граница тоже из переменной */
    border-radius: 8px; /* Убедимся, что радиус границы тоже есть */
}

#categoryFilter {
    padding: 10px; /* Уменьшаем padding */
    font-size: 15px; /* Уменьшаем шрифт */
    background-color: var(--search-bg);
    color: var(--search-text);
    border: 1px solid var(--search-border);
    border-radius: 8px;
}

.note-item {
    background-color: var(--coin-item-bg);
    border: 1px solid var(--coin-item-border);
    padding: 15px; /* Уменьшаем padding */
    margin-bottom: 10px; /* Уменьшаем margin */
    border-radius: 8px;
    transition: all 0.3s ease;
}

.note-item:hover {
    box-shadow: 0 4px 12px var(--coin-item-shadow);
}

.note-content {
    margin-bottom: 10px; /* Уменьшаем margin */
}

.note-meta {
    display: flex;
    justify-content: space-between;
    font-size: 13px; /* Уменьшаем шрифт */
    color: var(--search-placeholder);
}

.note-actions {
    margin-top: 10px; /* Уменьшаем margin */
}

.checkbox-item {
    display: flex;
    align-items: center;
}

.note-checkbox {
    margin-right: 8px; /* Уменьшаем margin */
    width: 16px; /* Уменьшаем размер */
    height: 16px; /* Уменьшаем размер */
}

.completed {
    text-decoration: line-through;
    opacity: 0.7;
}

.edit-input {
    width: 100%;
    padding: 8px; /* Уменьшаем padding */
    font-size: 15px; /* Уменьшаем шрифт */
    border: 1px solid var(--search-border);
    border-radius: 6px;
    background-color: var(--search-bg);
    color: var(--search-text);
}

.save-button {
    background-color: #4caf50;
    color: white;
    border: none;
    padding: 6px 12px; /* Уменьшаем padding */
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px; /* Уменьшаем шрифт */
    transition: all 0.3s ease;
}

.save-button:hover {
    opacity: 0.9;
    transform: translateY(-2px);
}

.notes-container h1 {
    text-align: center;
    color: var(--body-text);
    margin-bottom: 20px; /* Уменьшаем margin */
}

/* Стили для секций ввода */
.note-input-section,
.checkbox-input-section,
.reminder-input-section {
    display: flex;
    gap: 8px; /* Уменьшаем gap */
    margin-bottom: 10px; /* Уменьшаем margin */
    align-items: center;
    flex-wrap: wrap;
}

.note-input-section input[type="text"],
.checkbox-input-section input[type="text"],
.reminder-input-section input[type="text"],
.reminder-input-section input[type="datetime-local"] {
    flex-grow: 1;
    padding: 8px; /* Уменьшаем padding */
    border: 1px solid var(--coin-item-border);
    border-radius: 5px;
    background-color: var(--search-bg);
    color: var(--body-text);
    font-size: 0.9em; /* Уменьшаем шрифт */
    min-width: 120px; /* Уменьшаем min-width */
}

.note-input-section button,
.checkbox-input-section button,
.reminder-input-section button {
    padding: 8px 12px; /* Уменьшаем padding */
    background-color: var(--custom-button-bg);
    color: var(--custom-button-text);
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    transition: background-color 0.3s ease;
    flex-shrink: 0;
}

.note-input-section button:hover,
.checkbox-input-section button:hover,
.reminder-input-section button:hover {
    background-color: var(--custom-button-buy-hover-bg);
}

/* Стили для списка заметок */
.notes-list {
    margin-top: 15px; /* Уменьшаем margin */
    border-top: 1px solid var(--coin-item-border);
    padding-top: 15px; /* Уменьшаем padding */
}

.note-item {
    display: flex;
    align-items: center;
    padding: 8px; /* Уменьшаем padding */
    margin-bottom: 8px; /* Уменьшаем margin */
    background-color: var(--coin-item-bg);
    border-radius: 5px;
    box-shadow: 0 1px 3px var(--coin-item-shadow);
    word-break: break-word;
    justify-content: space-between;
}

.note-item.reminder-item {
    flex-wrap: wrap;
}

.note-item .note-content {
    flex-grow: 1;
    margin-right: 8px; /* Уменьшаем margin */
    display: flex;
    align-items: center;
}

.note-item .note-text {
    font-size: 1em; /* Немного уменьшаем шрифт */
    color: var(--body-text);
}

.note-item .note-checkbox {
    margin-right: 8px; /* Уменьшаем margin */
    transform: scale(1.1); /* Немного уменьшаем размер */
    cursor: pointer;
}

.note-item .note-text.completed {
    text-decoration: line-through;
    color: var(--search-placeholder);
}

.note-item .note-reminder-time {
    font-size: 0.8em; /* Уменьшаем шрифт */
    color: var(--search-placeholder);
    margin-top: 3px; /* Уменьшаем margin */
    width: 100%;
    text-align: right;
}

.note-item .delete-button {
    background-color: #dc3545;
    color: white;
    border: none;
    padding: 4px 8px; /* Уменьшаем padding */
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8em; /* Уменьшаем шрифт */
    margin-left: 8px; /* Уменьшаем margin */
    transition: background-color 0.3s ease;
    flex-shrink: 0;
}

.note-item .delete-button:hover {
    background-color: #c82333;
}

/* Адаптивность */
@media (max-width: 600px) {
    .notes-container {
        margin: 10px;
        padding: 15px;
    }

    .note-input-section,
    .checkbox-input-section,
    .reminder-input-section {
        flex-direction: column;
        align-items: stretch;
    }

    .note-input-section button,
    .checkbox-input-section button,
    .reminder-input-section button {
        width: 100%;
    }

    .reminder-input-section input[type="datetime-local"] {
        margin-top: 10px;
    }

    .note-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .note-item .note-content {
        width: 100%;
        margin-right: 0;
        margin-bottom: 10px;
    }

    .note-item .delete-button {
        width: 100%;
        margin-left: 0;
    }

    .note-item.reminder-item .note-reminder-time {
        text-align: left;
    }
}
