/* ======================
   HOME PAGE LAYOUT
====================== */

.chat-layout {
    display: flex;
    height: calc(100vh - 60px);
    overflow: hidden;
}

/* ===== SIDEBAR ===== */
.chat-sidebar {
    padding: 0.5rem;
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

/* ===== MOBILE FOLDERS ===== */
.folders-horizontal {
    display: flex;
    align-items: center;
    gap: 6px;
    overflow-x: auto;
}

.folders-horizontal-inner {
    display: flex;
    gap: 8px;
}

/* ===== custom-scroll ===== */

.chat-list::-webkit-scrollbar {
    width: 6px;
}

.chat-list::-webkit-scrollbar-track {
    background: transparent;
}

.chat-list::-webkit-scrollbar-thumb {
    /*background-color: rgba(255,255,255,.25);*/
    /*border-radius: 6px;*/
    opacity: 0;
    /*transition: opacity 0.2s ease;*/
}

.chat-list:hover::-webkit-scrollbar-thumb {
    opacity: 1;
}

/* ======================
   FOLDERS
====================== */

.folder-list .folder-item {
    cursor: pointer;
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
    margin-bottom: 0.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.folder-item.active {
    background: rgba(0, 255, 0, 0.12);
}

/* ======================
   MOBILE
====================== */
@media (max-width: 600px) {

    /*#mobile-folders-wrapper {*/
    /*    display: block;*/
    /*}*/
    .desktop-only {
        display: none !important;
    }

    .chat-layout {
        flex-direction: column;
    }

    .mobile-only {
        display: block;
    }

    .mobile-add-folder {
        display: flex;
        padding: 6px 10px;
        font-size: 20px;
    }
}

@media (max-width: 767px) {

    .chat-sidebar {
        padding: 0;
        margin-bottom: 0.5rem;
    }

    /* контейнер */
    .folder-list {
        display: flex;
        flex-direction: row;
        gap: 0.5rem;

        overflow-x: auto;
        overflow-y: hidden;

        padding: 0.5rem 0.5rem 0.75rem;
        scroll-snap-type: x mandatory;

        -webkit-overflow-scrolling: touch;
    }

    /* скрываем scrollbar */
    .folder-list::-webkit-scrollbar {
        display: none;
    }

    /* плитка папки */
    .folder-item {
        flex: 0 0 auto;
        min-width: 90px;
        max-width: 100px;
        scroll-snap-align: start;
        text-align: center;
        white-space: nowrap;
        padding: 0.5rem 0.75rem;
        border-radius: 1rem;
    }

    .folder-item.active {
        background: rgba(0, 255, 0, 0.18);
        border-color: rgba(0, 255, 0, 0.4);
    }

    .folder-item .badge {
        margin-left: 0.25rem;
        padding: 5px;
    }

    .folder-name {
        max-width: 80px;
    }
}

/* =========================
   MOBILE FOLDERS (Telegram-like)
========================= */
.mobile-folders-wrapper {
    display: flex;
    gap: 14px;
    padding: 8px 12px;
    overflow-x: auto;
    white-space: nowrap;
    border-bottom: 1px solid rgba(0, 255, 100, 0.15);
    scrollbar-width: none;
}

.mobile-folders-wrapper::-webkit-scrollbar {
    display: none;
}

.mobile-folder {
    position: relative;
    padding: 6px 2px;
    font-size: 14px;
    color: #9be7b3;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
}

.mobile-folder.active {
    color: #00ff9c;
}

.mobile-folder.active::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -4px;
    height: 2px;
    background: #00ff9c;
    border-radius: 2px;
}

/* unread badge */
.mobile-folder .unread {
    margin-left: 6px;
    background: #dc3545;
    color: #fff;
    font-size: 11px;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.chat-customize-modal .chat-item::before {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

