/* ============================================
   אותנטי ניוז - Telegram-Style Design
   ============================================ */

:root {
    /* Telegram Light Blue Theme */
    --primary-color: #0088cc;
    --primary-hover: #006699;
    --secondary-color: #f4f4f5;
    --background: #ffffff;
    --sidebar-bg: #f4f4f5;
    --message-bg: #ffffff;
    --message-out-bg: #eeffde;
    --border-color: #dadce0;
    --text-primary: #000000;
    --text-secondary: #707579;
    --text-muted: #a0a0a0;
    --hover-bg: #e8e8e8;
    --unread-badge: #0088cc;
    --shadow: rgba(0, 0, 0, 0.1);
    --reaction-bg: #f0f0f0;
    --reaction-active: #0088cc;

    /* Spacing */
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 12px;
    --spacing-lg: 16px;
    --spacing-xl: 24px;

    /* Border Radius */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 18px;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--background);
    color: var(--text-primary);
    line-height: 1.5;
    overflow: hidden;
}

/* ============================================
   App Container
   ============================================ */

.app-container {
    display: flex;
    height: 100vh;
    max-width: 1920px;
    margin: 0 auto;
    overflow: hidden;
}

/* ============================================
   Channels Sidebar
   ============================================ */

.channels-sidebar {
    width: 360px;
    background: var(--sidebar-bg);
    border-left: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease;
}

.sidebar-header {
    padding: var(--spacing-lg);
    background: var(--primary-color);
    color: white;
    box-shadow: 0 2px 4px var(--shadow);
}

.sidebar-header h1 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: var(--spacing-sm);
}

.admin-panel-btn {
    display: block;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    text-decoration: none;
    padding: 10px 15px;
    border-radius: 8px;
    text-align: center;
    font-size: 14px;
    font-weight: 600;
    margin-top: 10px;
    transition: all 0.3s;
}

.admin-panel-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.user-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--spacing-sm);
    font-size: 14px;
}

.user-info span {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.btn-icon {
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 16px;
    padding: var(--spacing-xs);
    border-radius: var(--radius-sm);
    transition: background 0.2s;
}

.btn-icon:hover {
    background: rgba(255, 255, 255, 0.2);
}

.channels-list {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: opacity 0.1s ease-out;
}

.channels-list.tab-switching {
    opacity: 0.8;
    transition: opacity 0.15s ease-out;
}

.channels-list.updated {
    animation: fadeInUpdate 0.15s ease-out;
}

@keyframes fadeInUpdate {
    0% {
        opacity: 0.9;
    }
    100% {
        opacity: 1;
    }
}

.channel-item {
    display: flex;
    align-items: center;
    padding: var(--spacing-md) var(--spacing-lg);
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: background 0.2s;
    position: relative;
}

.channel-item:hover {
    background: var(--hover-bg);
}

.channel-item.active {
    background: var(--background);
}

.channel-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--primary-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: bold;
    flex-shrink: 0;
    margin-left: var(--spacing-md);
    position: relative;
}

.channel-content {
    flex: 1;
    min-width: 0;
}

.channel-top {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: var(--spacing-xs);
}

.channel-name {
    font-weight: 600;
    font-size: 15px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
}

.channel-time {
    font-size: 12px;
    color: var(--text-muted);
    white-space: nowrap;
    margin-left: var(--spacing-sm);
}

.channel-bottom {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    justify-content: space-between;
}

.channel-preview {
    font-size: 14px;
    color: var(--text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
}

/* עוגל כמות הודעות לא נקראו - מיקום משופר */
.unread-badge {
    position: relative;
    background: var(--unread-badge);
    color: white;
    border-radius: 12px;
    min-width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 600;
    padding: 0 8px;
    flex-shrink: 0;
    margin-left: auto;
}

/* צבע מיוחד לערוצים מושתקים */
.unread-badge.muted {
    background: #8e8e93;  /* צבע אפור כמו בטלגרם */
    color: #ffffff;
    opacity: 0.8;
}

.channel-item.pinned {
    background: rgba(0, 136, 204, 0.05);
    border-left: 3px solid var(--primary-color);
}

.channel-item.all-channels {
    background: linear-gradient(135deg, rgba(0, 136, 204, 0.1), rgba(76, 175, 80, 0.1));
    border-left: 4px solid #4CAF50;
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.channel-item.all-channels .channel-avatar {
    background: linear-gradient(135deg, #0088CC, #4CAF50);
    color: white;
    font-weight: bold;
}

/* הסתר מספר הודעות מהערוץ הראשון בסרגל */
.channel-item.all-channels .unread-badge {
    display: none;
}

.channel-item.all-channels .channel-name {
    color: #0088CC;
    font-weight: 700;
}

.channel-title-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
}

.channel-actions {
    display: flex;
    align-items: center;
    gap: 4px;
}

.btn-pin-header {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 6px;
    border-radius: 4px;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    opacity: 0.6;
}

.btn-pin-header:hover {
    opacity: 1;
    background: rgba(0, 0, 0, 0.05);
    transform: rotate(-20deg) scale(1.1);
}

.btn-pin-header.pinned {
    opacity: 1;
}

.btn-pin-header.pinned:hover {
    transform: rotate(0deg) scale(1.1);
}

.pin-icon {
    fill: #555;
    transition: all 0.3s ease;
}

.btn-pin-header:hover .pin-icon {
    fill: #0088cc;
}

.btn-pin-header.pinned .pin-icon {
    fill: #0088cc;
}

.btn-pin-header.pinned:hover .pin-icon {
    fill: #006699;
}

.btn-mute-header {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 6px;
    border-radius: 4px;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    opacity: 0.6;
}

.btn-mute-header:hover {
    opacity: 1;
    background: rgba(0, 0, 0, 0.05);
    transform: scale(1.1);
}

.btn-mute-header.muted {
    opacity: 1;
}

.mute-icon {
    transition: all 0.3s ease;
    color: #0088cc;
}

.mute-icon .speaker-body {
    transition: all 0.3s ease;
}

.mute-icon .wave {
    opacity: 1;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

/* Stagger animation for waves */
.mute-icon .wave-1 {
    transition-delay: 0s;
}

.mute-icon .wave-2 {
    transition-delay: 0.05s;
}

.mute-icon .wave-3 {
    transition-delay: 0.1s;
}

.mute-icon .mute-slash {
    opacity: 0;
    transition: opacity 0.3s ease;
    color: #d32f2f;
}

/* Hover state - not muted */
.btn-mute-header:not(.muted):hover .mute-icon {
    color: #006699;
}

.btn-mute-header:not(.muted):hover .mute-icon .wave {
    transform: scale(1.1);
}

/* Muted state */
.btn-mute-header.muted .mute-icon {
    color: #d32f2f;
}

.btn-mute-header.muted .mute-icon .wave {
    opacity: 0;
    transform: scale(0.8);
}

.btn-mute-header.muted .mute-icon .mute-slash {
    opacity: 1;
}

/* Muted hover */
.btn-mute-header.muted:hover .mute-icon {
    color: #b71c1c;
}

/* ============================================
   Messages Area
   ============================================ */

.messages-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--background);
    position: relative;
    min-height: 100vh;
    overflow: hidden;
}

.welcome-screen {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center;
    padding: var(--spacing-xl);
}

.welcome-content h2 {
    font-size: 28px;
    margin-bottom: var(--spacing-md);
    color: var(--text-primary);
}

.welcome-actions {
    margin-top: var(--spacing-lg);
    display: flex;
    justify-content: center;
    gap: var(--spacing-md);
}

.channel-view {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.channel-header {
    display: flex;
    align-items: center;
    padding: var(--spacing-md) var(--spacing-lg);
    background: var(--background);
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 1px 3px var(--shadow);
    z-index: 10;
}

.btn-back {
    display: none;
    background: transparent;
    border: none;
    font-size: 24px;
    cursor: pointer;
    padding: var(--spacing-sm);
    margin-left: var(--spacing-md);
    color: var(--primary-color);
    transition: all 0.2s ease;
}

.btn-back:hover {
    background: var(--hover-bg);
    border-radius: var(--radius-md);
    transform: translateX(2px);
}

.btn-back::before {
    content: '►';
    font-size: 20px;
    font-weight: bold;
}

.channel-info {
    flex: 1;
}

.channel-info h2 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 2px;
}

.channel-info span {
    font-size: 13px;
    color: var(--text-secondary);
}

.btn-search {
    background: transparent;
    border: none;
    font-size: 20px;
    cursor: pointer;
    padding: var(--spacing-sm);
    margin-left: var(--spacing-sm);
    color: var(--primary-color);
    transition: transform 0.2s;
}

.btn-notification {
    background: transparent;
    border: none;
    font-size: 20px;
    cursor: pointer;
    padding: var(--spacing-sm);
    margin-left: var(--spacing-sm);
    color: var(--primary-color);
    transition: all 0.2s;
    border-radius: var(--radius-md);
}

.btn-notification:hover {
    transform: scale(1.1);
    background: var(--hover-bg);
}

.btn-notification.enabled {
    color: #4CAF50;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
    }
}

.search-bar {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-md) var(--spacing-lg);
    background: #fff;
    border-bottom: 1px solid var(--border-color);
    animation: slideDown 0.3s ease;
}

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

.search-bar input {
    flex: 1;
    padding: 10px 15px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    font-size: 14px;
    outline: none;
}

.search-bar input:focus {
    border-color: var(--primary-color);
}

.btn-search-submit {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: var(--radius-lg);
    cursor: pointer;
    font-weight: 600;
    transition: background 0.2s;
}

.btn-search-submit:hover {
    background: var(--primary-hover);
}

.btn-search-close {
    background: transparent;
    border: none;
    font-size: 20px;
    cursor: pointer;
    padding: 5px;
    color: var(--text-secondary);
}

.btn-search-close:hover {
    color: var(--text-primary);
}

.messages-container {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: var(--spacing-lg) var(--spacing-lg) 60px var(--spacing-lg);
    background: #f0f2f5;
    background-image:
        repeating-linear-gradient(
            45deg,
            transparent,
            transparent 10px,
            rgba(255,255,255,.03) 10px,
            rgba(255,255,255,.03) 20px
        );
}

.messages-loader {
    display: none;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm) var(--spacing-md);
    color: var(--text-secondary);
    font-size: 13px;
}

.messages-loader .spinner {
    width: 14px;
    height: 14px;
    border: 2px solid rgba(0, 0, 0, 0.1);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ============================================
   Message Bubbles
   ============================================ */

.date-separator {
    text-align: center;
    margin: var(--spacing-lg) 0;
}

.date-badge {
    display: inline-block;
    padding: 6px 12px;
    background: var(--secondary-color);
    color: var(--text-secondary);
    border-radius: var(--radius-lg);
    font-size: 13px;
    font-weight: 500;
}

/* Unread Messages Bar - Telegram Style */
.unread-messages-bar {
    text-align: center;
    margin: var(--spacing-lg) 0;
    padding: var(--spacing-md) 0;
    position: relative;
    z-index: 10;
}

.unread-bar-text {
    display: inline-block;
    padding: 8px 16px;
    background: var(--primary-color);
    color: white;
    border-radius: var(--radius-xl);
    font-size: 14px;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(0, 136, 204, 0.3);
    animation: slideInDown 0.3s ease;
}

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

.message-bubble {
    margin-bottom: 50px;
    max-width: 85%;
    animation: messageSlideIn 0.2s ease-out;
    width: fit-content;
    min-width: 200px;
    overflow: visible;
    word-wrap: break-word;
}

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

.message-time {
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: var(--spacing-xs);
    padding-left: var(--spacing-sm);
}

.message-content {
    background: var(--message-bg);
    border-radius: var(--radius-lg);
    padding: var(--spacing-md);
    box-shadow: 0 1px 2px var(--shadow);
    position: relative;
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
    max-width: 100%;
    overflow: visible;
}

.message-bubble.breaking .message-content {
    border-left: 4px solid #ff0000;
}

.message-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: var(--spacing-sm);
}

.message-title {
    font-weight: 600;
    font-size: 15px;
    flex: 1;
    line-height: 1.4;
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
}

.message-options {
    position: relative;
}

.btn-options {
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 18px;
    color: var(--text-muted);
    padding: var(--spacing-xs);
    border-radius: var(--radius-sm);
    transition: background 0.2s;
}

.btn-options:hover {
    background: var(--hover-bg);
}

.message-image {
    width: auto;
    max-width: 50%;
    height: auto;
    border-radius: var(--radius-md);
    margin: var(--spacing-sm) 0;
    cursor: pointer;
    transition: transform 0.2s;
    display: block;
}

.message-image:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 12px var(--shadow);
}

.message-video {
    width: 100%;
    max-width: 100%;
    height: 315px;
    border-radius: var(--radius-md);
    margin: var(--spacing-sm) 0;
    box-shadow: 0 2px 8px var(--shadow);
    display: block;
}

@media (max-width: 768px) {
    .message-video {
        max-width: 100%;
        height: 240px;
    }
}

.message-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    border-bottom: 1px solid transparent;
    transition: all 0.2s;
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-all;
    display: inline-block;
    max-width: 100%;
}

.message-link:hover {
    color: var(--primary-hover);
    border-bottom-color: var(--primary-hover);
    background: rgba(0, 136, 204, 0.05);
}

.message-text {
    font-size: 14px;
    line-height: 1.5;
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
    white-space: pre-wrap;
    max-width: 100%;
    overflow: hidden;
    color: var(--text-primary);
}

.message-category {
    display: inline-block;
    padding: 4px 8px;
    background: var(--secondary-color);
    border-radius: var(--radius-sm);
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: var(--spacing-sm);
}

/* ============================================
   Reactions - Telegram Style
   ============================================ */

.message-reactions-container {
    position: relative;
    margin-top: var(--spacing-sm);
    margin-bottom: var(--spacing-sm);
    padding-bottom: 8px;
    min-height: 8px;
    display: block !important;
}

/* אימוג'ים שנבחרו - תמיד גלויים */
.message-reactions {
    display: flex !important;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 4px;
    min-height: 30px;
}

.reaction-btn {
    background: var(--reaction-bg);
    border: 2px solid #e0e0e0;
    border-radius: var(--radius-xl);
    padding: 4px 10px;
    cursor: pointer;
    display: flex !important;
    align-items: center;
    gap: 5px;
    font-size: 14px;
    transition: all 0.2s ease;
    visibility: visible !important;
    opacity: 1 !important;
}

.reaction-btn:hover {
    background: #e8e8e8;
    transform: scale(1.05);
}

/* כפתור פעיל - המשתמש הנוכחי בחר */
.reaction-btn.active {
    background: #d6ebff;
    border-color: #0088cc;
    box-shadow: 0 0 0 2px rgba(0, 136, 204, 0.2);
}

.reaction-btn .reaction-emoji {
    font-size: 16px;
    line-height: 1;
}

.reaction-btn .reaction-count {
    font-size: 13px;
    font-weight: 600;
    color: #555;
    line-height: 1;
}

.reaction-btn.active .reaction-count {
    color: #0088cc;
    font-weight: 700;
}

/* תפריט ריחוף - מופיע רק כשמעבירים עכבר */
.reaction-hover-menu {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 4px;
    background: white;
    border-radius: var(--radius-xl);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
    padding: 6px;
    gap: 4px;
    z-index: 100;
    flex-direction: row;
    align-items: center;
}

/* הצג תפריט כשמרחפים מעל הבועה */
.message-bubble:hover .reaction-hover-menu {
    display: flex;
}

.reaction-hover-btn {
    background: var(--reaction-bg);
    border: 2px solid transparent;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    transition: all 0.2s ease;
}

.reaction-hover-btn:hover {
    background: #e0e0e0;
    transform: scale(1.15);
}

.reaction-hover-btn .reaction-emoji {
    font-size: 20px;
    line-height: 1;
}

/* ============================================
   Message Menu
   ============================================ */

.message-menu {
    position: fixed;
    background: white;
    border-radius: var(--radius-md);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    padding: var(--spacing-xs);
    z-index: 1000;
    min-width: 200px;
}

.menu-item {
    width: 100%;
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-md);
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 14px;
    text-align: left;
    border-radius: var(--radius-sm);
    transition: background 0.2s;
}

.menu-item:hover {
    background: var(--hover-bg);
}

.menu-item .icon {
    font-size: 18px;
}

/* ============================================
   Scroll to Bottom Button
   ============================================ */

.scroll-to-bottom {
    position: fixed;
    bottom: 80px;
    left: 290px; /* מיקום ברירת מחדל בצד שמאל */
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--primary-color);
    color: white;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 12px var(--shadow);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    transition: all 0.3s;
}

.scroll-to-bottom:hover {
    background: var(--primary-hover);
    transform: scale(1.1);
}

.scroll-to-bottom .arrow {
    font-size: 24px;
    font-weight: bold;
}

.scroll-to-bottom .badge {
    position: absolute;
    top: -5px;
    left: -5px;
    background: #ff0000;
    color: white;
    border-radius: 12px;
    padding: 2px 6px;
    font-size: 11px;
    font-weight: 600;
    min-width: 20px;
}

/* ============================================
   Modal
   ============================================ */

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.modal-content {
    background: white;
    padding: var(--spacing-xl);
    border-radius: var(--radius-lg);
    max-width: 400px;
    width: 90%;
    text-align: center;
}

.modal-content h2 {
    margin-bottom: var(--spacing-md);
    font-size: 22px;
}

.modal-content p {
    margin-bottom: var(--spacing-lg);
    color: var(--text-secondary);
}

.modal-content input {
    width: 100%;
    padding: var(--spacing-md);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 15px;
    margin-bottom: var(--spacing-lg);
    text-align: left;
}

.modal-content input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.btn-primary {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: var(--spacing-md) var(--spacing-xl);
    border-radius: var(--radius-md);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-primary:hover {
    background: var(--primary-hover);
}

/* ============================================
   Loading State
   ============================================ */

.loading {
    text-align: center;
    padding: var(--spacing-xl);
    color: var(--text-secondary);
}

/* ============================================
   Scrollbar Styling
   ============================================ */

::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
}

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

/* ============================================
   Tabs (Telegram Style)
   ============================================ */

.tabs-container {
    display: flex;
    gap: 0;
    background: var(--sidebar-bg);
    border-bottom: 1px solid var(--border-color);
    padding: 0 var(--spacing-md);
    direction: ltr;
}

.tab {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-xs);
    padding: var(--spacing-md) var(--spacing-sm);
    cursor: pointer;
    position: relative;
    transition: all 0.2s;
    border-bottom: 3px solid transparent;
    color: var(--text-secondary);
    direction: rtl;
    font-weight: 500;
}

.tab:hover {
    background: var(--hover-bg);
}

.tab.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.tab-name {
    font-size: 14px;
    white-space: nowrap;
}

.tab-badge {
    background: var(--unread-badge);
    color: white;
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    min-width: 18px;
    text-align: center;
}

.channels-list-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
}

/* ============================================
   Responsive Design
   ============================================ */

@media (max-width: 768px) {
    .channels-sidebar {
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        z-index: 100;
        width: 100%;
    }

    .channels-sidebar.hidden {
        transform: translateX(-100%);
    }

    .messages-area {
        width: 100%;
        height: 100vh;
    }

    .channel-view.active .btn-back {
        display: block;
    }

    .message-bubble {
        max-width: 95%;
    }

    .scroll-to-bottom {
        bottom: 70px;
        left: 20px;
        width: 45px;
        height: 45px;
    }
}

@media (max-width: 480px) {
    .sidebar-header h1 {
        font-size: 18px;
    }

    .channel-item {
        padding: var(--spacing-sm) var(--spacing-md);
    }

    .channel-avatar {
        width: 45px;
        height: 45px;
        font-size: 18px;
    }

    .messages-container {
        padding: var(--spacing-md);
    }

    .message-title {
        font-size: 14px;
    }

    .message-text {
        font-size: 13px;
    }
}

/* ============================================
   Print Styles
   ============================================ */

@media print {
    .channels-sidebar,
    .scroll-to-bottom,
    .message-options,
    .message-reactions {
        display: none;
    }
}

/* ============================================
   Image Lightbox
   ============================================ */

.image-lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
}

.image-lightbox.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    cursor: pointer;
}

.lightbox-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    z-index: 10001;
}

.lightbox-image {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
    border-radius: var(--radius-lg);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.lightbox-close {
    position: absolute;
    top: -50px;
    right: 0;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    font-size: 36px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.lightbox-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.lightbox-download {
    position: absolute;
    bottom: -60px;
    right: 50%;
    transform: translateX(50%);
    background: var(--primary-color);
    border: none;
    color: white;
    font-size: 24px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-download:hover {
    background: var(--primary-hover);
}

/* Message image cursor */
.message-image {
    cursor: pointer;
    transition: opacity 0.2s;
}

.message-image:hover {
    opacity: 0.9;
}

/* ============================================
   Tabs (Telegram Style)
   ============================================ */

.tabs-container {
    display: flex;
    gap: 0;
    background: var(--sidebar-bg);
    border-bottom: 1px solid var(--border-color);
    padding: 0 var(--spacing-md);
}

.tab {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-xs);
    padding: var(--spacing-md) var(--spacing-sm);
    cursor: pointer;
    position: relative;
    transition: all 0.2s;
    border-bottom: 3px solid transparent;
    color: var(--text-secondary);
    font-weight: 500;
}

.tab:hover {
    background: var(--hover-bg);
}

.tab.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.tab-name {
    font-size: 14px;
    white-space: nowrap;
}

.tab-badge {
    background: var(--unread-badge);
    color: white;
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    min-width: 18px;
    text-align: center;
}

.channels-list-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
}

