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

/* Overlay - Mobile only */
.tg-box-overlay {
    display: none;
}

/* Wrapper - Fixed Position Container */
.tg-box-wrapper {
    position: fixed;
    bottom: 20px;
    left: 20px;
    z-index: 9998;
    display: flex;
    align-items: flex-end;
    gap: 12px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s ease;
}

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

/* Box Container */
.tg-box {
    position: relative;
    background: #fff;
    border: 1px solid #33c759;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    width: 440px;
    overflow: visible;
    line-height: 1;
}

/* 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;
    border-radius: 0 0 12px 12px;
}

/* Channel Card */
.tg-box__channel {
    flex: 1;
    min-width: 0;
    background: #f7f7f7;
    border-radius: 8px;
    padding: 16px 12px;
    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);
}

/* Channel Type Label */
.tg-box__channel-type {
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

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

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

/* Channel Logo */
.tg-box__logo {
    max-width: 200px;
    height: auto;
}

/* Channel Description Text */
.tg-box__channel-text {
    font-size: 15px;
    font-weight: 600;
    color: #1a1a1a;
    line-height: 1.3;
}

/* Button Row with Arrows */
.tg-box__btn-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 4px;
}

/* Arrow Images */
.tg-box__arrows {
    width: 32px;
    height: auto;
}

/* Disclaimer */
.tg-box__disclaimer {
    font-size: 11px;
    color: #777;
    text-align: center;
    line-height: 1.3;
    margin-top: 4px;
}

/* Phone Image - Desktop */
.tg-box__phone-link {
    display: flex;
    align-items: flex-start;
    flex-shrink: 0;
}

.tg-box__phone {
    width: auto;
    transition: transform 0.2s ease;
}

.tg-box__phone-link:hover .tg-box__phone {
    transform: scale(1.03);
}

/* Join Button */
.tg-box__btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: #0088cc;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    padding: 12px 20px;
    border-radius: 50px;
    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__channel:hover .tg-box__btn {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 136, 204, 0.35);
}

/* Telegram Icon in Button */
.tg-box__btn-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

/* Top Badge */
.tg-box__new {
    background: #33c759;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px 12px 0 0;
}

.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-wrapper {
        bottom: 16px;
        left: 16px;
    }

    .tg-box {
        width: 380px;
    }

    .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-overlay {
        display: block;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 9997;
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.3s ease, visibility 0.3s ease;
    }

    .tg-box-overlay.tg-box--visible {
        opacity: 1;
        visibility: visible;
    }

    .tg-box-wrapper {
        bottom: 12px;
        left: 12px;
        right: 12px;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        background: #fff;
        border: 1px solid #33c759;
        border-radius: 12px;
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
        overflow: hidden;
    }

    .tg-box {
        flex-shrink: 0;
        width: auto;
        border: none;
        box-shadow: none;
        border-radius: 0;
    }

    .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__channels {
        border-radius: 0;
    }

    .tg-box__channel-text {
        font-size: 13px;
    }

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

    .tg-box__arrows {
        width: 24px;
    }

    .tg-box__btn {
        font-size: 12px;
        padding: 10px 16px;
    }

    .tg-box__disclaimer {
        font-size: 10px;
    }

    .tg-box__phone-link {
        display: block;
        text-align: center;
        padding: 8px 0 12px 0;
        background: #fff;
    }

    .tg-box__phone {
        width: auto;
        height: auto;
        max-width: 200px;
        max-height: calc(100vh - 400px);
        min-height: 80px;
        object-fit: contain;
    }

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

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