/* ===========================================
   Telegram Box - Standalone Component
   Easy to copy across different sites
   =========================================== */

/* Box Container */
.tg-box {
    position: fixed;
    bottom: 20px;
    left: 20px;
    z-index: 9998;
    background: #fff;
    border: 1px solid #33c759;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    max-width: 370px;
    width: calc(100% - 40px);
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s ease;
    line-height: 1;
}

.tg-box.tg-box--visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Close Button */
.tg-box__close {
    position: absolute;
    top: 24px;
    right: 8px;
    width: 28px;
    height: 28px;
    background: transparent;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s ease, transform 0.2s ease;
    z-index: 1;
}

.tg-box__close:hover {
    background-color: rgba(0, 0, 0, 0.08);
    transform: scale(1.1);
}

.tg-box__close::before,
.tg-box__close::after {
    content: '';
    position: absolute;
    width: 14px;
    height: 2px;
    background-color: #999;
    transition: background-color 0.2s ease;
}

.tg-box__close::before {
    transform: rotate(45deg);
}

.tg-box__close::after {
    transform: rotate(-45deg);
}

.tg-box__close:hover::before,
.tg-box__close:hover::after {
    background-color: #555;
}

/* Header */
.tg-box__header {
    padding: 10px;
    /*padding-right: 40px;*/
    background: #fff;
}

.tg-box__title {
    margin: 0 0 1px 0;
    font-size: 20px;
    font-weight: 700;
    color: #1a1a1a;
    line-height: normal;
}

.tg-box__subtitle {
    margin: 4px 0;
    font-size: 18px;
    color: #555;
    line-height: normal;
}

/* Channels Grid */
.tg-box__channels {
    display: flex;
    gap: 12px;
    padding: 0 10px 10px;
    background: #fff;
}

/* Channel Card */
.tg-box__channel {
    flex: 1;
    min-width: 0;
    background: #f7f7f7;
    border-radius: 8px;
    padding: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    text-align: center;
    text-decoration: none;
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.tg-box__channel:hover {
    background: #f0f1f2;
    transform: translateY(-2px);
}

.tg-box__channel-icon {
    display: flex;
}

.tg-box__emoji {
    font-size: 32px;
}

.tg-box__channel-name {
    font-size: 18px;
    font-weight: 600;
    color: #1a1a1a;
    white-space: nowrap;
}

.tg-box__channel-type {
    font-size: 16px;
    color: #555;
    padding-bottom: 5px;
}

.tg-box__channel-type--sports {
    color: #1eb13e;
}

.tg-box__channel-type--esports {
    color: #09b7d1;
}

/* Join Button */
.tg-box__btn {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #0088cc;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    padding: 16px;
    border-radius: 50px;
    min-width: 60px;
    min-height: 42px;
    line-height: 1.2;
    text-align: center;
    text-decoration: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.tg-box__btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 136, 204, 0.35);
}

/* Footer */
.tg-box__new {
    background: #33c759;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tg-box__new-text {
    font-size: 12px;
    font-weight: 700;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    /*line-height: 1.1;*/
}

/* ===========================================
   Responsive Styles
   =========================================== */

/* Tablet */
@media (max-width: 768px) {
    .tg-box {
        bottom: 16px;
        left: 16px;
    }

    .tg-box__header {
        padding: 14px 36px 10px 14px;
    }

    .tg-box__title {
        font-size: 16px;
    }

    .tg-box__subtitle {
        font-size: 16px;
    }

    .tg-box__channel {
        padding: 12px 8px 10px;
    }

}

/* Mobile */
@media (max-width: 480px) {
    .tg-box {
        bottom: 12px;
        left: 12px;
        right: 12px;
        max-width: none;
        width: auto;
    }

    .tg-box__header {
        padding: 12px 40px 8px 12px;
    }

    .tg-box__subtitle {
        font-size: 16px;
    }

    .tg-box__channel {
        padding: 10px 6px 8px;
        border-radius: 8px;
    }

    .tg-box__channel-name {
        font-size: 14px;
    }

    .tg-box__channel-type {
        font-size: 14px;
    }

    .tg-box__new {
        padding: 6px 12px;
    }

    .tg-box__new-text {
        font-size: 12px;
    }
}
