/* ======================
   GLOBAL TERMINAL STYLE
   ====================== */
* {
    box-sizing: border-box;
}

body {
    background-color: black;
    color: #00ff00;
    font-family: "Courier New", Courier, monospace;
}

/* Основной контейнер */
/*.container {*/
/*    width: 100%;*/
/*    max-width: 800px;*/
/*    padding: 1rem;*/
/*    background-color: #000;*/
/*    display: flex;*/
/*    flex-direction: column;*/
/*    border-left: 1px solid #003300; !* Легкие границы по бокам *!*/
/*    border-right: 1px solid #003300;*/
/*}*/

h1, h2, h3 {
    margin-top: 0;
    color: #00ff80;
}

a {
    color: inherit;
    text-decoration: none;
}

a:hover {
    text-decoration: none;
}

/* Общие стили форм */
input, textarea, select, button {
    background: #050505;
    color: #0f0;
    border: 1px solid #0a0;
    font-family: inherit;
    padding: 0.5em;
    margin: 0.2em 0;
}

input:focus, textarea:focus {
    outline: none;
    border-color: #00ff00;
    background: #001100;
}

button {
    cursor: pointer;
    background: #002200;
}

button:hover {
    background: #00ff00;
    color: #000;
}

/* ======================
          HEADER
   ====================== */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #0a0;
    padding-bottom: 10px;
    margin-bottom: 20px;
}

.brand-link {
    font-size: 1.2rem;
    font-weight: bold;
    color: #00ff00;
    text-decoration: none !important;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.username {
    color: #00ff80;
    margin-right: 10px;
}

.actions {
    display: flex;
    flex-direction: row;

}

.icon-btn {
    background: transparent;
    border: 1px solid transparent;
    color: #00ff00;
    font-size: 1.2rem;
    padding: 5px;
}

.icon-btn:hover {
    background: transparent;
    color: #fff;
    border-color: #0f0;
}

.login-link {
    border: 1px solid #0a0;
    padding: 5px 10px;
}

.login-link:hover {
    background: #0a0;
    color: #000;
    text-decoration: none;
}

/* ======================
      MOBILE MENU
   ====================== */
.mobile-only {
    display: none;
}

.desktop-only {
    display: flex;
}

/* Выпадающее меню */
.mobile-menu {
    border: 1px solid #0a0;
    margin-bottom: 20px;
    padding: 10px;
    background: #001100;
    animation: fadeIn 0.2s;
}

.hidden {
    display: none;
}

.mobile-user-info {
    font-weight: bold;
    margin-bottom: 10px;
    color: #00ff80;
}

.separator {
    border: 0;
    border-top: 1px dashed #0a0;
    margin: 5px 0 10px 0;
}

.menu-item {
    display: block;
    width: 100%;
    padding: 10px;
    color: #0f0;
    border: 1px solid transparent;
    text-align: left;
    background: transparent;
    margin-bottom: 5px;
}

.menu-item:hover {
    background: #002200;
    border-color: #0a0;
    text-decoration: none;
}

.logout-item {
    color: #ff5555;
    border: 1px solid #330000;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}


.chat-menu-btn {
    background: transparent;
    border: none;
    color: #0a0;
    font-size: 18px;
    cursor: pointer;
    padding: 4px 6px;
    opacity: 0.6;
}

/* ======================
         FOOTER
   ====================== */
/*.main-content {*/
/*    flex: 1; !* Чтобы футер прижимался к низу при малом контенте *!*/
/*}*/

.footer {
    margin-top: auto;
    padding-top: 20px;
    font-size: 0.8em;
    color: #005500;
    text-align: center;
    border-top: 1px solid #003300;
}

/* ======================
    CHAT & MESSAGES
   ====================== */
/* (Оставляем ваши стили чата без изменений, они хорошие) */
#chat-log {
    background: #000;
    border: 1px solid #0a0;
    padding: 0.6em;
    /*height: 60vh; !* Используем высоту экрана *!*/
    /*overflow-y: auto;*/
    margin-bottom: 1em;
    display: flex;
    flex-direction: column;
}

.message {
    max-width: 80%;
    margin-bottom: 0.8em;
    padding: 0.5em 0.8em;
    border: 1px solid #050;
    background-color: #000;
    position: relative;
}

.incoming {
    align-self: flex-start;
    border-left: 3px solid #0a0;
}

.outgoing {
    align-self: flex-end;
    background-color: #002200;
    border-color: #0a0;
    border-right: 3px solid #0f0;
}

.message-text {
    word-wrap: break-word;
    white-space: pre-wrap;
}

.message-meta {
    font-size: 0.7em;
    color: #090;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin-top: 5px;
}

.author {
    margin-right: 3px;
}

.time {
    margin-right: 3px;
}

/* --- Меню настроек чата (три точки) --- */
.chat-header-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #0a0;
    padding-bottom: 10px;
    margin-bottom: 15px;

    position: sticky; /* Включаем "липкое" позиционирование */
    top: 0; /* Приклеиваем элемент к самой верхней точке (0px от верха) */
    background-color: #000; /* Важно! Заливаем фон, чтобы контент не просвечивал */
    z-index: 50; /* Устанавливаем высокий Z-индекс, чтобы он был поверх сообщений */
    padding-top: 10px; /* Добавляем верхний отступ для эстетики */
}

.chat-menu-container {
    position: relative;
    display: inline-block;
}

.dots-btn {
    background: transparent;
    border: none;
    color: #0f0;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0 10px;
    transition: color 0.2s;
}

.dots-btn:hover, .dots-btn:active {
    color: #fff;
}

.chat-dropdown-content {
    display: none; /* Скрыто по умолчанию */
    position: absolute;
    right: 0;
    top: 100%;
    background-color: #000;
    min-width: 200px;
    border: 1px solid #0a0;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.8);
    z-index: 100;
}

/* Класс для отображения через JS */
.chat-dropdown-content.show {
    display: block;
}

.chat-menu-item {
    width: 100%;
    padding: 12px 16px;
    text-align: left;
    background: none;
    border: none;
    border-bottom: 1px solid #003300;
    color: #0f0;
    font-family: inherit;
    cursor: pointer;
    font-size: 0.9rem;
}

.chat-menu-item:hover {
    background-color: #002200;
}

.chat-menu-item.danger {
    color: #ff4444;
}

.chat-menu-item.danger:hover {
    background-color: #220000;
}

/* ANIMATION */
@keyframes terminal-blink {
    50% {
        opacity: 0;
    }
}

.blink-terminal {
    animation: terminal-blink 1.8s linear infinite;
}

/* notifications */
.notifications {
    position: relative;
    display: inline-block;
    margin-right: 15px;
    cursor: pointer;
}



.mobile-badge {
    margin-left: 5px;
    position: relative;
    top: -1px;
}

/* ===== TITLES ===== */
.subtitle {
    color: #0a0;
    margin-top: -8px;
    margin-bottom: 10px;
}

.link-previews { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; }

.link-card {
    display: block; max-width: 420px;
    border: 1px solid #0a0; border-left: 3px solid #00ff80;
    background: #001100; border-radius: 6px; overflow: hidden;
    color: inherit; text-decoration: none;
    transition: background .15s, box-shadow .15s;
}
.link-card:hover { background: #002200; box-shadow: 0 0 12px rgba(0, 255, 128, .18); }

.link-card-img img { width: 100%; max-height: 180px; object-fit: cover; display: block; }
.link-card-body { padding: 8px 10px; }
.link-card-site { font-size: 11px; color: #00ff80; text-transform: uppercase; letter-spacing: .5px; }
.link-card-title {
    font-weight: bold; color: #0f0; margin: 2px 0;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.link-card-desc {
    font-size: 12px; color: #090;
    display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}

/* Скелетон, пока Celery парсит ссылку */
.link-card-loading { height: 64px; position: relative; overflow: hidden; }
.link-card-loading::after {
    content: ""; position: absolute; inset: 0;
    background: linear-gradient(100deg, transparent 30%, rgba(0, 255, 128, .12) 50%, transparent 70%);
    background-size: 200% 100%;
    animation: bg-shimmer 1.4s linear infinite;
}
/* Адаптивность */
/*@media (max-width: 600px) {*/

/*    #mobile-folders-wrapper {*/
/*        border-bottom: 1px solid #003300;*/
/*        padding: 6px 4px;*/
/*    }*/

/*    .chat-list {*/
/*        margin-top: 5px;*/
/*    }*/

/*    !* скрываем sidebar полностью *!*/
/*    .chat-sidebar {*/
/*        display: none !important;*/
/*    }*/

/*    !* показываем мобильные папки *!*/
/*    .mobile-only {*/
/*        display: block;*/
/*    }*/

/*    !* гарантированно прячем desktop-элементы *!*/
/*    .desktop-only {*/
/*        display: none !important;*/
/*    }*/

/*    .container {*/
/*        border: none;*/
/*        padding: 10px;*/
/*    }*/

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

/*    .chat-sidebar {*/
/*        width: 100%;*/
/*        height: auto;*/
/*        border-right: none;*/
/*        border-bottom: 1px solid #003300;*/
/*    }*/

/*    .chat-main {*/
/*        padding: 8px;*/
/*    }*/

/*    .chat-item {*/
/*        align-items: flex-start;*/
/*    }*/

/*    .chat-link {*/
/*        width: 100%;*/
/*    }*/

/*    .chat-last {*/
/*        max-width: 140px;*/
/*    }*/

/*    .chat-icon {*/
/*        width: 34px;*/
/*        height: 34px;*/
/*        font-size: 14px;*/
/*    }*/

/*    .move-chat-btn {*/
/*        opacity: 0.5;*/
/*        font-size: 16px;*/
/*    }*/

/*    .chat-actions {*/
/*        position: absolute;*/
/*        right: -160px;*/
/*        top: 0;*/
/*        height: 100%;*/
/*        display: flex;*/
/*        align-items: center;*/
/*        transition: right 0.25s ease;*/
/*    }*/

/*    .chat-item.swipe-open .chat-actions {*/
/*        right: 0;*/
/*    }*/

/*    .chat-actions-btn {*/
/*        display: none; !* скрываем ⋮ *!*/
/*    }*/

/*}*/


