:root {
    --bg: #050505;
    --bg-alt: rgba(15, 15, 15, 0.95);
    --card: rgba(20, 20, 20, 0.55);
    --border: rgba(179, 0, 0, 0.65);
    --accent: #b30000;
    --accent-2: #ff4d4d;
    --text: #d4d4d4;
    --muted: #888;
    --shadow: rgba(179, 0, 0, 0.35);
    --radius: 14px;
    --font: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --mono: "Courier New", monospace;
    --transition: 0.25s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: radial-gradient(circle at top, rgba(179, 0, 0, 0.25), transparent 60%),
        linear-gradient(135deg, #08080b 0%, #050505 60%, #05060b 100%);
    color: var(--text);
    font-family: var(--font);
    line-height: 1.6;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.04);
}

::-webkit-scrollbar-thumb {
    background: rgba(179, 0, 0, 0.5);
    border-radius: 999px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 0, 0, 0.6);
}

::selection {
    background: rgba(255, 77, 77, 0.4);
    color: #fff;
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: color var(--transition), text-shadow var(--transition);
}

a:hover {
    color: var(--accent-2);
    text-shadow: 0 0 10px rgba(255, 0, 0, 0.75);
}

a:focus-visible {
    outline: 2px dashed rgba(179, 0, 0, 0.85);
    outline-offset: 4px;
}

.navbar {
    background: rgba(10, 10, 10, 0.75);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(179, 0, 0, 0.5);
    padding: 12px 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.75);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    font-size: 24px;
    font-weight: 800;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 3px;
    animation: flicker 2s infinite;
    text-shadow: 0 0 10px rgba(179, 0, 0, 0.7);
}

.logo-img {
    height: 5em; 
    width: auto;

}

.logo-text {

}

@keyframes flicker {
    0%, 19%, 21%, 23%, 25%, 54%, 56%, 100% {
        text-shadow: 0 0 5px #b30000, 0 0 10px #b30000;
    }
    20%, 24%, 55% {
        text-shadow: none;
    }
}

.mobile-menu-btn {
    display: none;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(179, 0, 0, 0.7);
    color: var(--accent);
    font-size: 22px;
    padding: 8px 12px;
    border-radius: 10px;
    cursor: pointer;
    transition: transform var(--transition), background var(--transition), border-color var(--transition);
}

.mobile-menu-btn:hover {
    transform: translateY(-1px);
    background: rgba(179, 0, 0, 0.2);
}

.nav-menu {
    list-style: none;
    display: flex;
    gap: 18px;
    align-items: center;
}

.nav-menu li a {
    padding: 8px 14px;
    border: 1px solid rgba(179, 0, 0, 0.7);
    border-radius: 12px;
    transition: transform var(--transition), background var(--transition), color var(--transition), box-shadow var(--transition);
    white-space: nowrap;
}

.nav-menu li a:hover {
    background: rgba(179, 0, 0, 0.9);
    color: #0a0a0a;
    box-shadow: 0 0 18px rgba(179, 0, 0, 0.55);
    transform: translateY(-1px);
}

.container {
    max-width: 1200px;
    margin: 30px auto;
    padding: 0 20px;
}

.page-title {
    font-size: 2rem;
    margin-bottom: 18px;
    color: var(--accent);
    letter-spacing: 1px;
}

.posts {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.post-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 22px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
    transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
    animation: fadeInUp 0.9s ease;
    backdrop-filter: blur(12px);
}

.post-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.65);
    border-color: rgba(255, 0, 0, 0.8);
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.post-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 18px;
    border-bottom: 1px solid rgba(179, 0, 0, 0.35);
    padding-bottom: 12px;
    flex-wrap: wrap;
}

.avatar {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    border: 2px solid rgba(179, 0, 0, 0.8);
    object-fit: cover;
    background-color: rgba(30, 30, 30, 0.8);
}

.username {
    font-weight: 800;
    color: var(--accent);
    font-size: 1.2em;
    word-break: break-word;
}

.post-date {
    margin-left: auto;
    font-size: 0.9em;
    color: var(--muted);
}

.post-actions {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.9em;
    background: rgba(25, 25, 25, 0.85);
    border: 1px solid rgba(179, 0, 0, 0.7);
    color: #e0e0e0;
    border-radius: 999px;
    cursor: pointer;
    transition: transform var(--transition), box-shadow var(--transition), background var(--transition);
}

.btn-sm:hover {
    background: rgba(179, 0, 0, 0.75);
    color: #0a0a0a;
    box-shadow: 0 0 10px rgba(255, 0, 0, 0.6);
    transform: translateY(-1px);
}

.btn-danger {
    background: rgba(179, 0, 0, 0.55);
    color: #fff;
    border: 1px solid rgba(255, 0, 0, 0.7);
}

.btn-danger:hover {
    background: rgba(255, 0, 0, 0.75);
}

.btn-warning {
    background: rgba(255, 170, 0, 0.8);
    color: #0a0a0a;
    border: 1px solid rgba(255, 195, 0, 0.7);
}

.btn-warning:hover {
    background: rgba(255, 195, 0, 0.9);
}

.btn-success {
    background: rgba(0, 179, 0, 0.75);
    color: #0a0a0a;
    border: 1px solid rgba(0, 200, 0, 0.7);
}

.btn-success:hover {
    background: rgba(0, 200, 0, 0.85);
}

.post-content {
    font-size: 1.1em;
    white-space: pre-wrap;
    word-wrap: break-word;
    margin-bottom: 15px;
}

.post-sticker {
    margin: 10px 0;
    text-align: center;
}
.post-sticker img {
    max-width: 100px;
    max-height: 100px;
    border-radius: 5px;
}

.post-attachments {
    margin: 15px 0;
    padding: 14px;
    background: rgba(20, 20, 20, 0.6);
    border-radius: 14px;
    border-left: 3px solid rgba(179, 0, 0, 0.8);
    backdrop-filter: blur(10px);
}

.attachment-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
    margin-top: 10px;
}

.attachment-image {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: 12px;
    border: 1px solid rgba(179, 0, 0, 0.7);
    transition: transform var(--transition), box-shadow var(--transition);
}

.attachment-image:hover {
    transform: scale(1.05);
    box-shadow: 0 0 18px rgba(255, 0, 0, 0.55);
}

.attachment-file {
    display: block;
    padding: 12px;
    background: rgba(25, 25, 25, 0.7);
    border: 1px solid rgba(179, 0, 0, 0.7);
    border-radius: 12px;
    color: var(--accent);
    text-align: center;
    word-break: break-all;
    text-decoration: none;
}

.post-comments {
    margin-top: 20px;
    padding: 18px;
    background: rgba(10, 10, 10, 0.65);
    border-top: 1px solid rgba(179, 0, 0, 0.4);
    border-radius: 0 0 var(--radius) var(--radius);
}

.comment {
    margin-bottom: 15px;
    padding: 12px;
    background: rgba(20, 20, 20, 0.5);
    border-left: 3px solid rgba(179, 0, 0, 0.8);
    border-radius: 12px;
}

.comment-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.comment-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 1px solid rgba(179, 0, 0, 0.85);
    object-fit: cover;
}

.comment-author {
    font-weight: bold;
    color: var(--accent);
    text-decoration: none;
}

.comment-date {
    font-size: 0.8em;
    color: #666;
    margin-left: auto;
}

.comment-content {
    font-size: 0.95em;
    line-height: 1.4;
    word-break: break-word;
}

.comment-form {
    margin-top: 20px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    background: rgba(20, 20, 20, 0.55);
    padding: 18px;
    border-radius: 16px;
    border: 1px solid rgba(179, 0, 0, 0.55);
    backdrop-filter: blur(10px);
}

.comment-form textarea {
    flex: 1;
    min-width: 200px;
    padding: 14px;
    background: rgba(25, 25, 25, 0.85);
    border: 2px solid rgba(179, 0, 0, 0.7);
    color: #e0e0e0;
    border-radius: 14px;
    resize: vertical;
    min-height: 90px;
    font-family: inherit;
    transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
}

.comment-form textarea:focus {
    outline: none;
    border-color: var(--accent-2);
    box-shadow: 0 0 12px rgba(255, 0, 0, 0.4);
    background: rgba(35, 35, 35, 0.9);
}

.comment-form button {
    align-self: flex-end;
    margin-top: 5px;
}

.comment-login-prompt {
    font-size: 0.95em;
    color: var(--muted);
    margin-top: 15px;
    padding: 14px;
    background: rgba(20, 20, 20, 0.6);
    border-radius: 14px;
    border-left: 3px solid rgba(179, 0, 0, 0.7);
}

.comment-login-prompt a {
    color: var(--accent);
    font-weight: 700;
}

.search-form {
    margin-bottom: 24px;
    display: flex;
    gap: 12px;
    align-items: center;
    background: rgba(20, 20, 20, 0.65);
    padding: 16px;
    border-radius: 18px;
    border: 1px solid rgba(179, 0, 0, 0.55);
    backdrop-filter: blur(10px);
}

.search-form input[type="text"] {
    flex: 1;
    padding: 12px 14px;
    background: rgba(25, 25, 25, 0.85);
    border: 2px solid rgba(179, 0, 0, 0.65);
    color: #e0e0e0;
    border-radius: 12px;
    font-family: inherit;
    transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
}

.search-form input[type="text"]:focus {
    outline: none;
    border-color: var(--accent-2);
    box-shadow: 0 0 12px rgba(255, 0, 0, 0.4);
    background: rgba(35, 35, 35, 0.9);
}

.search-form .btn {
    margin: 0;
    padding: 10px 20px;
}

.no-results {
    text-align: center;
    padding: 42px 32px;
    background: rgba(20, 20, 20, 0.6);
    border: 1px solid rgba(179, 0, 0, 0.6);
    border-radius: 18px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45);
}

.no-results p {
    font-size: 1.2em;
    margin-bottom: 20px;
    color: #888;
}

.no-results a {
    color: var(--accent);
    font-weight: bold;
    text-decoration: underline;
}

.search-info {
    margin-bottom: 22px;
    padding: 18px;
    background: rgba(20, 20, 20, 0.55);
    border: 1px solid rgba(179, 0, 0, 0.55);
    border-radius: 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.search-info p {
    margin: 0;
    color: var(--accent);
    font-weight: 700;
}

.post-edit-container {
    max-width: 800px;
    margin: 0 auto;
}

.post-form {
    background: rgba(15, 15, 15, 0.6);
    border: 1px solid rgba(179, 0, 0, 0.6);
    border-radius: 18px;
    padding: 24px;
    backdrop-filter: blur(10px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5);
}

.attachment-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.attachment-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px;
    background: rgba(20, 20, 20, 0.65);
    border-radius: 14px;
    border: 1px solid rgba(179, 0, 0, 0.6);
    transition: transform var(--transition), box-shadow var(--transition);
}

.attachment-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45);
}

.attachment-thumb {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 12px;
    border: 1px solid rgba(179, 0, 0, 0.7);
}

.attachment-icon {
    font-size: 24px;
}

.attachment-name {
    flex: 1;
    font-size: 0.9em;
    color: #e0e0e0;
}

.attachment-item .btn {
    margin: 0;
    padding: 5px 10px;
    font-size: 0.8em;
}

.profile-header {
    display: flex;
    gap: 30px;
    margin-bottom: 30px;
    background: rgba(15, 15, 15, 0.6);
    padding: 24px;
    border: 1px solid rgba(179, 0, 0, 0.6);
    border-radius: 18px;
    flex-wrap: wrap;
    backdrop-filter: blur(10px);
}

.profile-avatar-large img {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    border: 3px solid rgba(179, 0, 0, 0.8);
    object-fit: cover;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.55);
}

.profile-info {
    flex: 1;
    min-width: 250px;
}

.profile-stats {
    display: flex;
    gap: 20px;
    margin: 15px 0;
    flex-wrap: wrap;
}

.profile-stats span {
    background: rgba(25, 25, 25, 0.6);
    padding: 5px 15px;
    border-radius: 20px;
    border: 1px solid rgba(179, 0, 0, 0.7);
}

.admin-badge {
    display: inline-block;
    background: rgba(179, 0, 0, 0.9);
    color: #000;
    padding: 4px 12px;
    border-radius: 999px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.post-comments-link {
    margin-top: 10px;
    text-align: right;
}

.post-comments-link a {
    color: var(--accent);
    text-decoration: underline;
    font-size: 0.9em;
}

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

.form-control {
    width: 100%;
    padding: 12px;
    background: rgba(25, 25, 25, 0.85);
    border: 1px solid rgba(179, 0, 0, 0.7);
    color: #e0e0e0;
    border-radius: 12px;
    font-family: inherit;
    transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--accent-2);
    box-shadow: 0 0 12px rgba(255, 0, 0, 0.35);
    background-color: rgba(30, 30, 30, 0.95);
}

select.form-control {
    background: rgba(25, 25, 25, 0.85);
    color: #e0e0e0;
}

.error {
    color: #ff4d4d;
    font-size: 0.9em;
}

small {
    color: #888;
}

.btn {
    background: linear-gradient(135deg, rgba(179, 0, 0, 0.95), rgba(255, 77, 77, 0.9));
    color: #0a0a0a;
    border: 1px solid rgba(255, 255, 255, 0.12);
    padding: 10px 22px;
    border-radius: 999px;
    cursor: pointer;
    font-weight: 700;
    transition: transform var(--transition), box-shadow var(--transition), background var(--transition);
    box-shadow: 0 12px 30px rgba(179, 0, 0, 0.25);
    backdrop-filter: blur(6px);
}

.btn:hover {
    transform: translateY(-1px);
    background: linear-gradient(135deg, rgba(255, 77, 77, 0.9), rgba(179, 0, 0, 0.9));
    box-shadow: 0 14px 35px rgba(255, 0, 0, 0.35);
}

.btn:focus-visible {
    outline: 2px solid rgba(255, 77, 77, 0.75);
    outline-offset: 3px;
}

.table {
    width: 100%;
    border-collapse: collapse;
    background: rgba(20, 20, 20, 0.6);
    border: 1px solid rgba(179, 0, 0, 0.6);
    border-radius: 12px;
    overflow: hidden;
}

.table th, .table td {
    padding: 12px 14px;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    word-break: break-word;
}

.table th {
    background: rgba(15, 15, 15, 0.85);
    color: var(--accent);
}

.table tr:hover {
    background: rgba(255, 255, 255, 0.06);
}

.alert {
    padding: 12px 14px;
    margin-bottom: 16px;
    border-radius: 12px;
    border-left: 5px solid;
    background: rgba(20, 20, 20, 0.6);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
}

.alert-success {
    border-color: rgba(0, 179, 0, 0.8);
    color: #b3ffb3;
    background: rgba(0, 128, 0, 0.2);
}

.alert-danger {
    border-color: var(--accent);
    color: #ffb3b3;
    background: rgba(179, 0, 0, 0.25);
}

.site-footer {
    padding: 20px 0;
    background: rgba(10, 10, 10, 0.75);
    border-top: 1px solid rgba(179, 0, 0, 0.5);
    margin-top: 40px;
    text-align: center;
    color: #aaa;
    font-size: 0.9em;
}

.site-footer p {
    margin: 4px 0;
}

@media (max-width: 768px) {
    .mobile-menu-btn {
        display: block;
    }

    .nav-menu {
        display: none;
        position: absolute;
        top: 60px;
        left: 0;
        right: 0;
        max-height: calc(100vh - 70px);
        overflow-y: auto;
        background: rgba(10, 10, 10, 0.85);
        backdrop-filter: blur(10px);
        flex-direction: column;
        padding: 20px;
        border-bottom: 1px solid rgba(179, 0, 0, 0.6);
        box-shadow: 0 10px 25px rgba(0,0,0,0.6);
        z-index: 99;
    }

    .nav-menu.active {
        display: flex;
    }

    .nav-menu li {
        width: 100%;
    }

    .nav-menu li a {
        display: block;
        text-align: center;
        border: 1px solid rgba(179, 0, 0, 0.7);
        border-radius: 12px;
    }

    .post-header {
        gap: 10px;
    }

    .post-date {
        margin-left: 0;
        width: 100%;
    }

    .post-actions {
        width: 100%;
        justify-content: flex-end;
    }

    .profile-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .profile-stats {
        justify-content: center;
    }

    .attachment-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }

    .comment-form {
        flex-direction: column;
    }

    .comment-form textarea {
        width: 100%;
    }

    .container {
        padding: 0 16px;
    }

    .site-footer {
        padding: 18px 10px;
    }
}

@media (max-width: 480px) {
    .logo {
        font-size: 20px;
    }

    .post-card {
        padding: 15px;
    }

    .username {
        font-size: 1em;
    }

    .btn-sm {
        padding: 2px 5px;
        font-size: 0.8em;
    }
}

.post-footer {
    margin-top: 15px;
    display: flex;
    justify-content: flex-end;
}

.like-btn {
    background: rgba(0, 0, 0, 0.35);
    border: 2px solid rgba(179, 0, 0, 0.8);
    color: #e0e0e0;
    padding: 8px 16px;
    border-radius: 25px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 0.95rem;
    font-weight: 800;
    transition: transform var(--transition), box-shadow var(--transition), background var(--transition);
    outline: none;
    box-shadow: 0 0 0 rgba(179, 0, 0, 0.3);
    position: relative;
    overflow: hidden;
    text-transform: uppercase;
    letter-spacing: 1px;
}
.post-detail-container {
    max-width: 900px;
    margin: 0 auto 40px;
    padding: 0 12px;
}

.post-card.detail-view {
    margin-bottom: 30px;
}

.back-navigation {
    margin-bottom: 20px;
}

.back-link {
    color: var(--accent);
    text-decoration: none;
    font-size: 1.1em;
}

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

.post-content.detail-content {
    font-size: 1.2em;
    line-height: 1.8;
}

.post-stats {
    display: flex;
    gap: 20px;
    padding: 15px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    margin: 15px 0;
    flex-wrap: wrap;
}

.stat-item {
    display: flex;
    gap: 6px;
    align-items: center;
}

.stat-label {
    color: var(--muted);
    font-size: 0.9em;
}

.stat-value {
    color: var(--accent);
    font-weight: bold;
    font-size: 1.1em;
}

.like-section {
    margin: 20px 0;
}

.show-all-comments-btn {
    background: rgba(20, 20, 20, 0.6);
    color: var(--accent);
    border: 1px solid rgba(179, 0, 0, 0.7);
    padding: 10px 20px;
    border-radius: 10px;
    cursor: pointer;
    width: 100%;
    font-size: 1em;
    transition: transform var(--transition), background var(--transition), box-shadow var(--transition);
    margin: 10px 0;
    text-align: center;
}

.show-all-comments-btn:hover {
    background: rgba(179, 0, 0, 0.7);
    color: #0a0a0a;
    transform: translateY(-1px);
}

.login-to-comment {
    text-align: center;
    padding: 20px;
    background: rgba(20, 20, 20, 0.6);
    border-radius: 12px;
    border-left: 3px solid rgba(179, 0, 0, 0.7);
}

.login-to-comment a {
    color: var(--accent);
    text-decoration: underline;
}

.like-btn:hover {
    background: rgba(179, 0, 0, 0.85);
    color: #0a0a0a;
    border-color: var(--accent-2);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(179, 0, 0, 0.5);
}

.like-btn.liked {
    background: rgba(179, 0, 0, 0.95);
    color: #0a0a0a;
    border-color: var(--accent-2);
    animation: heartBeat 0.6s ease-in-out;
    box-shadow: 0 0 20px rgba(255, 0, 0, 0.6);
}

.like-btn.liked:hover {
    background: rgba(255, 77, 77, 0.95);
    border-color: rgba(179, 0, 0, 0.9);
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 0 25px rgba(255, 0, 0, 0.8);
}

.like-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.like-btn:hover::before {
    left: 100%;
}


.like-icon {
    font-size: 1.3rem;
    line-height: 1;
    transition: transform 0.3s ease;
    display: inline-block;
    filter: drop-shadow(0 0 2px rgba(0,0,0,0.5));
}

.like-btn:hover .like-icon {
    transform: scale(1.2) rotate(5deg);
}

.like-btn.liked .like-icon {
    animation: heartBeat 0.6s ease-in-out;
    filter: drop-shadow(0 0 5px rgba(255,0,0,0.8));
}

.like-count {
    font-weight: bold;
    font-size: 1.1rem;
    transition: transform 0.2s ease;
    min-width: 20px;
    text-align: center;
}

.like-btn.liked .like-count {
    transform: scale(1.1);
    color: #fff;
    text-shadow: 0 0 5px rgba(255, 255, 255, 0.8);
}

@keyframes heartBeat {
    0% { transform: scale(1); }
    25% { transform: scale(1.2); }
    50% { transform: scale(0.9); }
    75% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.like-icon {
    font-size: 1.2rem;
    line-height: 1;
}

.like-count {
    font-weight: bold;
}
.messages-container {
    margin-top: 20px;
}

.messages-actions {
    margin-bottom: 20px;
    text-align: right;
}

.messages-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.messages-section {
    background: rgba(15, 15, 15, 0.65);
    border: 1px solid rgba(179, 0, 0, 0.6);
    border-radius: 18px;
    padding: 22px;
    backdrop-filter: blur(10px);
}

.messages-section h2 {
    margin-top: 0;
    margin-bottom: 15px;
    color: var(--accent);
    border-bottom: 1px solid rgba(179, 0, 0, 0.5);
    padding-bottom: 10px;
}

.message-card {
    background: rgba(15, 15, 15, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    padding: 18px;
    margin-bottom: 15px;
    transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
}

.message-card:hover {
    border-color: rgba(179, 0, 0, 0.6);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
    transform: translateY(-2px);
}

.message-card.unread {
    border-left: 4px solid rgba(179, 0, 0, 0.8);
    background: rgba(20, 20, 20, 0.65);
}

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

.message-sender, .message-recipient {
    font-weight: 700;
    color: var(--accent);
}

.message-time {
    font-size: 0.9em;
    color: #666;
    margin-left: auto;
}

.message-content {
    font-size: 1.1em;
    line-height: 1.6;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.message-form-container {
    max-width: 600px;
    margin: 0 auto;
}

.message-form {
    background: rgba(15, 15, 15, 0.65);
    border: 1px solid rgba(179, 0, 0, 0.6);
    border-radius: 18px;
    padding: 22px;
    backdrop-filter: blur(10px);
}

.form-label {
    display: block;
    margin-bottom: 6px;
    font-weight: 700;
    color: var(--accent);
}

.form-hint {
    color: #888;
    font-size: 0.9em;
}

.btn-secondary {
    background: rgba(25, 25, 25, 0.75);
    border: 1px solid rgba(179, 0, 0, 0.6);
    color: #e0e0e0;
    margin-left: 10px;
    transition: background var(--transition), border-color var(--transition), transform var(--transition);
}

.btn-secondary:hover {
    background: rgba(179, 0, 0, 0.6);
    border-color: rgba(255, 77, 77, 0.8);
    transform: translateY(-1px);
    color: #0a0a0a;
}

@media (max-width: 768px) {
    .messages-grid {
        grid-template-columns: 1fr;
    }
    
    .message-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .message-time {
        margin-left: 0;
        margin-top: 5px;
    }
}

.post-title-link {
    text-decoration: none;
    color: inherit;
}

.post-title-link:hover {
    text-decoration: underline;
}

.comment-actions {
    margin-top: 10px;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.btn-danger {
    background: rgba(120, 0, 0, 0.7);
    color: #e0e0e0;
    border: 1px solid rgba(179, 0, 0, 0.7);
    transition: background var(--transition), border-color var(--transition), transform var(--transition);
}

.btn-danger:hover {
    background: rgba(179, 0, 0, 0.85);
    border-color: var(--accent);
    transform: translateY(-1px);
}

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    animation: fadeInUp 0.35s ease;
}

.modal-content {
    background: rgba(15, 15, 15, 0.85);
    margin: 12% auto;
    padding: 24px;
    border: 1px solid rgba(179, 0, 0, 0.7);
    width: 90%;
    max-width: 520px;
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.7);
}

.close {
    color: var(--accent);
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: color var(--transition);
}

.close:hover {
    color: var(--accent-2);
}

.modal-content ul {
    margin: 15px 0;
    padding-left: 20px;
    color: #e0e0e0;
}

.modal-content ul li {
    margin: 5px 0;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}
:focus-visible {
    outline: 2px solid rgba(255, 77, 77, 0.85);
    outline-offset: 4px;
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

.icon-table {
    width: 20px;
    height: 20px;
    display: inline-block;
    vertical-align: middle;
}
.chat-app-container {
    display: flex;
    height: calc(100vh - 60px);
    overflow: hidden;
    margin: 0;
    padding: 0;
}

.chat-sidebar {
    width: 320px;
    border-right: 1px solid #ddd;
    display: flex;
    flex-direction: column;
    background: #fff;
}

.sidebar-header {
    padding: 15px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-list {
    overflow-y: auto;
    flex: 1;
}

.chat-item {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    border-bottom: 1px solid #f0f0f0;
    text-decoration: none;
    color: #333;
    transition: background 0.2s;
}

.chat-item:hover {
    background: #f5f5f5;
    text-decoration: none;
    color: #333;
}

.chat-item.active {
    background: #e9ecef;
}

.chat-avatar img {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
}

.chat-info {
    flex: 1;
    margin-left: 12px;
    min-width: 0;
}

.chat-name {
    font-weight: 600;
    margin-bottom: 3px;
}

.chat-last-message {
    font-size: 0.85rem;
    color: #666;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.unread-badge {
    margin-left: 8px;
}

.invite-list {
    padding: 10px;
}

.invite-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px;
    border-bottom: 1px solid #eee;
}

.invite-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.invite-avatar {
    border-radius: 50%;
}

.chat-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #fafafa;
}

.chat-header {
    padding: 15px 20px;
    border-bottom: 1px solid #ddd;
    background: white;
    display: flex;
    align-items: center;
}

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

.header-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin-right: 12px;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
}

.message {
    max-width: 70%;
    margin-bottom: 15px;
    display: flex;
    flex-direction: column;
}

.message-in {
    align-self: flex-start;
}

.message-out {
    align-self: flex-end;
}

.message-content {
    padding: 10px 15px;
    border-radius: 18px;
    background: white;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
    word-wrap: break-word;
}

.message-out .message-content {
    background: #dcf8c6;
}

.message-meta {
    display: flex;
    align-items: center;
    margin-top: 4px;
    font-size: 0.75rem;
    color: #888;
}

.message-out .message-meta {
    justify-content: flex-end;
}

.message-time {
    margin-right: 8px;
}

.delete-message-form {
    display: inline;
}

.btn-icon {
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    padding: 0;
    font-size: 0.9rem;
}

.btn-icon:hover {
    color: #d9534f;
}

.chat-input {
    padding: 15px;
    background: white;
    border-top: 1px solid #ddd;
}

.chat-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center;
    color: #aaa;
}

.placeholder-content i {
    margin-bottom: 15px;
}
/* ===== ЧАТЫ В СТИЛЕ TELEGRAM (КРОВАВО-КИБЕРПАНК) ===== */

.chat-app-container {
    display: flex;
    height: calc(100vh - 70px);
    min-height: 600px;
    background: rgba(5, 5, 5, 0.4);
    backdrop-filter: blur(8px);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(179, 0, 0, 0.2) inset;
    margin: 20px 0;
}

/* Левая панель */
.chat-sidebar {
    width: 340px;
    background: rgba(10, 10, 10, 0.7);
    backdrop-filter: blur(12px);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.5);
}

.sidebar-header {
    padding: 18px 16px;
    border-bottom: 1px solid rgba(179, 0, 0, 0.4);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(to bottom, rgba(20, 0, 0, 0.3), transparent);
}

.sidebar-header h3 {
    color: var(--accent);
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: 1px;
    text-shadow: 0 0 8px rgba(179, 0, 0, 0.6);
}

/* Вкладки */
.nav-tabs {
    border-bottom: 1px solid rgba(179, 0, 0, 0.5);
    padding: 0 8px;
    background: rgba(0, 0, 0, 0.2);
    gap: 10px;
}

.nav-tabs .nav-link {
    color: var(--muted);
    border: none;
    padding: 12px 16px;
    font-weight: 600;
    background: transparent;
    transition: all var(--transition);
    position: relative;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.9rem;
}

.nav-tabs .nav-link:hover {
    color: var(--accent-2);
    background: rgba(179, 0, 0, 0.15);
    border-bottom: 2px solid var(--accent);
}

.nav-tabs .nav-link.active {
    color: var(--accent);
    background: rgba(179, 0, 0, 0.2);
    border-bottom: 3px solid var(--accent);
    text-shadow: 0 0 5px rgba(255, 0, 0, 0.5);
}

.nav-tabs .badge {
    background: var(--accent);
    color: #0a0a0a;
    font-weight: 800;
    margin-left: 6px;
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 0.75rem;
    box-shadow: 0 0 8px var(--accent);
}

/* Список чатов */
.chat-list {
    flex: 1;
    overflow-y: auto;
    padding: 4px 0;
}

.chat-item {
    display: flex;
    align-items: center;
    padding: 14px 16px;
    border-bottom: 1px solid rgba(179, 0, 0, 0.15);
    text-decoration: none;
    color: var(--text);
    transition: all var(--transition);
    background: transparent;
    margin: 0 4px;
    border-radius: 12px;
}

.chat-item:hover {
    background: rgba(179, 0, 0, 0.15);
    text-decoration: none;
    color: #fff;
    transform: translateX(4px);
    box-shadow: -4px 0 10px rgba(179, 0, 0, 0.3);
}

.chat-item.active {
    background: rgba(179, 0, 0, 0.25);
    border-left: 4px solid var(--accent);
    box-shadow: 0 0 15px rgba(179, 0, 0, 0.3) inset;
}

.chat-avatar {
    margin-right: 14px;
    position: relative;
}

.chat-avatar img {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
    transition: border-color var(--transition), box-shadow var(--transition);
}

.chat-item:hover .chat-avatar img {
    border-color: var(--accent);
    box-shadow: 0 0 15px var(--accent);
}

.chat-info {
    flex: 1;
    min-width: 0;
}

.chat-name {
    font-weight: 700;
    font-size: 1.05rem;
    color: #eee;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-last-message {
    font-size: 0.85rem;
    color: var(--muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    opacity: 0.8;
}

.unread-badge {
    background: var(--accent);
    color: #0a0a0a;
    font-weight: 800;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 0.75rem;
    margin-left: 8px;
    box-shadow: 0 0 10px var(--accent);
    animation: pulseGlow 1.5s infinite;
}

@keyframes pulseGlow {
    0%, 100% { box-shadow: 0 0 5px var(--accent); }
    50% { box-shadow: 0 0 15px var(--accent-2); }
}

/* Приглашения */
.invite-list {
    padding: 12px;
}

.invite-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    background: rgba(20, 0, 0, 0.3);
    border: 1px solid rgba(179, 0, 0, 0.4);
    border-radius: 12px;
    margin-bottom: 10px;
    backdrop-filter: blur(5px);
    transition: all var(--transition);
}

.invite-item:hover {
    border-color: var(--accent);
    box-shadow: 0 0 15px rgba(179, 0, 0, 0.3);
    transform: translateY(-2px);
}

.invite-info {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #ddd;
}

.invite-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid var(--border);
    object-fit: cover;
}

.invite-actions {
    display: flex;
    gap: 8px;
}

.invite-actions .btn {
    padding: 6px 12px;
    font-size: 0.9rem;
    border-radius: 8px;
    background: rgba(20, 20, 20, 0.8);
    border: 1px solid var(--border);
    color: #eee;
}

.invite-actions .btn-success {
    background: rgba(0, 179, 0, 0.2);
    border-color: #00b300;
}

.invite-actions .btn-success:hover {
    background: #00b300;
    color: #000;
    box-shadow: 0 0 15px #00b300;
}

.invite-actions .btn-danger {
    background: rgba(179, 0, 0, 0.2);
    border-color: var(--accent);
}

.invite-actions .btn-danger:hover {
    background: var(--accent);
    color: #000;
    box-shadow: 0 0 15px var(--accent);
}

/* Правая панель (чат) */
.chat-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: rgba(5, 5, 5, 0.6);
    backdrop-filter: blur(8px);
    position: relative;
}

.chat-header {
    padding: 16px 24px;
    background: rgba(10, 0, 0, 0.5);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
}

.chat-header-info {
    display: flex;
    align-items: center;
    gap: 16px;
}

.header-avatar {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    border: 2px solid var(--accent);
    box-shadow: 0 0 12px var(--accent);
    object-fit: cover;
}

.chat-header h4 {
    color: var(--accent);
    font-size: 1.3rem;
    font-weight: 700;
    letter-spacing: 1px;
    text-shadow: 0 0 5px rgba(179, 0, 0, 0.5);
    margin: 0;
}

/* Область сообщений */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    background: radial-gradient(circle at center, rgba(179, 0, 0, 0.05), transparent 70%);
}

.message {
    max-width: 75%;
    display: flex;
    flex-direction: column;
    animation: messageSlide 0.3s ease-out;
}

@keyframes messageSlide {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message-in {
    align-self: flex-start;
}

.message-out {
    align-self: flex-end;
}

.message-content {
    padding: 14px 18px;
    border-radius: 20px;
    word-wrap: break-word;
    line-height: 1.5;
    font-size: 1rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    position: relative;
}

.message-in .message-content {
    background: rgba(20, 20, 20, 0.8);
    border: 1px solid rgba(179, 0, 0, 0.4);
    border-bottom-left-radius: 6px;
    color: #e0e0e0;
    backdrop-filter: blur(5px);
}

.message-out .message-content {
    background: linear-gradient(145deg, rgba(179, 0, 0, 0.85), rgba(255, 0, 0, 0.7));
    border: 1px solid var(--accent-2);
    border-bottom-right-radius: 6px;
    color: #fff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    box-shadow: 0 0 15px rgba(179, 0, 0, 0.5);
}

.message-meta {
    display: flex;
    align-items: center;
    margin-top: 6px;
    font-size: 0.7rem;
    color: var(--muted);
    gap: 8px;
}

.message-out .message-meta {
    justify-content: flex-end;
}

.message-time {
    opacity: 0.8;
}

.delete-message-form {
    display: inline;
}

.btn-icon {
    background: transparent;
    border: none;
    color: var(--muted);
    cursor: pointer;
    padding: 2px 5px;
    border-radius: 6px;
    transition: all var(--transition);
}

.btn-icon:hover {
    color: var(--accent);
    background: rgba(179, 0, 0, 0.2);
    box-shadow: 0 0 5px var(--accent);
}

/* Поле ввода */
.chat-input {
    padding: 18px 24px;
    background: rgba(10, 0, 0, 0.4);
    border-top: 1px solid var(--border);
    backdrop-filter: blur(10px);
}

.chat-input .input-group {
    display: flex;
    gap: 12px;
    align-items: center;
}

.chat-input .form-control {
    flex: 1;
    background: rgba(20, 20, 20, 0.8);
    border: 2px solid rgba(179, 0, 0, 0.6);
    color: #eee;
    border-radius: 30px;
    padding: 14px 20px;
    resize: none;
    font-size: 1rem;
    backdrop-filter: blur(5px);
    transition: all var(--transition);
}

.chat-input .form-control:focus {
    border-color: var(--accent-2);
    box-shadow: 0 0 20px rgba(255, 0, 0, 0.4);
    background: rgba(30, 30, 30, 0.9);
    outline: none;
}

.chat-input .btn {
    padding: 12px 28px;
    border-radius: 40px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    border: none;
    box-shadow: 0 0 20px rgba(179, 0, 0, 0.6);
    transition: all var(--transition);
}

.chat-input .btn:hover {
    transform: scale(1.02);
    box-shadow: 0 0 30px var(--accent);
}

/* Плейсхолдер (когда чат не выбран) */
.chat-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center;
    background: rgba(0, 0, 0, 0.2);
}

.placeholder-content {
    color: #888;
    max-width: 300px;
}

.placeholder-content i {
    color: var(--accent);
    margin-bottom: 20px;
    text-shadow: 0 0 15px var(--accent);
    opacity: 0.7;
}

.placeholder-content h4 {
    margin-bottom: 24px;
    color: #aaa;
    font-weight: 400;
}

.placeholder-content .btn {
    margin-top: 10px;
}

/* Адаптивность */
@media (max-width: 768px) {
    .chat-app-container {
        flex-direction: column;
        height: auto;
        min-height: 85vh;
    }

    .chat-sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--border);
    }

    .chat-main {
        min-height: 60vh;
    }

    .message {
        max-width: 90%;
    }

    .chat-header {
        padding: 12px 16px;
    }

    .chat-input {
        padding: 12px 16px;
    }
}

/* Скроллбар внутри чата (переопределяем для кастомизации) */
.chat-messages::-webkit-scrollbar,
.chat-list::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-track,
.chat-list::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
}

.chat-messages::-webkit-scrollbar-thumb,
.chat-list::-webkit-scrollbar-thumb {
    background: rgba(179, 0, 0, 0.5);
    border-radius: 10px;
}

.chat-messages::-webkit-scrollbar-thumb:hover,
.chat-list::-webkit-scrollbar-thumb:hover {
    background: var(--accent);
}

.chat-tabs-row {
    padding: 10px 16px;
    border-bottom: 1px solid var(--border);
}

.tabs-left {
    display: flex;
    gap: 10px;
    align-items: center;
}

.tab-btn {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--muted);
    padding: 6px 16px;
    border-radius: 30px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.tab-btn.active {
    background: var(--accent);
    color: #000;
    border-color: var(--accent);
    box-shadow: 0 0 12px var(--accent);
}

.tab-btn .badge {
    background: #000;
    color: var(--accent);
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 800;
}

.tab-pane {
    display: none;
}
.tab-pane.active {
    display: block;
}