/* Стили для дневника */
.diary-container {
    display: flex;
    flex-direction: row;
    width: 100%;
    height: 100%;
    padding: 15px;
    box-sizing: border-box;
}

.diary-left {
    width: 70%;
}

.diary-right {
    width: 30%;
}

.diary-form {
    height: 90%;
}

.div-diary-input {
    height: 80%;
}

.diary-input {
    margin-top: 0px;
    margin-left: 2px;
    width: 86%;
    height: 80%;

    font-size: 12px;
    padding: 8px;
    transition: all 0.3s;

    border-radius: 6px;
    background: rgba(var(--accent-color), 0);
    border: 1px dashed rgba(var(--accent-color), 0.4);
    color: var(--accent-color);
    overflow-y: auto;
    resize: none;
}

.diary-input:focus {
    outline: none;
    border: 1px solid rgba(var(--accent-color), 0.3);
    box-shadow: 0 4px 15px rgba(var(--accent-color-back), 0.1);
}

.diary-input:hover {
    box-shadow: 0 4px 15px rgba(var(--accent-color-back), 0.1);
}

.diary-input::-webkit-scrollbar {
    width: 2px;
}

.diary-input::-webkit-scrollbar-track {
    background: rgba(var(--text-color), 0.1);
    border-radius: 3px;
}

.diary-input::-webkit-scrollbar-thumb {
    background: var(--scrollbar-thumb);
    border-radius: 3px;
}

.diary-input::placeholder {
    text-align: center;
    line-height: 6;
}

.diary-input::-webkit-input-placeholder {
    text-align: center;
}

.diary-input::-moz-placeholder {
    text-align: center;
}

.diary-input:-ms-input-placeholder {
    text-align: center;
}

.add-emotion-btn {
    margin-top: 0px;
    margin-bottom: 5px;
    margin-left: 2px;
    width: 95%;
    border-radius: 6px;
    background: rgba(var(--accent-color), 0);
    border: 1px dashed rgba(var(--accent-color), 0.4);
    color: var(--accent-color);
    cursor: pointer;
    transition: all 0.3s;
    font-size: 14px;
}

.diary-settings {
    margin: 2px;
    height: 10%;
    position: absolute;
    bottom: 10px;
    width: 82%;
}

.dyary-settings-btn {
    width: 74%;
    border: 1px solid rgba(var(--accent-color), 0.3);
    border-radius: 6px;
    background: rgba(var(--accent-color), 0.1);
    color: var(--accent-color);
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;

    font-size: 16px;
    line-height: 1;
    font-family: Arial, sans-serif;
}

.dyary-settings-btn:hover {
    background: rgba(var(--accent-color), 0.2);
    border-color: var(--accent-color);
}

.diary-entries {
    border-left: 1px solid rgba(var(--accent-color), 0.1);
    padding-left: 10px;
    padding-bottom: 15px; /* Добавляем отступ снизу */
    
    max-height: 210px;
    overflow-y: hidden;
    scrollbar-gutter: stable;
    
    /* Плавное появление скролла */
    transition: overflow-y 0.2s ease;
}

.diary-entries:hover {
    overflow-y: auto;
}

.diary-entries::-webkit-scrollbar {
    width: 2px;
}

.diary-entries::-webkit-scrollbar-track {
    background: rgba(var(--text-color), 0.1);
    border-radius: 3px;
    margin-top: 5px;
    margin-bottom: 55px;
}

.diary-entries::-webkit-scrollbar-thumb {
    background: var(--scrollbar-thumb);
    border-radius: 3px;
}

.entry {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 6px;
    margin: 5px 0;
    background: rgba(var(--text-color), 0.03);
    border: 1px solid rgba(var(--accent-color), 0.1);
    border-radius: 6px;
    transition: 0.5s;
}

.entry:hover {
    box-shadow: 0 4px 15px rgba(var(--accent-color-back), 0.3);
}

@keyframes entryAppear {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.entry {
    animation: entryAppear 0.6s ease-out;
}

.emotion {
    font-size: 20px;
    display: flex;
    justify-content: center;
    transition: transform 0.5s;
}

.entry:hover .emotion {
    transform: scale(1.7);
}

.entry-date {
    color: rgba(var(--accent-color));
    font-size: 12px;
    display: flex;
    justify-content: center;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1),
        opacity 0.3s ease;
}

.entry:hover .entry-date {
    transform: scale(0.85) translateY(4px);
    opacity: 0.7;
}

.entry:last-child {
    margin-bottom: 45px;
}

.ball-diary-1 {
    width: 160px;
    height: 260px;
    background: rgba(var(--accent-color-back), 0.1);
    filter: blur(50px);
    top: 10%;
    left: 45%;
}

@media (max-width: 768px) {
    .diary-container {
        flex-direction: column;
    }

    .diary-entries {
        border-left: none;
        padding-left: 0;
        border-top: 1px solid rgba(var(--accent-color), 0.1);
        padding-top: 15px;
    }

    .entry {
        padding: 10px;
    }
}

/* Модальное окно */
.diary-container-modal {
    display: flex;
    width: 95%;
    height: 90%;
}

.diary-first-container {
    margin: 5px;
    width: 50%;
    /* border: 1px solid green; */
}

.diary-second-container {
    margin: 5px;
    width: 50%;
    /* border: 1px solid green; */
}

.diary-form-modal {
    display: flex;
    justify-content: space-between;
    width: 100%;
}

.diary-title-div {
    width: 20%;
}

.diary-title-input {
    padding: 10px 12px;
    border: 1px solid rgba(var(--accent-color), 0.3);
    border-radius: 6px;
    background: transparent;
    color: var(--text-color);
    font-size: 12px;
    width: 80%;
}

.diary-title-input:focus {
    outline: none;
    /* Убирает стандартную браузерную обводку */
}

.diary-text-div {
    display: flex;
    width: 40%;
    justify-content: center;
}

.diary-text-input {
    padding: 0px 8px;
    border: 1px solid rgba(var(--accent-color), 0.3);
    border-radius: 6px;
    background: transparent;
    color: var(--text-color);
    font-size: 12px;
    width: 90%;
}

.diary-text-input:focus {
    outline: none;
    /* Убирает стандартную браузерную обводку */
}

.diary-emotion-div {
    width: 29%;
}

/* .emotion-select-modal {
    padding: 8px 2px;
    width: 90%;
    border-radius: 6px;
    background: rgba(var(--accent-color), 0);
    border: 1px solid rgba(var(--accent-color), 0.4);
    color: var(--text-color);
    font-size: 14px;
    cursor: pointer;
} */

.diary-add-div {
    width: 10%;
}

.diary-add-btn {
    padding: 8px 4px;
    border: 1px solid rgba(var(--accent-color), 0.3);
    border-radius: 6px;
    background: rgba(var(--accent-color), 0.1);
    color: var(--text-color);
    cursor: pointer;
    height: 100%;
    width: 100%;
}

.list-group-diary {
    max-height: 45vh;
    width: 100%;
    padding: 0px;
    overflow-y: hidden;
    scrollbar-gutter: stable;
}

.list-group-diary:hover {
    overflow-y: auto;
}

.list-group-diary::-webkit-scrollbar {
    width: 2px;
}

.list-group-diary::-webkit-scrollbar-track {
    background: rgba(var(--text-color), 0.1);
    border-radius: 3px;
}

.list-group-diary::-webkit-scrollbar-thumb {
    background: var(--scrollbar-thumb);
    border-radius: 3px;
}

.list-group-entry {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: rgba(var(--text-color), 0.03);
    border: 1px solid rgba(var(--accent-color), 0.1);
    margin-top: 8px;
    border-radius: 8px;
    width: 92%;
}

.list-entry-emotion {
    width: 10%;
    font-size: 16px;
}

.list-entry-title {
    color: var(--text-color);
    width: 20%;
    font-size: 12px;
    font-weight: 700;
    overflow: hidden;
}

.list-entry-text {
    color: rgba(var(--accent-color));
    /* color: var(--text-color); */
    width: 60%;
    font-size: 10px;
}

.entry-delete-btn {
    padding: 8px 12px;
    border: 1px solid rgba(var(--accent-color), 0.3);
    border-radius: 6px;
    background: rgba(var(--accent-color), 0.1);
    color: var(--text-color);
    cursor: pointer;
    height: 100%;
}

/* .trash-icon {
    width: 16px;
    height: 16px;
    filter: invert(0.8);
    transition: all 0.3s ease;
} */

/* Новости цитат */

/* Общие стили блока */
.diary-news {
    /* border: 1px solid white; */
    margin-left: 40px;
    margin-top: 0px;
    padding: 15px;
    height: 100%;
    width: 100%;
}

/* Шапка блока */
.diary-header {
    /* position: relative; */
    margin-bottom: 20px;
    margin-top: 0px;
    color: var(--text-color);
    text-align: center;
    font-size: 14px;
    font-weight: 700;
}

.diary-decor-line {
    height: 1px;
    background: linear-gradient(90deg,
            transparent 0%,
            rgba(var(--accent-color), 0.4) 50%,
            transparent 100%);
    margin: 10px 0;
}

/* Список советов */
.diary-list {
    overflow-y: hidden;
    scrollbar-gutter: stable;
    width: 100%;
    height: 41vh;
}

.diary-list:hover {
    overflow-y: auto;
}

/* Кастомизация скролла */
.diary-list::-webkit-scrollbar {
    width: 2px;
}

.diary-list::-webkit-scrollbar-thumb {
    background: rgba(var(--accent-color), 0.5);
    border-radius: 3px;
}

.diary-list::-webkit-scrollbar-track {
    background: rgba(var(--text-color), 0.05);
}

/* Карточка совета */
.diary-card {
    background: rgba(var(--primary-color), 0.1);
    border-radius: 6px;
    padding: 15px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
}

.diary-card:hover {
    background: rgba(var(--primary-color), 0.15);
}

.diary-icon {
    font-size: 1.6em;
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.diary-content h4 {
    color: var(--success-light);
    margin: 0 0 5px 0;
    font-size: 12px;
}

.diary-content p {
    color: var(--text-color);
    /* color: rgba(var(--text-color), 0.8); */
    margin: 0;
    font-size: 10px;
    line-height: 1.4;
}

.diary-buttons {
    display: flex;
    justify-content: space-between;
    width: 95%;
    margin-left: 2px;
    margin-top: 5px;
}

/* Обновленные стили для кнопок */
.add-emotion-btn {
    flex: 1;
    /* Занимает все доступное пространство */
    margin-right: 8px;
    /* Отступ между кнопками */
    margin-bottom: 0;
    height: 100%;
    /* Фиксированная высота */
    display: flex;
    align-items: center;
    justify-content: center;
}

.dyary-settings-btn {
    width: 20%;
    height: 100%;
    /* Такая же высота как у соседней кнопки */
    margin: 0;
    flex-shrink: 0;
    /* Запрет уменьшения размера */
}

/* Удаляем старый контейнер настроек */
.diary-settings {
    display: none;
}

/* Стили для мобильных устройств */
@media (max-width: 768px) {
    .mobile-diary {
        position: fixed;
        bottom: 80px;
        left: 50%;
        transform: translateX(-50%);
        width: 90%;
        max-width: 400px;
        height: auto;
        max-height: 60vh;
        z-index: 90;
    }

    .diary-container {
        flex-direction: column;
        height: auto;
        padding: 10px;
    }

    .diary-left,
    .diary-right {
        width: 100%;
    }

    .diary-form {
        height: auto;
        margin-bottom: 15px;
    }

    .div-diary-input {
        height: 120px;
    }

    .diary-input {
        width: 95%;
        height: 100%;
        margin-left: 0;
    }

    .emotion-select {
        width: 100%;
        margin-left: 0;
    }

    .diary-buttons {
        margin-top: 25px;
        width: 100%;
        margin-left: 0;
    }

    .diary-entries {
        border-left: none;
        border-top: 1px solid rgba(var(--accent-color), 0.1);
        padding-left: 0;
        padding-top: 10px;
        max-height: 150px;
        overflow-y: auto;
    }

    .entry {
        flex-direction: row;
        justify-content: space-between;
        padding: 10px;
    }

    .emotion {
        font-size: 24px;
        margin-right: 10px;
    }

    .entry-date {
        font-size: 14px;
    }

    /* Улучшаем скролл для мобильных */
    .diary-entries::-webkit-scrollbar {
        width: 4px;
    }

    /* Увеличиваем область нажатия для мобильных */
    .add-emotion-btn,
    .dyary-settings-btn {
        height: 40px;
        font-size: 16px;
    }
}

/* Мобильные стили для дневника */
@media (max-width: 768px) {
    #diaryModal .modal-content {
        width: 95vw !important;
        max-width: 100vw;
        height: 90vh !important;
        margin: 5vh auto !important;
        padding: 10px;
        box-sizing: border-box;
    }

    .diary-container-modal {
        flex-direction: column;
        width: 100%;
        height: auto;
    }

    .diary-first-container,
    .diary-second-container {
        width: 100% !important;
        margin: 5px 0 !important;
    }

    /* Адаптация формы добавления записей */
    .diary-form-modal {
        flex-direction: column;
        gap: 10px;
    }

    .diary-title-div,
    .diary-text-div,
    .diary-emotion-div,
    .diary-add-div {
        width: 100% !important;
    }

    .diary-title-input,
    .diary-text-input,
    .emotion-select-modal {
        width: 100% !important;
        box-sizing: border-box;
        font-size: 14px;
        padding: 10px 15px;
    }

    .diary-add-btn {
        width: 100%;
        padding: 12px;
        min-height: 44px;
    }

    /* Стили для списка записей */
    .list-group-diary {
        max-height: 30vh;
        width: 100%;
    }

    .list-group-entry {
        flex-direction: column;
        align-items: flex-start;
        padding: 12px;
        width: 93%;
    }

    .list-entry-emotion,
    .list-entry-title,
    .list-entry-text {
        width: 100% !important;
        margin-bottom: 5px;
    }

    .list-entry-emotion {
        font-size: 20px;
    }

    /* Стили для рекомендаций */
    .diary-news {
        margin-left: 0;
        padding: 10px;
    }

    .diary-list {
        height: 30vh;
    }

    .diary-card {
        flex-direction: column;
        align-items: flex-start;
        padding: 12px;
    }

    .diary-icon {
        margin-bottom: 8px;
        font-size: 24px;
    }

    /* Улучшение заголовка */
    .diary-header {
        font-size: 16px;
        padding-bottom: 15px;
    }

    .diary-decor-line {
        width: 100%;
        margin: 8px auto;
    }

    /* Увеличение шрифтов */
    .diary-content h4 {
        font-size: 14px;
    }

    .diary-content p {
        font-size: 12px;
    }
}

.emotion-select-modal {
    padding: 8px 12px; /* Увеличил правый padding для стрелки */
    width: 90%;
    border-radius: 6px;
    background: rgba(var(--accent-color), 0);
    border: 1px solid rgba(var(--accent-color), 0.4);
    color: var(--text-color);
    font-size: 12px;
    cursor: pointer;
    
    /* Убираем стандартную стрелку */
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    
    /* Кастомная стрелка */
    background-image: url('data:image/svg+xml;utf8,<svg fill="white" height="16" viewBox="0 0 24 24" width="16" xmlns="http://www.w3.org/2000/svg"><path d="M7 10l5 5 5-5z"/></svg>');
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 16px;
    padding-right: 30px; /* Оставляем место для стрелки */
}

/* Для Firefox */
@-moz-document url-prefix() {
    .emotion-select-modal {
        text-indent: 0.01px;
        text-overflow: '';
        background-image: none; /* В Firefox лучше не использовать SVG стрелку */
    }
    .emotion-select-modal:after {
        content: "▼";
        position: absolute;
        right: 15px;
        top: 50%;
        transform: translateY(-50%);
        color: var(--text-color);
        font-size: 12px;
    }
}

/* Для IE */
.emotion-select-modal::-ms-expand {
    display: none;
}

/* Стилизация выпадающего списка (Chrome/Safari) */
.emotion-select-modal option {
    background: #333; /* Темный фон */
    color: #fff; /* Белый текст */
    padding: 8px;
}

/* Скругленные углы выпадающего списка (Chrome 120+) */
@media screen and (-webkit-min-device-pixel-ratio:0) {
    .emotion-select-modal {
        border-radius: 6px;
    }
    .emotion-select-modal:focus {
        border-radius: 6px 6px 0 0;
    }
    .emotion-select-modal option {
        border-radius: 0;
    }
}

/* Дополнительно: стили при наведении и фокусе */
.emotion-select-modal:hover {
    border-color: rgba(var(--accent-color), 0.7);
}
.emotion-select-modal:focus {
    outline: none;
    border-color: rgba(var(--accent-color), 0.9);
    box-shadow: 0 0 0 2px rgba(var(--accent-color), 0.2);
}

/* Emotion Select */
.emotion-select {
    margin: 0 0 5px 2px;
    padding: 2px 25px 2px 12px; /* Увеличил правый padding для стрелки */
    width: 95%;
    border-radius: 6px;
    background: rgba(var(--accent-color), 0);
    border: 1px dashed rgba(var(--accent-color), 0.4);
    color: var(--text-color);
    font-size: 12px;
    cursor: pointer;
    
    /* Убираем стандартную стрелку */
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    
    /* Кастомная стрелка (меньшего размера для компактного select) */
    background-image: url('data:image/svg+xml;utf8,<svg fill="white" height="12" viewBox="0 0 24 24" width="12" xmlns="http://www.w3.org/2000/svg"><path d="M7 10l5 5 5-5z"/></svg>');
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 12px;
}

/* Для Firefox */
@-moz-document url-prefix() {
    .emotion-select {
        text-indent: 0.01px;
        text-overflow: '';
        padding-right: 20px;
        background-image: none;
        position: relative;
    }
    .emotion-select:after {
        content: "▼";
        position: absolute;
        right: 8px;
        top: 50%;
        transform: translateY(-50%) scale(0.8);
        color: var(--text-color);
        font-size: 10px;
    }
}

/* Для IE */
.emotion-select::-ms-expand {
    display: none;
}

/* Стилизация выпадающего списка (Chrome/Safari) */
@media screen and (-webkit-min-device-pixel-ratio:0) {
    .emotion-select option {
        background: #333;
        color: #fff;
        padding: 6px;
        font-size: 12px;
    }
    
    /* Скругленные углы только для закрытого состояния */
    .emotion-select {
        border-radius: 6px;
    }
    .emotion-select:focus {
        border-radius: 6px 6px 0 0;
    }
}

/* Состояния для лучшего UX */
.emotion-select:hover {
    border-color: rgba(var(--accent-color), 0.6);
}
.emotion-select:focus {
    outline: none;
    border-style: solid; /* Меняем пунктир на сплошную при фокусе */
    border-color: rgba(var(--accent-color), 0.8);
    box-shadow: 0 0 0 2px rgba(var(--accent-color), 0.1);
}