.telegram-news-feed {
    max-width: 100%;
    margin: 20px 0;
}

.telegram-channel {
    margin-bottom: 40px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.telegram-channel:last-child {
    margin-bottom: 0;
}

.channel-title {
    margin: 0;
    padding: 15px 20px;
    border-bottom: 1px solid #e5e5e5;
}

.channel-title a {
    color: #2481cc;
    text-decoration: none;
    font-size: 18px;
}

.channel-title a:hover {
    text-decoration: underline;
}

.channel-posts {
    padding: 20px;
}



.telegram-post:last-child {
    margin-bottom: 0;
}

.telegram-post.new {
    background-color: rgba(36, 129, 204, 0.1);
}

.post-content-wrapper {
    display: flex;
    gap: 20px;
    margin-bottom: 15px;
    width: 100%;
}

.post-media {
    flex: 0 0 40%;
    width: 40%;
    height: 250px;
    position: relative;
    background: linear-gradient(135deg, #f5f5f5 0%, #e0e0e0 100%);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.media-grid {
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    gap: 2px;
    height: 100%;
    width: 100%;
}



.media-photo {
    position: relative;
    width: 100%;
    height: 100%;
    cursor: zoom-in;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f5f5f5;
}

.media-photo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #fff;
}

.post-content {
    flex: 1;
    min-width: 0;
    font-size: 15px;
    line-height: 1.5;
    white-space: normal;
    word-wrap: break-word;
    padding: 10px;
}

/* Remove this rule as we want post-media to always be visible */
.post-content-wrapper:not(:has(.post-media)) .post-content {
    flex: 1;
    min-width: 0;
}

.post-content p {
    margin: 0 0 10px 0;
}

.post-content p:last-child {
    margin-bottom: 0;
}

/* Media Styles */
.media-video {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
    overflow: hidden;
}

.media-video video {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.media-document {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 15px;
    background: #f5f5f5;
}

.document-link {
    display: flex;
    align-items: center;
    color: #2481cc;
    text-decoration: none;
    font-size: 14px;
}

.document-link:before {
    content: "";
    display: inline-block;
    width: 24px;
    height: 24px;
    margin-right: 10px;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%232481cc"><path d="M14 2H6C4.9 2 4 2.9 4 4V20C4 21.1 4.9 22 6 22H18C19.1 22 20 21.1 20 20V8L14 2ZM16 18H8V16H16V18ZM16 14H8V12H16V14ZM13 9V3.5L18.5 9H13Z"/></svg>') center/contain no-repeat;
}

.document-link:hover {
    text-decoration: underline;
}

/* Poll Styles */
.post-poll {
    background: #f5f5f5;
    padding: 15px;
    border-radius: 8px;
    margin: 15px 0;
}

.poll-question {
    font-size: 16px;
    font-weight: 500;
    margin-bottom: 15px;
}

.poll-options {
    margin-bottom: 10px;
}

.poll-option {
    margin-bottom: 10px;
}

.poll-option:last-child {
    margin-bottom: 0;
}

.option-text {
    margin-bottom: 5px;
    font-size: 14px;
}

.option-percentage {
    height: 30px;
    background: rgba(36, 129, 204, 0.2);
    border-radius: 15px;
    position: relative;
    overflow: hidden;
}

.option-percentage:before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    background: #2481cc;
    border-radius: 15px;
    width: var(--percentage);
}

.option-percentage span {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: #000;
    font-size: 13px;
    font-weight: 500;
}

.poll-footer {
    font-size: 13px;
    color: #666;
    margin-top: 10px;
}

/* Meta Information */
.post-meta {
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 13px;
    color: #666;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #e5e5e5;
}

.post-channel a {
    color: #2481cc;
    text-decoration: none;
    font-weight: 500;
}

.post-channel a:hover {
    text-decoration: underline;
}

.post-link {
    color: #666;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
}

.post-link:hover {
    color: #2481cc;
    text-decoration: underline;
}

.post-link:before {
    content: "";
    display: inline-block;
    width: 16px;
    height: 16px;
    margin-right: 5px;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%23666"><path d="M12 0C5.376 0 0 5.376 0 12s5.376 12 12 12 12-5.376 12-12S18.624 0 12 0zm0 19.2c-3.888 0-7.2-3.312-7.2-7.2S8.112 4.8 12 4.8s7.2 3.312 7.2 7.2-3.312 7.2-7.2 7.2z"/></svg>') center/contain no-repeat;
}

.post-date {
    margin-left: auto;
}

/* Lightbox styles */
.telegram-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    cursor: zoom-out;
}

.telegram-lightbox.active {
    display: flex;
}

.telegram-lightbox img {
    max-width: 90%;
    max-height: 90vh;
    object-fit: contain;
}

/* Media queries for mobile devices */
@media (max-width: 768px) {
    .telegram-post {
        padding: 15px;
    }

    .post-content-wrapper {
        flex-direction: column;
    }

    .post-media {
        flex: none;
        width: 100%;
        margin-bottom: 15px;
    }

    .post-content {
        width: 100%;
        padding: 0;
    }

    .post-meta {
        flex-wrap: wrap;
        gap: 10px;
    }

    .post-date {
        width: 100%;
        margin-left: 0;
        margin-top: 5px;
    }
}

.telegram-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #2481cc;
    color: #fff;
    padding: 12px 20px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    z-index: 9999;
    transform: translateX(120%);
    transition: transform 0.3s ease;
    font-size: 14px;
}

.telegram-notification.show {
    transform: translateX(0);
}

/* Pagination Styles */
.telegram-pagination {
    margin: 30px 0;
    text-align: center;
}

.telegram-pagination .page-numbers {
    display: inline-block;
    padding: 8px 14px;
    margin: 0 4px;
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 4px;
    color: #2481cc;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.3s ease;
}

.telegram-pagination .page-numbers:hover {
    background: #2481cc;
    color: #fff;
    border-color: #2481cc;
}

.telegram-pagination .page-numbers.current {
    background: #2481cc;
    color: #fff;
    border-color: #2481cc;
    font-weight: 600;
}

.telegram-pagination .page-numbers.dots {
    border: none;
    background: transparent;
    color: #666;
    cursor: default;
}

.telegram-pagination .page-numbers.dots:hover {
    background: transparent;
    color: #666;
}

.telegram-pagination .prev,
.telegram-pagination .next {
    font-weight: 500;
}

@media (max-width: 768px) {
    .telegram-pagination .page-numbers {
        padding: 6px 10px;
        font-size: 13px;
        margin: 0 2px;
    }
}

/* Text-to-Speech Controls */
.tts-controls {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    padding: 15px 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 9998;
    transition: all 0.3s ease;
    border: 1px solid #e5e5e5;
}

.tts-controls:hover {
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.2);
}

.tts-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: #2481cc;
    color: #fff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    font-family: inherit;
}

.tts-btn:hover {
    background: #1a6ba8;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(36, 129, 204, 0.3);
}

.tts-btn:active {
    transform: translateY(0);
}

.tts-btn svg {
    width: 20px;
    height: 20px;
}

.tts-pause {
    background: #ff9800;
}

.tts-pause:hover {
    background: #e68900;
}

.tts-stop {
    background: #f44336;
}

.tts-stop:hover {
    background: #d32f2f;
}

.tts-status {
    font-size: 13px;
    color: #666;
    white-space: nowrap;
    min-width: 150px;
}

/* Highlight post being read */
.telegram-post.tts-reading {
    background: linear-gradient(135deg, rgba(36, 129, 204, 0.1) 0%, rgba(36, 129, 204, 0.05) 100%);
    border-color: #2481cc;
    box-shadow: 0 4px 12px rgba(36, 129, 204, 0.2);
    transform: scale(1.01);
    transition: all 0.3s ease;
}

.telegram-post.tts-reading::before {
    content: "🔊";
    position: absolute;
    top: 15px;
    right: 15px;
    font-size: 24px;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.7;
        transform: scale(1.1);
    }
}

/* Mobile responsive */
@media (max-width: 768px) {
    .tts-controls {
        bottom: 10px;
        right: 10px;
        left: 10px;
        padding: 12px 15px;
        flex-wrap: wrap;
        justify-content: center;
    }

    .tts-btn {
        padding: 8px 12px;
        font-size: 13px;
    }

    .tts-btn span {
        display: none;
    }

    .tts-btn svg {
        width: 18px;
        height: 18px;
    }

    .tts-status {
        width: 100%;
        text-align: center;
        margin-top: 5px;
        font-size: 12px;
        min-width: auto;
    }

    .telegram-post {
        position: relative;
    }
}