:root {
    --color-bg: #0e0e0e;
    --color-sidebar: #1c1c1c;
    --color-bubble: #1c1c1c;
    --color-accent: #0088cc;
    --color-accent-hover: #0077b5;
    --color-text: #ffffff;
    --color-sub: #aaaaaa;
    --color-border: #2c2c2c;
    --color-success: #00c853;
    --color-sold: #2e7d32;
    --color-vip: #ffd700;
    --color-promo: #ff4444;
    --msg-radius: 15px;
    --base-font-size: 16px;
}

* { 
    box-sizing: border-box; 
    margin: 0; 
    padding: 0; 
}

body {
    font-family: "SF Pro Text", -apple-system, BlinkMacSystemFont, Roboto, sans-serif;
    background-color: var(--color-bg);
    color: var(--color-text);
    overflow-x: hidden;
    background-image: url('https://web.telegram.org/a/chat-bg-pattern-dark.8f98603082c9cc46.png');
    background-attachment: fixed;
    font-size: var(--base-font-size);
}

.app-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ========== HEADER ========== */
.main-header {
    height: 60px;
    background: rgba(28, 28, 28, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--color-border);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
    padding: 0 20px;
}

.header-left { 
    display: flex; 
    align-items: center; 
    gap: 12px; 
    cursor: pointer;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.channel-avatar-small {
    width: 40px; 
    height: 40px; 
    border-radius: 50%;
    background: linear-gradient(135deg, #6fb1e4, #2d83ec);
    object-fit: cover;
}

.channel-meta h1 {
    font-size: 1rem;
    font-weight: 600;
}

.channel-status {
    font-size: 0.7rem;
    color: var(--color-sub);
}

/* ========== SEARCH ========== */
.search-bar {
    background: #0e0e0e;
    border-radius: 20px;
    padding: 5px 15px;
    display: flex;
    align-items: center;
    gap: 10px;
    width: 250px;
}

.search-bar input {
    background: transparent; 
    border: none; 
    color: white; 
    outline: none; 
    width: 100%;
}

.search-bar input::placeholder {
    color: var(--color-sub);
}

/* ========== BUTTONS ========== */
.theme-toggle, .scale-btn {
    background: #0e0e0e;
    border: none;
    color: var(--color-text);
    padding: 5px 10px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.theme-toggle:hover, .scale-btn:hover {
    background: var(--color-accent);
    transform: translateY(-1px);
}

/* ========== LAYOUT ========== */
.layout-wrapper {
    display: flex;
    max-width: 1400px;
    margin: 20px auto;
    gap: 20px;
    padding: 0 20px;
    align-items: flex-start;
}

.main-content { 
    flex: 1; 
    max-width: 780px;
}

/* ========== TAGS FILTER ========== */
.tags-filter {
    display: flex;
    gap: 10px;
    padding: 12px 0;
    margin-bottom: 16px;
    overflow-x: auto;
    scrollbar-width: thin;
    -webkit-overflow-scrolling: touch;
    position: sticky;
    top: 60px; /* Прилипает под хедером */
    background: var(--color-bg);
    z-index: 100;
    backdrop-filter: blur(10px);
}

.tags-filter::-webkit-scrollbar {
    height: 4px;
}

.tag-chip {
    padding: 6px 14px;
    background: var(--color-sidebar);
    border: 1px solid var(--color-border);
    border-radius: 20px;
    color: var(--color-text);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.tag-chip.active {
    background: var(--color-accent);
    border-color: var(--color-accent);
}

.tag-chip:hover {
    background: var(--color-accent-hover);
    transform: translateY(-1px);
}

/* ========== MESSAGE LIST ========== */
.message-list { 
    display: flex; 
    flex-direction: column; 
    gap: 12px;
    max-height: none; /* Убираем ограничение высоты */
    overflow-y: visible;
    padding-right: 8px;
    padding-bottom: 20px;
}

.message-list::-webkit-scrollbar {
    width: 6px;
}

.message-list::-webkit-scrollbar-track {
    background: var(--color-bg);
}

.message-list::-webkit-scrollbar-thumb {
    background: var(--color-border);
    border-radius: 10px;
}

.date-separator {
    text-align: center;
    margin: 16px 0;
    position: relative;
}

.date-separator span {
    background: rgba(0, 0, 0, 0.5);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    color: var(--color-text);
}

/* ========== MESSAGE ITEM WITH AVATAR ========== */
.message-item-wrapper {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    margin-bottom: 8px;
    animation: fadeInUp 0.3s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6fb1e4, #2d83ec);
    flex-shrink: 0;
    overflow: hidden;
    margin-top: 4px;
}

.message-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.message-content {
    flex: 1;
    max-width: calc(100% - 54px);
}

.message-bubble-container {
    display: flex;
    width: 100%;
}

.message-bubble-container.in {
    justify-content: flex-start;
}

.message-bubble {
    width: 100%;
    background-color: var(--color-bubble);
    border-radius: var(--msg-radius);
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.5);
    transition: transform 0.2s;
}

.message-bubble-container.in .message-bubble {
    border-bottom-left-radius: 4px;
}

/* ========== POST BADGES ========== */
.post-badges {
    display: flex;
    gap: 6px;
    padding: 8px 12px 0;
    flex-wrap: wrap;
}

.badge {
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 12px;
    font-weight: 600;
    letter-spacing: 0.3px;
}

.badge-vip {
    background: linear-gradient(135deg, #ffd700, #ffb347);
    color: #000;
}

.badge-promo {
    background: var(--color-promo);
    color: white;
}

.badge-private {
    background: #6c5ce7;
    color: white;
}

.badge-sold {
    background: var(--color-sold);
    color: white;
    text-transform: uppercase;
}

/* ========== MESSAGE TEXT ========== */
.message-text { 
    padding: 10px 12px; 
    font-size: 15px; 
    line-height: 1.5; 
    word-break: break-word;
    white-space: pre-wrap;
}

/* ========== MESSAGE META ========== */
.message-meta {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 8px;
    padding: 0 12px 8px 12px;
    font-size: 0.7rem;
    color: var(--color-sub);
}

.message-views {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

/* ========== ALBUM GRID ========== */
.album-grid { 
    display: grid; 
    gap: 2px; 
    background: #000;
}

.album-grid[data-count="1"] {
    display: block;
}

.album-grid[data-count="2"] {
    grid-template-columns: 1fr 1fr;
}

.album-grid[data-count="3"] {
    grid-template-columns: 1.5fr 1fr;
    grid-template-rows: 1fr 1fr;
}

.album-grid[data-count="3"] .album-item:first-child {
    grid-row: span 2;
}

.album-grid[data-count="4"],
.album-grid[data-count="5"],
.album-grid[data-count="6"] {
    grid-template-columns: repeat(2, 1fr);
}

.album-item {
    position: relative;
    cursor: pointer;
    overflow: hidden;
    background: #000;
    min-height: 150px;
}

.album-item img, 
.album-item video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.album-item:hover img,
.album-item:hover video {
    transform: scale(1.05);
}

.video-play-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0,0,0,0.7);
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: white;
    pointer-events: none;
    backdrop-filter: blur(4px);
}

/* ========== REACTIONS ========== */
.message-reactions {
    display: flex;
    gap: 6px;
    padding: 4px 12px 8px;
    flex-wrap: wrap;
}

.reaction-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: rgba(255,255,255,0.1);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}

.reaction-badge:hover {
    background: rgba(255,255,255,0.2);
    transform: scale(1.05);
}

.reaction-emoji {
    font-size: 14px;
}

.reaction-count {
    font-size: 12px;
    color: var(--color-sub);
}

/* ========== MESSAGE ACTIONS (КНОПКИ) ========== */
.message-actions {
    display: flex;
    gap: 12px;
    padding: 8px 12px;
    border-top: 1px solid var(--color-border);
    margin-top: 4px;
}

.action-inquiry, .action-whatsapp {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: none;
    border: none;
    font-size: 13px;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 20px;
    transition: all 0.2s;
    flex: 1;
    font-weight: 500;
}

.action-inquiry {
    background: rgba(0,136,204,0.15);
    color: var(--color-accent);
}

.action-inquiry:hover {
    background: rgba(0,136,204,0.3);
    transform: translateY(-1px);
}

.action-whatsapp {
    background: rgba(37, 211, 102, 0.15);
    color: #25D366;
}

.action-whatsapp:hover {
    background: rgba(37, 211, 102, 0.3);
    transform: translateY(-1px);
}

/* ========== PRIVATE POST OVERLAY ========== */
.private-overlay {
    position: relative;
}

.private-blur {
    filter: blur(8px);
    pointer-events: none;
    user-select: none;
}

.private-lock {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0,0,0,0.85);
    padding: 12px 24px;
    border-radius: 30px;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    z-index: 10;
    font-weight: 600;
    transition: all 0.2s;
    white-space: nowrap;
}

.private-lock:hover {
    background: var(--color-accent);
    transform: translate(-50%, -50%) scale(1.05);
}

/* ========== SIDEBAR ========== */
.info-sidebar { 
    width: 340px;
    position: sticky; 
    top: 80px; 
    height: fit-content; 
}

.info-card {
    background: var(--color-sidebar);
    border-radius: 20px;
    padding: 25px;
    text-align: center;
    backdrop-filter: blur(10px);
    border: 1px solid var(--color-border);
}

.channel-avatar-large {
    width: 100px; 
    height: 100px; 
    border-radius: 50%;
    background: linear-gradient(135deg, #6fb1e4, #2d83ec);
    margin: 0 auto 15px;
    transition: transform 0.3s;
    object-fit: cover;
}

.channel-avatar-large:hover {
    transform: scale(1.05);
}

.channel-name-large {
    font-size: 1.5rem;
    margin-bottom: 4px;
}

.channel-handle {
    color: var(--color-sub);
    font-size: 0.85rem;
}

/* ========== STATS ========== */
.info-stats {
    display: flex; 
    justify-content: space-between;
    margin: 20px 0; 
    border-bottom: 1px solid var(--color-border); 
    padding-bottom: 20px;
}

.stat-item { 
    display: flex; 
    flex-direction: column; 
    cursor: pointer;
    transition: all 0.2s;
}

.stat-item:hover {
    transform: translateY(-2px);
}

.stat-value { 
    font-weight: bold; 
    font-size: 22px; 
    color: var(--color-accent);
}

.stat-label { 
    color: var(--color-sub); 
    font-size: 12px; 
}

/* ========== DESCRIPTION ========== */
.info-description { 
    text-align: left; 
    font-size: 14px; 
    margin-bottom: 20px; 
    line-height: 1.6;
}

/* ========== CONTACT BUTTONS ========== */
.contact-buttons {
    margin: 20px 0;
}

.sidebar-btn {
    width: 100%; 
    background: var(--color-accent); 
    color: white;
    border: none; 
    padding: 12px; 
    border-radius: 12px; 
    font-weight: bold;
    cursor: pointer; 
    margin: 10px 0; 
    transition: all 0.2s;
}

.sidebar-btn:hover {
    background: var(--color-accent-hover);
    transform: translateY(-2px);
}

.contact-row {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.contact-link {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: rgba(255,255,255,0.1);
    border-radius: 25px;
    color: var(--color-text);
    text-decoration: none;
    font-size: 13px;
    transition: all 0.2s;
}

.contact-link:hover {
    background: rgba(255,255,255,0.2);
    transform: translateY(-2px);
}


.action-contact {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: none;
    border: none;
    font-size: 13px;
    cursor: pointer;
    padding: 6px 12px;
    border-radius: 20px;
    transition: all 0.2s;
    width: 100%;
    color: var(--color-accent);
    font-weight: 500;
}

.action-contact:hover {
    background: rgba(0,136,204,0.1);
    transform: translateX(2px);
}

.action-contact svg {
    width: 16px;
    height: 16px;
}


/* ========== SIDEBAR FOOTER ========== */
.sidebar-footer {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 20px;
    font-size: 12px;
}

.sidebar-footer a {
    color: var(--color-sub);
    text-decoration: none;
    transition: color 0.2s;
}

.sidebar-footer a:hover {
    color: var(--color-accent);
}

.edit-btn {
    background: var(--color-accent);
    color: white;
    border: none;
    padding: 10px;
    border-radius: 10px;
    cursor: pointer;
    margin-top: 20px;
    width: 100%;
    transition: all 0.2s;
}

.edit-btn:hover {
    background: var(--color-accent-hover);
    transform: translateY(-1px);
}

/* ========== INPUT AREA (ADMIN) ========== */
.input-area {
    margin-top: 20px; 
    padding: 15px; 
    background: var(--color-sidebar); 
    border-radius: 20px;
    border: 1px solid var(--color-border);
}

.post-settings {
    padding: 10px;
    background: rgba(0,0,0,0.3);
    border-radius: 12px;
    margin-bottom: 12px;
}

.settings-row {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--color-sub);
    cursor: pointer;
}

.checkbox-label input {
    cursor: pointer;
}

#post-tags {
    width: 100%;
    padding: 8px 12px;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: 20px;
    color: var(--color-text);
    font-size: 12px;
}

#post-tags:focus {
    outline: none;
    border-color: var(--color-accent);
}

.input-wrapper { 
    display: flex; 
    align-items: center; 
    gap: 10px; 
}

textarea {
    flex: 1; 
    background: var(--color-bg); 
    border: 1px solid var(--color-border);
    border-radius: 20px;
    color: white; 
    resize: none; 
    outline: none;
    font-family: inherit;
    font-size: 14px;
    padding: 10px 15px;
    min-height: 44px;
    max-height: 120px;
}

textarea:focus {
    border-color: var(--color-accent);
}

.attach-btn, .send-btn { 
    background: none; 
    border: none; 
    color: var(--color-sub); 
    cursor: pointer; 
    padding: 8px;
    border-radius: 50%;
    transition: all 0.2s;
}

.attach-btn:hover, .send-btn:hover { 
    color: var(--color-accent);
    background: rgba(0,136,204,0.1);
}

/* ========== FLOATING BUTTONS ========== */
.floating-chat-btn {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--color-accent);
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    transition: all 0.2s;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.floating-chat-btn:hover {
    transform: scale(1.1);
    background: var(--color-accent-hover);
}

.scroll-down-btn {
    position: fixed;
    bottom: 24px;
    left: 24px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--color-sidebar);
    border: 1px solid var(--color-border);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s, transform 0.2s;
    font-size: 24px;
    color: var(--color-text);
}

.scroll-down-btn.visible {
    opacity: 1;
}

.scroll-down-btn:hover {
    background: var(--color-accent);
    transform: scale(1.05);
}

/* ========== MODALS ========== */
.modal {
    position: fixed; 
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%;
    background: rgba(0,0,0,0.9); 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    z-index: 2000;
    animation: fadeIn 0.2s;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content { 
    background: var(--color-sidebar); 
    padding: 24px; 
    border-radius: 24px; 
    width: 500px;
    max-width: 90vw;
    max-height: 90vh;
    overflow-y: auto;
    border: 1px solid var(--color-border);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--color-border);
}

.modal-header h3 {
    font-size: 1.2rem;
    font-weight: 600;
}

.close-modal, .close-feedback, .close-inquiry, .close-private {
    background: none;
    border: none;
    color: var(--color-sub);
    font-size: 24px;
    cursor: pointer;
    transition: color 0.2s;
    padding: 4px 8px;
}

.close-modal:hover {
    color: var(--color-text);
}

/* ========== FORM GROUPS ========== */
.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    color: var(--color-sub);
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 10px 12px;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: 12px;
    color: var(--color-text);
    font-family: inherit;
    font-size: 14px;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--color-accent);
}

/* ========== BUTTONS IN MODALS ========== */
.save-btn {
    width: 100%;
    background: var(--color-accent);
    color: white;
    border: none;
    padding: 12px;
    border-radius: 12px;
    font-weight: bold;
    cursor: pointer;
    margin-top: 10px;
    transition: all 0.2s;
}

.save-btn:hover {
    background: var(--color-accent-hover);
    transform: translateY(-1px);
}

.delete-btn {
    width: 100%;
    background: none;
    border: 1px solid #ff5e5e;
    color: #ff5e5e;
    padding: 10px;
    border-radius: 12px;
    cursor: pointer;
    margin-top: 12px;
    transition: all 0.2s;
}

.delete-btn:hover {
    background: #ff5e5e20;
    transform: translateY(-1px);
}

/* ========== MEDIA EDITOR MODAL ========== */
.media-editor-content {
    width: 800px;
    max-width: 90vw;
    height: 80vh;
    display: flex;
    flex-direction: column;
    padding: 0;
}

.media-editor-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--color-border);
}

.media-editor-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.media-carousel {
    flex: 1;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 300px;
}

.carousel-item {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.carousel-item img,
.carousel-item video {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.media-caption-area {
    padding: 16px;
    border-top: 1px solid var(--color-border);
}

#media-caption {
    width: 100%;
    padding: 10px;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: 12px;
    color: var(--color-text);
    font-family: inherit;
    resize: none;
}

.caption-counter {
    display: block;
    text-align: right;
    margin-top: 6px;
    font-size: 11px;
    color: var(--color-sub);
}

.send-media-btn {
    background: var(--color-accent);
    color: white;
    border: none;
    padding: 8px 20px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s;
}

.send-media-btn:hover {
    background: var(--color-accent-hover);
    transform: scale(1.02);
}

.icon-btn {
    background: none;
    border: none;
    color: var(--color-sub);
    font-size: 20px;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: all 0.2s;
}

.icon-btn:hover {
    background: rgba(255,255,255,0.1);
}

/* ========== MEDIA VIEWER MODAL ========== */
.media-viewer {
    background: #000;
}

.media-viewer-content {
    width: 100vw;
    height: 100vh;
    background: #000;
    border-radius: 0;
    display: flex;
    flex-direction: column;
    padding: 0;
}

.media-viewer-header {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: linear-gradient(to bottom, rgba(0,0,0,0.6), transparent);
    z-index: 10;
}

.viewer-info {
    color: white;
    font-size: 14px;
    font-weight: 500;
    background: rgba(0,0,0,0.5);
    padding: 4px 12px;
    border-radius: 20px;
}

.media-viewer-body {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.viewer-carousel {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.viewer-item {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.viewer-item img,
.viewer-item video {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.media-viewer-footer {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    padding: 20px;
    background: linear-gradient(to top, rgba(0,0,0,0.6), transparent);
    z-index: 10;
}

.viewer-nav-btn {
    background: rgba(0,0,0,0.6);
    border: none;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: white;
    font-size: 20px;
    transition: all 0.2s;
}

.viewer-nav-btn:hover:not(:disabled) {
    background: var(--color-accent);
    transform: scale(1.05);
}

.viewer-nav-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* ========== FEEDBACK CHAT ========== */
.feedback-chat {
    max-height: 300px;
    overflow-y: auto;
    padding: 12px;
    background: rgba(0,0,0,0.3);
    border-radius: 16px;
    margin-bottom: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.feedback-input-area {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.feedback-input-area input,
.feedback-input-area textarea {
    padding: 10px 12px;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: 12px;
    color: var(--color-text);
    font-family: inherit;
}

.feedback-input-area input:focus,
.feedback-input-area textarea:focus {
    outline: none;
    border-color: var(--color-accent);
}

/* ========== INQUIRY PREVIEW ========== */
.inquiry-preview {
    background: rgba(0,0,0,0.3);
    padding: 12px;
    border-radius: 12px;
    margin-bottom: 16px;
    font-size: 13px;
    border-left: 3px solid var(--color-accent);
}

/* ========== PRIVATE PREVIEW ========== */
.private-preview-blur {
    filter: blur(8px);
    text-align: center;
    padding: 20px;
    background: rgba(0,0,0,0.3);
    border-radius: 16px;
    margin-bottom: 16px;
}

.private-info {
    font-size: 13px;
    margin-bottom: 12px;
    color: var(--color-sub);
}

/* ========== HIDDEN CLASS ========== */
.hidden { 
    display: none !important; 
}

/* ========== RESPONSIVE ========== */
@media (max-width: 768px) {
    .layout-wrapper {
        flex-direction: column;
        gap: 16px;
    }
    
    .info-sidebar {
        width: 100%;
        position: static;
    }
    
    .main-content {
        max-width: 100%;
    }
    
    .message-avatar {
        width: 36px;
        height: 36px;
    }
    
    .message-content {
        max-width: calc(100% - 48px);
    }
    
    .header-actions .search-bar {
        display: none;
    }
    
    .tags-filter {
        padding: 8px;
    }
    
    .floating-chat-btn {
        bottom: 16px;
        right: 16px;
        width: 48px;
        height: 48px;
    }
    
    .scroll-down-btn {
        bottom: 16px;
        left: 16px;
        width: 40px;
        height: 40px;
        font-size: 20px;
    }
    
    .contact-row {
        flex-direction: column;
    }
    
    .contact-link {
        justify-content: center;
    }
    
    .settings-row {
        flex-direction: column;
        gap: 8px;
    }
    
    .message-actions {
        flex-direction: column;
        gap: 6px;
    }
    
    .action-inquiry, .action-whatsapp {
        width: 100%;
    }
    
    .post-badges {
        gap: 4px;
    }
    
    .badge {
        font-size: 9px;
        padding: 2px 6px;
    }
    
    .message-text {
        font-size: 14px;
    }
}

/* ========== CUSTOM SCROLLBAR GLOBAL ========== */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: var(--color-bg);
}

::-webkit-scrollbar-thumb {
    background: var(--color-border);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--color-accent);
}

/* ========== ANIMATIONS ========== */
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.reaction-badge:active {
    animation: pulse 0.2s ease;
}

/* ========== UTILITY ========== */
.text-center {
    text-align: center;
}

.mt-2 {
    margin-top: 8px;
}

.mb-2 {
    margin-bottom: 8px;
}

/* ========== MESSAGE BUBBLE - ФИКСИРОВАННАЯ ШИРИНА ========== */
.message-bubble {
    width: 100%;
    max-width: 480px; /* Фиксированная максимальная ширина как в Telegram */
    background-color: var(--color-bubble);
    border-radius: var(--msg-radius);
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.5);
    transition: transform 0.2s;
}

/* Для входящих сообщений (слева) */
.message-bubble-container.in {
    justify-content: flex-start;
}

.message-bubble-container.in .message-bubble {
    border-bottom-left-radius: 4px;
    margin-right: auto; /* Прижимаем влево, но не растягиваем */
}

/* Для исходящих (если будут) */
.message-bubble-container.out {
    justify-content: flex-end;
}

.message-bubble-container.out .message-bubble {
    border-bottom-right-radius: 4px;
    margin-left: auto; /* Прижимаем вправо */
}

/* Текст внутри — переносится, не растягивает блок */
.message-text {
    padding: 10px 12px;
    font-size: 15px;
    line-height: 1.5;
    word-break: break-word;
    overflow-wrap: break-word;
    white-space: pre-wrap;
}

/* Медиа внутри сообщения тоже не растягивают */
.album-grid {
    width: 100%;
    max-width: 480px;
}

.album-item img,
.album-item video {
    width: 100%;
    height: auto;
    object-fit: cover;
}

/* Контейнер сообщения */
.message-content {
    flex: 1;
    min-width: 0;
    max-width: 100%;
}

.message-item-wrapper {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    margin-bottom: 8px;
    width: 100%;
}

.message-avatar {
    width: 42px;
    height: 42px;
    flex-shrink: 0;
}
/* ========== ТЕМЫ ========== */
/* Тёмная тема (по умолчанию) */
body.theme-dark {
    --color-bg: #0e0e0e;
    --color-sidebar: #1c1c1c;
    --color-bubble: #1c1c1c;
    --color-text: #ffffff;
    --color-sub: #aaaaaa;
    --color-border: #2c2c2c;
    --color-accent: #0088cc;
    --color-accent-hover: #0077b5;
    background-image: url('https://web.telegram.org/a/chat-bg-pattern-dark.8f98603082c9cc46.png');
}

/* Светлая тема */
body.theme-light {
    --color-bg: #ffffff;
    --color-sidebar: #f0f0f0;
    --color-bubble: #e8e8e8;
    --color-text: #000000;
    --color-sub: #666666;
    --color-border: #dddddd;
    --color-accent: #0088cc;
    --color-accent-hover: #0077b5;
    background-image: url('https://web.telegram.org/a/chat-bg-pattern-light.8f98603082c9cc46.png');
}

/* Убедись что body имеет класс по умолчанию */
body {
    background-color: var(--color-bg);
    color: var(--color-text);
    transition: background-color 0.3s, color 0.3s;
}
.archive-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--color-sidebar);
    border-radius: 16px;
    padding: 24px;
    cursor: pointer;
    transition: all 0.2s;
    min-height: 200px;
    text-align: center;
}

.archive-item:hover {
    background: var(--color-accent);
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.2);
}

.archive-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

.archive-name {
    font-size: 12px;
    word-break: break-all;
    text-align: center;
    max-width: 150px;
    font-weight: 500;
    margin-bottom: 4px;
}

.archive-type {
    font-size: 10px;
    color: var(--color-sub);
    text-transform: uppercase;
    margin-bottom: 4px;
}

.archive-size {
    font-size: 10px;
    color: var(--color-sub);
    margin-bottom: 8px;
}

.archive-download {
    font-size: 11px;
    margin-top: 8px;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.archive-item:hover .archive-download {
    opacity: 1;
}

.video-placeholder {
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
}
.archive-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--color-sidebar);
    border-radius: 12px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s;
    min-height: 140px;
    text-align: center;
}

.archive-item:hover {
    background: var(--color-accent);
    transform: scale(1.02);
}

.archive-icon {
    font-size: 32px;
    margin-bottom: 8px;
}

.archive-name {
    font-size: 11px;
    word-break: break-all;
    max-width: 120px;
    margin-bottom: 4px;
}

.archive-type {
    font-size: 9px;
    color: var(--color-sub);
    text-transform: uppercase;
}

.archive-download {
    font-size: 10px;
    margin-top: 6px;
    opacity: 0.7;
}

.archive-item:hover .archive-download {
    opacity: 1;
}
/* Сетка для всех типов файлов */
.album-grid {
    display: grid;
    gap: 2px;
    background: #000;
}

.album-grid[data-count="1"] {
    display: block;
}

.album-grid[data-count="2"] {
    grid-template-columns: 1fr 1fr;
}

.album-grid[data-count="3"] {
    grid-template-columns: 1.5fr 1fr;
    grid-template-rows: 1fr 1fr;
}

.album-grid[data-count="3"] .album-item:first-child {
    grid-row: span 2;
}

.album-grid[data-count="4"],
.album-grid[data-count="5"],
.album-grid[data-count="6"] {
    grid-template-columns: repeat(2, 1fr);
}

/* Общий стиль для всех элементов */
.album-item {
    position: relative;
    overflow: hidden;
    background: var(--color-sidebar);
    min-height: 150px;
}

.album-item img,
.album-item video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Архивы */
.archive-item,
.file-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s;
    height: 100%;
    text-align: center;
    background: var(--color-sidebar);
}

.archive-item:hover,
.file-item:hover {
    background: var(--color-accent);
    transform: scale(1.02);
}

.archive-icon,
.file-icon {
    font-size: 32px;
    margin-bottom: 8px;
}

.archive-name,
.file-name {
    font-size: 11px;
    word-break: break-all;
    max-width: 120px;
    margin-bottom: 4px;
}

.archive-type {
    font-size: 9px;
    color: var(--color-sub);
    text-transform: uppercase;
}

.archive-download,
.file-download {
    font-size: 10px;
    margin-top: 6px;
    opacity: 0.7;
}

.archive-item:hover .archive-download,
.file-item:hover .file-download {
    opacity: 1;
}

.video-play-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0,0,0,0.7);
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: white;
    pointer-events: none;
    backdrop-filter: blur(4px);
}
.media-captions {
    padding: 8px 12px;
    background: rgba(0,0,0,0.3);
    border-top: 1px solid var(--color-border);
}

.media-caption {
    font-size: 12px;
    padding: 4px 0;
    color: var(--color-sub);
}

.caption-text {
    display: block;
    word-break: break-word;
}

