/* Support Widget Styles */
.support-widget {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9998;
}

.support-widget a {
    text-decoration: none;
}

.support-button {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--primary-gradient);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: none;
    transition: transform 0.2s ease, opacity 0.2s ease;
    position: relative;
    opacity: 0.95;
}

.support-unread-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    background: #ef4444;
    border-radius: 11px;
    color: white;
    font-size: 0.75rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--bg-primary);
    animation: badgePulse 2s ease-in-out infinite;
}

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

.support-button:hover {
    opacity: 1;
    transform: scale(1.05);
    box-shadow: none;
}

.support-button svg {
    width: 28px;
    height: 28px;
    color: white;
}

.support-modal {
    position: fixed;
    bottom: 100px;
    right: 24px;
    width: 320px;
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.95);
    transition: all 0.3s ease;
}

.support-modal.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.support-modal-header {
    padding: 1.25rem;
    border-bottom: 1px solid var(--card-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.support-modal-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.1rem;
    font-weight: 600;
    color: white;
}

.support-modal-title svg {
    width: 24px;
    height: 24px;
    color: var(--accent-purple);
}

.support-close-btn {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.support-close-btn:hover {
    color: white;
    transform: rotate(90deg);
}

.support-close-btn svg {
    width: 20px;
    height: 20px;
}

.support-modal-body {
    padding: 1.5rem;
}

.support-description {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.telegram-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    background: rgba(139, 92, 246, 0.1);
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: 12px;
    text-decoration: none;
    transition: all 0.3s;
    margin-bottom: 1rem;
}

.telegram-link:hover {
    background: rgba(139, 92, 246, 0.2);
    border-color: var(--accent-purple);
    transform: translateX(4px);
}

.telegram-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #0088cc 0%, #00a0e3 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.telegram-icon svg {
    width: 24px;
    height: 24px;
    color: white;
}

.telegram-info {
    flex: 1;
}

.telegram-label {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.25rem;
}

.telegram-username {
    font-size: 1rem;
    color: white;
    font-weight: 600;
}

.support-hours {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.5);
    text-align: center;
    padding: 0.75rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
}

/* Hide on template detail pages with sticky actions */
.has-sticky-actions .support-widget {
    bottom: 140px;
}

/* Mobile Styles */
@media (max-width: 768px) {
    .support-widget {
        bottom: 24px;
        right: 16px;
    }
    
    /* When user is logged in, move above bottom nav */
    body.logged-in .support-widget {
        bottom: 90px;
    }

    .support-button {
        width: 56px;
        height: 56px;
    }

    .support-button svg {
        width: 26px;
        height: 26px;
    }

    .support-modal {
        bottom: auto;
        top: 50%;
        left: 50%;
        right: auto;
        transform: translate(-50%, -50%) scale(0.95);
        width: calc(100% - 32px);
        max-width: 340px;
    }

    .support-modal.active {
        transform: translate(-50%, -50%) scale(1);
    }
}

@media (max-width: 991.98px) {
    body:not(.auth-page):not(.login-page):not(.register-page) .support-widget {
        bottom: calc(90px + env(safe-area-inset-bottom, 0));
    }
    
    /* Template detail page with sticky actions - highest priority */
    body.has-sticky-actions .support-widget {
        bottom: 160px !important;
    }
}