/* ==========================================
   MAIN.CSS — СТИЛИ ДЛЯ ГЛАВНОЙ СТРАНИЦЫ ФОРУМА
   ========================================== */

/* ===== ГЛОБАЛ ===== */
body {
    margin: 0;
    padding: 0;
    font-family: "Segoe UI", sans-serif;
    background: #d0daec;
    color: #1a1a1a;
}

img {
    max-width: 100%;
    height: auto;
    display: inline-block;
    object-fit: contain;
}

:root {
    --blue-soft: #d5e7ee;
    --blue-dark: #3c5e77;
    --blue-accent: #4a8dbf;
    --panel-bg: #ffffff;
    --border-light: #d1d9e0;
    --shadow-soft: 0 4px 12px rgba(0,0,0,0.08);
}

.container {
    width: 100%;
    max-width: 1250px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ==========================================
   HEADER — уменьшен в 2 раза, по центру
   ========================================== */

.header {
    width: 100%;
    background: #5a86ab;
    box-shadow: var(--shadow-soft);
    position: sticky;
    top: 0;
    z-index: 20;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 80px;
    padding: 0 20px;
}

/* логотип уменьшен */
.logo img {
    height: 72px;
}

/* меню */
.nav {
    display: flex;
    gap: 22px;
}

.nav a {
    font-size: 15px;
    font-weight: 600;
    color: #fff;
    padding: 3px 0;
    transition: 0.2s;
}

.nav a:hover {
    color: var(--blue-accent);
}






/* ===== КОНТЕЙНЕР СПРАВА ===== */
.header-right {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Контейнер меню — чтобы dropdown крепился под ником */
.user-menu {
    position: relative; /* <<< ВАЖНО */
    display: flex;
    align-items: center;
}

/* ===== НИК КАК КНОПКА ===== */
#userMenuBtn {
    font-weight: 700;
    color: #fff253;
    cursor: pointer;
    padding: 6px 12px;
    border-radius: 6px;
    transition: 0.2s;
    user-select: none;
    white-space: nowrap;
    background-color: #303a43;
}

#userMenuBtn:hover {
    background: rgba(255,255,255,0.15);
}

/* ===== ВЫПАДАЮЩЕЕ МЕНЮ ===== */
.user-menu-dropdown {
    position: absolute;
    top: 100%;        /* <<< ВСЕГДА ПОД КНОПКОЙ */
    left: 0;          /* <<< РОВНО ПОД НИКОМ */

    margin-top: 6px;  /* маленький отступ вниз */

    background: #ffffff;
    border: 1px solid #d0d7e2;
    border-radius: 10px;
    width: 180px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.12);

    overflow: hidden;
    max-height: 0;
    opacity: 0;
    transition: max-height 0.25s ease, opacity 0.25s ease;
    pointer-events: none;
    z-index: 999;
}

/* показываем меню */
.user-menu-dropdown.show {
    max-height: 300px;
    opacity: 1;
    pointer-events: auto;
}

/* ссылки */
.user-menu-dropdown a {
    display: block;
    padding: 12px 15px;
    color: #333;
    text-decoration: none;
    font-size: 15px;
    border-bottom: 1px solid #eef0f5;
    transition: 0.2s;
}

.user-menu-dropdown a:last-child {
    border-bottom: none;
}

.user-menu-dropdown a:hover {
    background: #f2f6ff;
}








/* ---------------------------- */
/*      LOGIN / REGISTER        */
/* ---------------------------- */

/* --------------- */
/* HEADER BUTTONS  */
/* --------------- */

.login-btn,
.register-btn {
    padding: 7px 20px;
    font-size: 15px;
    font-weight: 600;
    border-radius: 4px;
    text-decoration: none;
    display: inline-block;
    transition: 0.25s ease;
    white-space: nowrap;
    margin-left: 12px;
}

/* LOGIN (в хедере) — прозрачная */
.login-btn {
    color: #ffffff;
    border: 2px solid rgba(255,255,255,0.6);
    background: rgba(255,255,255,0.08);
    backdrop-filter: blur(4px);
}

.login-btn:hover {
    background: rgba(255,255,255,0.22);
    border-color: #ffffff;
}

/* REGISTER (в хедере) */
.register-btn {
    background: #6b8cad;
    color: #ffffff;
    border: 2px solid #84f5ff;
}

.register-btn:hover {
    background: #466c92;
    border-color: #a3ffc5;
    box-shadow: 0 0 12px rgba(46, 170, 93, 0.4);
}

/* -------------------------- */
/* LOGIN BUTTON (внутри формы) */
/* -------------------------- */

.auth-login-btn {
    width: 100%;
    background: #4c7fff;
    color: white;
    padding: 12px 16px;
    border-radius: 6px;
    border: none;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 15px;
    transition: 0.25s ease;
}

.auth-login-btn:hover {
    background: #3a6be0;
}

/* -------------------------- */
/* USER LINK                  */
/* -------------------------- */

.user-link {
    color: #2769ff;
    font-weight: 600;
    text-decoration: none;
}

.user-link:hover {
    text-decoration: underline;
}




.ccc {
	text-align: center;
	margin: 0 auto;
	margin-top: -94px;
}




/* ==========================================
   WELCOME BLOCK
   ========================================== */
.welcome {
    width: 100%;
    background: var(--blue-soft);
    padding: 40px 0;
    text-align: center;
    box-shadow: var(--shadow-soft);
}

.welcome h1 {
    margin: 0;
    font-size: 32px;
    font-weight: 800;
    color: #234;
}

.welcome p {
    margin-top: 12px;
    font-size: 17px;
    opacity: 0.85;
}

/* ==========================================
   BREADCRUMBS
   ========================================== */
.breadcrumbs {
    margin: 20px auto;
    font-size: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: #444;
}

.breadcrumbs a {
    text-decoration: none;
    color: var(--blue-accent);
    font-weight: 600;
}

/* ==========================================
   FORUM LAYOUT
   ========================================== */

.forum {
    display: flex;
    gap: 25px;
}

.forum-left {
    flex: 1;
}

.forum-right {
    width: 320px;
    flex-shrink: 0;
}

/* категории */
.forum-category {
    background: var(--panel-bg);
    border-radius: 4px;
    padding: 15px 20px;
    margin-bottom: 25px;
    box-shadow: var(--shadow-soft);
}

.cat-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 15px;
    padding-bottom: 6px;
    border-bottom: 2px solid var(--border-light);
}

/* элементы форума */
.forum-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 6px;
    text-decoration: none;
    color: #383838;
    transition: 0.15s;
    box-shadow: 2px 2px 4px -2px rgb(0 0 0);
	background-color: #a7c9ff;
	margin-top: 16px;
}

.forum-item:hover {
    background: #98bc9e;
}

.icon img {
    width: 30px;
    opacity: 0.8;
}

.item-info {
    flex: 1;
    padding: 0 15px;
}

.item-title {
    font-size: 17px;
    font-weight: 600;
}

.item-sub {
    opacity: 0.6;
    font-size: 14px;
    margin-top: 2px;
}

.item-stats {
    text-align: right;
    font-size: 13px;
    opacity: 0.7;
    min-width: 80px;
}

/* ==========================================
   RIGHT SIDEBAR
   ========================================== */

.widget {
    background: var(--panel-bg);
    border-radius: 12px;
    padding: 18px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-soft);
}

.widget-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 12px;
}

.msg {
    padding: 10px 0;
    border-bottom: 1px solid var(--border-light);
}

.msg:last-child {
    border-bottom: none;
}

.msg-user {
    font-weight: 600;
}

.msg-text {
    font-size: 14px;
    opacity: 0.75;
}

/* ==========================================
   FOOTER
   ========================================== */

.footer {
    padding: 25px 0;
    margin-top: 40px;
    background: #e9f2f7;
    text-align: center;
    font-size: 14px;
}

.footer-links a {
    margin: 0 10px;
    color: #444;
}

/* ==========================================
   RESPONSIVE
   ========================================== */

@media (max-width: 960px) {
    .forum {
        flex-direction: column;
    }

    .forum-right {
        width: 100%;
    }

    .nav {
        display: none;
    }

    .header-right {
        display: none;
    }

    .logo img {
        height: 40px;
    }
}

/* ==========================================
   AUTH FORMS
   ========================================== */

.auth-box {
    width: 380px;
    margin: 120px auto;
    background: #fff;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.12);
}

.auth-box h2 {
    margin-bottom: 25px;
    text-align: center;
}

.auth-box form label {
    display: block;
    margin: 8px 0 4px;
    font-weight: 600;
}

.auth-box input {
    width: 100%;
    padding: 11px;
    border-radius: 8px;
    border: 1px solid #bbb;
    margin-bottom: 15px;
}

.auth-error {
    background: #ffdedf;
    color: #d60000;
    padding: 10px;
    border-radius: 6px;
    margin-bottom: 20px;
    text-align: center;
}

/* ==========================================
   PROFILE / POST AVATARS
   ========================================== */

.profile-header img {
    width: 120px !important;
    height: 120px !important;
    object-fit: cover !important;
}

.post-user img {
    width: 55px !important;
    height: 55px !important;
    border-radius: 6px;
    object-fit: cover !important;
}

.sp {}






/* -------------------------------------- */
/*               FOOTER                   */
/* -------------------------------------- */

html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1 0 auto; /* Контент растягивается */
}

.site-footer {
    background: #1a1f24;
    color: #c9d1d9;
    padding: 45px 0 25px;
    margin-top: 60px;
    border-top: 1px solid rgba(255,255,255,0.06);
    font-family: system-ui, sans-serif;
    flex-shrink: 0; /* Футер остаётся внизу */
}

.footer-container {
    width: 90%;
    max-width: 1200px;
    margin: auto;

    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 40px;
    flex-wrap: wrap;
}

.footer-left {
    flex: 1 1 270px;
}

.footer-logo img {
    width: 70px;
    opacity: 0.9;
    margin-bottom: 15px;
}

.footer-desc {
    opacity: 0.7;
    font-size: 14px;
    line-height: 1.5;
}

/* Links */
.footer-links {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.footer-links a {
    color: #e2e8f0;
    text-decoration: none;
    font-size: 15px;
    transition: 0.2s;
}

.footer-links a:hover {
    color: #5cc97b;
}

/* Social icons */
.footer-social {
    display: flex;
    gap: 12px;
}

.footer-social a svg {
    width: 26px;
    height: 26px;
    fill: #c9d1d9;
    opacity: 0.7;
    transition: 0.25s ease;
}

.footer-social a:hover svg {
    opacity: 1;
    fill: #5cc97b;
}

/* Bottom strip */
.footer-bottom {
    margin-top: 35px;
    padding-top: 15px;
    text-align: center;
    font-size: 14px;
    opacity: 0.6;
    border-top: 1px solid rgba(255,255,255,0.06);
}

/* Responsive */
@media (max-width: 760px) {
    .footer-container {
        flex-direction: column;
    }
}




.global-chat {
    border-left: 4px solid #4CAF50 !important;
    background: #f8fff8;
}

.global-chat:hover {
    background: #efffef;
}



















/* ===========================
   LATEST POSTS — FIXED & CLEAN
=========================== */

.widget.latest-posts {
    padding: 15px 18px 18px 18px;
}

/* каждый пост */
.latest-post-item {
    display: block;              /* ← фиксируем ширину */
    width: 100%;                 /* ← растягиваем на весь контейнер */
    box-sizing: border-box;      /* ← учитываем padding */

    padding: 12px 0;
    border-bottom: 1px solid #e8edf3;
    text-decoration: none;
}

.latest-post-item:last-child {
    border-bottom: none;
}

/* заголовок */
.latest-post-item-title {
    font-weight: 600;
    font-size: 15px;
    color: #3b7cc4;
    margin-bottom: 3px;

    white-space: normal;
}

/* сниппет */
.latest-post-snippet {
    font-size: 13px;
    color: #555;
    opacity: .8;
    line-height: 1.35;

    display: -webkit-box;
    -webkit-line-clamp: 2; /* максимум 2 строки */
    -webkit-box-orient: vertical;
    overflow: hidden;

    white-space: normal !important; /* ← важно */
}
