/* ==============================
   Общие стили
   ============================== */
   * {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
    max-width: 100%; /* Предотвращает переполнение */
}

.completion-checkbox {
    width: 24px;
    height: 24px;
    margin-right: 10px;
    cursor: pointer;
    accent-color: #4CAF50;
}

/* Индикаторы приоритета (не используются в текущей версии) */
.priority-indicator {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 8px;
}

.completed .item-text {
    text-decoration: line-through;
    opacity: 0.7;
}

/* Стили для ссылок внутри текста */
a {
    color: #4CAF50;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* Сообщения о пустых списках */
.empty-list-message {
    text-align: center;
    color: #a0a0a0;
    font-style: italic;
    padding: 30px 0;
    background-color: #2a3034;
    border-radius: 8px;
    margin: 20px 0;
    max-width: 100%;
}

/* Стили для плейсхолдера при перетаскивании */
.drag-placeholder {
    height: 2px;
    background-color: #4CAF50;
    border-radius: 1px;
    margin: 5px 0;
    transition: all 0.2s ease;
}

/* Стиль для места вставки */
.insert-indicator {
    height: 4px;
    background-color: #4CAF50;
    margin: 0;
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0% { opacity: 0.6; }
    50% { opacity: 1; }
    100% { opacity: 0.6; }
}

/* Добавляем анимацию для элементов */
@keyframes slide-in {
    0% { 
        opacity: 0; 
        transform: translateY(-20px);
    }
    100% { 
        opacity: 1; 
        transform: translateY(0);
    }
}

.todo-item, .wish-item, .shopping-item {
    animation: slide-in 0.3s ease forwards;
}

/* Стили для элементов, которые можно перетаскивать */
.todo-item:hover, .wish-item:hover, .shopping-item:hover:not(.purchased) {
    background-color: #333940;
    transform: translateX(2px);
}

/* Кнопка удаления (красный круг с крестиком) */
.delete-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px; /* Уменьшенный размер */
    height: 20px; /* Уменьшенный размер */
    border-radius: 50%;
    background-color: #f44336;
    color: white;
    font-size: 12px; /* Уменьшенный размер шрифта */
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: 0.2s;
    padding: 0; /* Убираем внутренние отступы */
    line-height: 1; /* Фиксируем высоту строки */
    flex-shrink: 0; /* Не даем сжиматься */
    margin-left: 10px; /* Отступ от содержимого */
}

.delete-btn:hover {
    background-color: #d32f2f;
    transform: scale(1.1);
}

/* Стили для кнопки выхода */
.logout-btn {
    display: none; /* Скрываем кнопку выхода */
    background-color: #353a3f;
    color: #a0a0a0;
    padding: 8px 12px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    margin-left: auto;
    transition: 0.3s;
}

.logout-btn:hover {
    background-color: #4a4f55;
    color: white;
}

/* Стили для ссылок в желаниях */
.wish-item a {
    color: #4CAF50;
    text-decoration: none;
    transition: 0.2s;
}

.wish-item a:hover {
    text-decoration: underline;
    color: #66bb6a;
}

/* Стили для кнопок редактирования и контейнера кнопок */
.item-buttons {
    display: flex;
    align-items: center;
    gap: 5px;
}

.edit-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background-color: #4682B4; /* Синий цвет для кнопки редактирования */
    color: white;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: 0.2s;
    padding: 0;
    line-height: 1;
    flex-shrink: 0;
}

.edit-btn:hover {
    background-color: #5f9de8;
    transform: scale(1.1);
}

.edit-btn svg {
    width: 12px;
    height: 12px;
}

/* Стили для формы редактирования */
.edit-form {
    background-color: #2a3034;
    padding: 15px;
    border-radius: 8px;
    margin: 10px 0;
    border-left: 4px solid #4682B4;
}

.edit-form .form-group {
    margin-bottom: 10px;
}

.edit-form .btn-group {
    margin-top: 10px;
    display: flex;
    gap: 10px;
}

/* Обновление стилей для элементов списка */
.todo-item, .wish-item, .date-item, .shopping-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

body {
    background-color: #2a3034;
    color: #e8e8e8;
    margin: 0;
    padding-top: 5px; /* Уменьшенный отступ сверху */
}

/* Основной контейнер для всего содержимого */
.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 10px 20px; /* Уменьшенный верхний отступ */
    width: 100%;
    box-sizing: border-box;
}

/* ==============================
   Стили для login.html
   ============================== */
.login-container {
    background-color: #3a3f45;
    border-radius: 8px;
    padding: 30px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

/* Центрирование контейнера логина */
body.login-page {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    padding: 20px;
}

/* Заголовок на странице логина */
.login-container h1 {
    text-align: center;
    margin-bottom: 30px;
    color: #fff;
    font-size: 24px;
}

/* Кнопка на странице логина */
.login-container button {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 4px;
    background-color: #4CAF50;
    color: white;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.3s;
}

.login-container button:hover {
    background-color: #45a049;
}

/* Сообщения на странице логина */
.message {
    text-align: center;
    margin-top: 20px;
}

.error {
    color: #f44336;
}

.success {
    color: #4CAF50;
}

/* ==============================
   Стили для языкового переключателя
   ============================== */
.language-switcher {
    display: flex;
    align-items: center;
    margin-left: auto; /* Двигаем вправо */
    margin-right: 0;
}

.language-btn {
    display: inline-block;
    padding: 5px 8px;
    border-radius: 4px;
    background-color: #353a3f;
    color: #a0a0a0;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    margin-right: 8px;
    border: none;
    text-transform: uppercase;
}

.language-btn:hover {
    background-color: #4a4f55;
    color: white;
}

.language-btn.active {
    background-color: #4682B4;
    color: white;
}

/* ==============================
   Стили для index.html
   ============================== */
.header {
    margin-bottom: 15px; /* Уменьшенный отступ снизу */
    margin-top: 5px; /* Уменьшенный отступ сверху */
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header h1 {
    font-size: 24px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 0;
}

.header-controls {
    display: flex;
    align-items: center;
}

.nav-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 1px solid #353a3f;
    padding-bottom: 0;
}

.nav-tab {
    padding: 10px 20px;
    background-color: #3a3f45;
    border-radius: 8px 8px 0 0;
    font-weight: 600;
    cursor: pointer;
    transition: 0.3s;
    text-align: center;
    min-width: 100px;
    position: relative;
    z-index: 1;
}

.nav-tab.active {
    background-color: #4CAF50;
    color: white;
}

.nav-tab.active:after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    height: 3px;
    background-color: #4CAF50;
    z-index: 2;
}

/* Специальная подсветка для вкладки Dates */
.nav-tab[data-tab="dates"].active {
    background-color: #8A2BE2; /* BlueViolet - более насыщенный фиолетовый */
}
.nav-tab[data-tab="dates"].active:after {
    background-color: #8A2BE2;
}

.nav-tab[data-tab="wishlist"].active {
    background-color: #FF9800;
}

.nav-tab[data-tab="wishlist"].active:after {
    background-color: #FF9800;
}

/* Специальная подсветка для вкладки Shopping */
.nav-tab[data-tab="shopping"].active {
    background-color: #2196F3; /* Синий для вкладки Покупки */
}
.nav-tab[data-tab="shopping"].active:after {
    background-color: #2196F3;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.person-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 1px solid #353a3f;
    padding-bottom: 0;
}

.person-tab {
    padding: 10px 20px;
    background-color: #3a3f45;
    border-radius: 8px 8px 0 0;
    font-weight: 600;
    cursor: pointer;
    transition: 0.3s;
    text-align: center;
    min-width: 100px;
    position: relative;
    z-index: 1;
}

.person-tab.active {
    background-color: #4682B4;
    color: white;
}

.person-tab.active:after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    height: 3px;
    background-color: #4682B4;
    z-index: 2;
}

.person-content {
    display: none;
}

.person-content.active {
    display: block;
}

.btn-group {
    display: flex;
    gap: 10px;
}

button {
    cursor: pointer;
    padding: 10px 15px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    transition: 0.3s;
}

.btn-primary {
    background-color: #4CAF50;
    color: white;
}

.btn-secondary {
    background-color: #353a3f;
    color: #e8e8e8;
}

.btn-danger {
    background-color: #f44336;
    color: white;
}

.list-header {
    background-color: #3a3f45;
    padding: 15px;
    border-radius: 8px 8px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 100%;
}

.list-title {
    font-size: 18px;
    font-weight: 700;
    color: #fff;
}

.list-content {
    background-color: #3a3f45;
    border-radius: 0 0 8px 8px;
    padding: 15px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
    max-width: 100%;
}

/* Делаем все секции одинаковой ширины */
#dates .list-content,
#dates .list-header,
#wishlist .list-content,
#wishlist .list-header,
#todo .list-content, 
#todo .list-header,
#shopping .list-content,
#shopping .list-header {
    max-width: 100%;
    margin-left: 0;
    margin-right: 0;
}

/* Форма добавления даты - делаем её шире, как в других разделах */
#dateAddForm {
    max-width: 100%;
    margin: 0 0 20px;
}

/* Базовые стили для элементов списков */
.wish-item, .date-item, .shopping-item {
    background-color: #2a3034;
    margin: 10px 0;
    padding: 15px;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: grab;
    max-width: 100%;
    word-break: break-word;
    overflow-wrap: break-word;
    width: 100%;
}

/* Специальные стили для покупок */
.shopping-item {
    transition: all 0.3s ease;
}

.shopping-item.purchased {
    text-decoration: line-through;
    opacity: 0.7;
    background-color: #232629;
}

.shopping-category {
    margin-top: 20px;
    margin-bottom: 10px;
    padding-bottom: 5px;
    border-bottom: 1px solid #444;
    font-weight: 600;
    display: flex;
    align-items: center;
}

.shopping-category .category-icon {
    margin-right: 10px;
    font-size: 20px;
}

.purchased-section {
    margin-top: 30px;
    opacity: 0.4; /* Делаем весь раздел с купленными товарами более блеклым */
}


.purchased-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    font-weight: 600;
    border-bottom: 1px solid #444;
    margin-bottom: 15px;
}

.clear-purchased-btn {
    background: none; /* Убираем фон полностью */
    color: #f44336; /* Красный цвет для крестика */
    opacity: 0.8; /* Немного более яркая */
    padding: 4px 8px;
    border: none;
    font-size: 18px;
    font-weight: bold;
    opacity: 0.9; /* Хорошо видимый, но не слишком яркий */
}

.clear-purchased-btn:hover {
    background-color: rgba(244, 67, 54, 0.3);
    opacity: 1; /* Полная яркость при наведении */
    transform: scale(1.1); /* Небольшое увеличение при наведении */
}

.checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding-right: 10px;
}

.shopping-checkbox {
    width: 20px;
    height: 20px;
    margin-right: 10px;
    cursor: pointer;
    accent-color: #4CAF50;
}

/* Стили для выбора категории */
.category-selector {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
}

.category-label {
    margin-right: 10px;
    font-weight: 600;
}

.category-buttons {
    display: flex;
    gap: 10px;
}

.category-btn {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background-color: #2a3034;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    transition: all 0.2s;
    padding: 0;
}

.category-btn:hover {
    transform: scale(1.05);
}

.category-btn.active {
    background-color: #4682B4;
    transform: scale(1.1);
}

/* Специальные стили для элементов задач с индикатором приоритета */
.todo-item {
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #2a3034;
    margin: 10px 0;
    padding: 15px;
    border-radius: 8px;
    cursor: grab;
    max-width: 100%;
    word-break: break-word;
    overflow-wrap: break-word;
    width: 100%;
}

/* Создаем цветную полосу слева как псевдоэлемент */
.todo-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    border-top-left-radius: 8px;
    border-bottom-left-radius: 8px;
}

/* Цвета для разных приоритетов */
.todo-item.priority-high::before {
    background-color: #f44336; /* Красный цвет для высокого приоритета */
}

.todo-item.priority-medium::before {
    background-color: #ff9800; /* Оранжевый цвет для среднего приоритета */
}

.todo-item.priority-low::before {
    background-color: #4CAF50; /* Зеленый цвет для низкого приоритета */
}

/* Стили для выбора приоритета */
.priority-selector {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
}

.priority-label {
    margin-right: 10px;
    font-weight: 600;
}

.priority-buttons {
    display: flex;
    gap: 10px;
}

.priority-btn {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    padding: 0;
}

.priority-btn.high {
    background-color: #f44336; /* Красный */
}

.priority-btn.medium {
    background-color: #ff9800; /* Оранжевый */
}

.priority-btn.low {
    background-color: #4CAF50; /* Зелёный */
}

.priority-btn:hover {
    transform: scale(1.1);
}

.priority-btn.active {
    transform: scale(1.2);
    box-shadow: 0 0 0 2px white;
}

/* Выделение даты жирным шрифтом */
.date-item .date-text {
    font-weight: 700;
    color: #fff;
}

/* Стиль для даты и события */
.date-item .item-text {
    display: flex;
    gap: 5px;
}

/* Стили для перетаскивания */
.dragging {
    opacity: 0.5;
    border: 2px dashed #4CAF50;
    background-color: #3a3f45;
    transform: scale(1.02);
    cursor: grabbing !important;
    z-index: 1000;
    position: relative;
}

.item-content {
    display: flex;
    flex-direction: column;
    gap: 5px;
    flex: 1;
    min-width: 0; /* Важно для корректной работы word-break */
}

.item-text {
    word-break: break-word;
}

.item-meta {
    font-size: 12px;
    color: #a0a0a0;
    display: none; /* Скрываем текстовое обозначение приоритета */
}

.item-controls {
    display: flex;
    gap: 10px;
    padding-left: 10px;
}

.trash-icon {
    color: #f44336;
    font-size: 18px;
    cursor: pointer;
    transition: opacity 0.3s;
}

.trash-icon:hover {
    opacity: 0.7;
}

.add-form {
    background-color: #2a3034;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 15px;
    max-width: 100%;
    width: 100%;
}

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

label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
}

input, textarea, select {
    width: 100%;
    padding: 10px 12px;
    border: none;
    border-radius: 4px;
    background-color: #353a3f;
    color: #e8e8e8;
    font-size: 14px;
    max-width: 100%;
}

textarea {
    resize: vertical; /* Только вертикальное изменение размера */
}

select {
    cursor: pointer;
}

.hidden {
    display: none;
}

/* Адаптивный дизайн */
@media (max-width: 768px) {
    .lists-container {
        flex-direction: column;
    }
    
    .list-column {
        width: 100%;
    }
    
    body {
        padding: 10px;
    }
}
    
    .nav-tab, .person-tab {
        padding: 10px 10px;
        min-width: initial;
    }
    
    button {
        padding: 12px 15px;
    }
    
    .item-text {
        font-size: 16px;
    }
    
    .trash-icon {
        font-size: 22px;
    }
    
    /* Увеличиваем размер кнопок на мобильных */
    .completion-checkbox, .shopping-checkbox {
        width: 28px !important;
        height: 28px !important;
    }
    
    .priority-btn, .category-btn {
        width: 36px;
        height: 36px;
    }