﻿/*@import url('https://fonts.googleapis.com/css2?family=Vazirmatn:wght@100;400;700&display=swap');*/
@font-face {
    font-family: IRANSans;
    font-style: normal;
    font-weight: bold;
    src: url('../fonts/IRANSans/eot/IRANSansWeb(FaNum)_Bold.eot');
    src: url('../fonts/IRANSans/eot/IRANSansWeb(FaNum)_Bold.eot?#iefix') format('embedded-opentype'),
    /* IE6-8 */
    /* FF39+,Chrome36+, Opera24+*/
    url('../webfonts/IRANSansWeb_Bold.woff') format('woff'),
    /* FF3.6+, IE9, Chrome6+, Saf5.1+*/
    url('../fonts/IRANSans/ttf/IRANSansWeb(FaNum)_Bold.ttf') format('truetype');
}

@font-face {
    font-family: IRANSans;
    font-style: normal;
    font-weight: 500;
    src: url('../fonts/IRANSans/eot/IRANSansWeb(FaNum)_Medium.eot');
    src: url('../fonts/IRANSans/eot/IRANSansWeb(FaNum)_Medium.eot?#iefix') format('embedded-opentype'),
    /* IE6-8 */
    /* FF39+,Chrome36+, Opera24+*/
    url('../webfonts/IRANSansWeb_Medium.woff') format('woff'),
    /* FF3.6+, IE9, Chrome6+, Saf5.1+*/
    url('../fonts/IRANSans/ttf/IRANSansWeb(FaNum)_Medium.ttf') format('truetype');
}

@font-face {
    font-family: IRANSans;
    font-style: normal;
    font-weight: 300;
    src: url('../fonts/IRANSans/eot/IRANSansWeb(FaNum)_Light.eot');
    src: url('../fonts/IRANSans/eot/IRANSansWeb(FaNum)_Light.eot?#iefix') format('embedded-opentype'),
    /* IE6-8 */
    /* FF39+,Chrome36+, Opera24+*/
    url('../webfonts/IRANSansWeb_Light.woff') format('woff'),
    /* FF3.6+, IE9, Chrome6+, Saf5.1+*/
    url('../fonts/IRANSans/ttf/IRANSansWeb(FaNum)_Light.ttf') format('truetype');
}

@font-face {
    font-family: IRANSans;
    font-style: normal;
    font-weight: 200;
    src: url('../fonts/IRANSans/eot/IRANSansWeb(FaNum)_UltraLight.eot');
    src: url('../fonts/IRANSans/eot/IRANSansWeb(FaNum)_UltraLight.eot?#iefix') format('embedded-opentype'),
    /* IE6-8 */
    /* FF39+,Chrome36+, Opera24+*/
    url('../webfonts/IRANSansWeb_UltraLight.woff') format('woff'),
    /* FF3.6+, IE9, Chrome6+, Saf5.1+*/
    url('../fonts/IRANSans/ttf/IRANSansWeb(FaNum)_UltraLight.ttf') format('truetype');
}

@font-face {
    font-family: IRANSans;
    font-style: normal;
    font-weight: normal;
    src: url('../fonts/IRANSans/eot/IRANSansWeb(FaNum).eot');
    src: url('../fonts/IRANSans/eot/IRANSansWeb(FaNum).eot?#iefix') format('embedded-opentype'),
    /* IE6-8 */
    /* FF39+,Chrome36+, Opera24+*/
    url('../webfonts/IRANSansWeb.woff') format('woff'),
    /* FF3.6+, IE9, Chrome6+, Saf5.1+*/
    url('../fonts/IRANSans/ttf/IRANSansWeb(FaNum).ttf') format('truetype');
}

:root {
    --tg-blue: #2481cc;
    --tg-bg: #dbdfe3;
    --tg-message-bg: #ffffff;
    --tg-date-color: #707579;
}

body, html {
    height: 100%;
    margin: 0;
    font-family: IRANSans !important;
    background-color: var(--tg-bg);
    /*background-image: url('https://www.transparenttextures.com/patterns/cubes.png');*/
    overflow: hidden;
}

.header-info a {
    color: white;
}

.app-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    max-width: 600px;
    margin: 0 auto;
    background: rgba(219, 223, 227, 0.8);
    position: relative;
    box-shadow: 0 0 20px rgba(0,0,0,0.1);
}

.chat-header {
    background-color: var(--tg-blue);
    color: white;
    padding: 10px 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 1000;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.header-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.channel-avatar {
    width: 40px;
    height: 40px;
    background: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--tg-blue);
    font-weight: bold;
    font-size: 1.2rem;
}

.channel-details h1 {
    font-size: 1rem;
    margin: 0;
    font-weight: 700;
}

.channel-details span {
    font-size: 0.75rem;
    opacity: 0.8;
}

#messageArea {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    display: flex;
    flex-direction: column; /* چیدمان ستونی معمولی */
    gap: 10px;
    scroll-behavior: smooth;
}

.msg-card {
    background: var(--tg-message-bg);
    border-radius: 12px;
    padding: 8px 12px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
    max-width: 95%;
    position: relative;
    align-self: flex-start; /* پیام‌ها سمت راست (در حالت RTL) */
    animation: messagePop 0.2s ease-out;
}

@keyframes messagePop {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(10px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.msg-text {
    font-size: 0.95rem;
    color: #000;
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-word;
}

.msg-footer {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin-top: 4px;
    gap: 4px;
}

.msg-time {
    font-size: 0.7rem;
    color: var(--tg-date-color);
}

.bottom-bar {
    background: #fff;
    padding: 12px;
    text-align: center;
    color: var(--tg-blue);
    font-weight: bold;
    cursor: pointer;
    border-top: 1px solid #ddd;
    user-select: none;
}

#scrollDownBtn {
    position: absolute;
    bottom: 75px;
    left: 20px;
    width: 42px;
    height: 42px;
    background: #fff;
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    color: var(--tg-blue);
    cursor: pointer;
    z-index: 100;
}

.pwa-install-banner {
    display: none;
    position: fixed;
    bottom: 20px;
    left: 20px;
    right: 20px;
    background: #fff;
    padding: 15px;
    border-radius: 12px;
    box-shadow: 0 5px 25px rgba(0,0,0,0.2);
    z-index: 2000;
    border: 1px solid #ddd;
}

#messageArea::-webkit-scrollbar {
    width: 5px;
}

#messageArea::-webkit-scrollbar-thumb {
    background: rgba(0,0,0,0.2);
    border-radius: 10px;
}
