#connection-status {
    position: fixed;
    top: 20px;
    right: 20px;
    background-color: #25D366;
    color: #fff;
    padding: 12px 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 150px;
    cursor: pointer;
    transition: all 0.3s ease;
    user-select: none;
    z-index: 100000 !important;
}

#connection-status.minimized {
    padding: 4px;
    min-width: auto;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    justify-content: center;
    align-items: center;
    box-sizing: border-box;
    z-index: 100000 !important;
}

#connection-status.minimized #connection-status-text {
    display: none;
}

#connection-status.minimized #connection-status-icon {
    width: 8px;
    height: 8px;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.5);
}

#connection-status.connected {
    background-color: #25D366;
}

#connection-status.disconnected {
    background-color: #dc3545;
}

#connection-status-icon {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: #fff;
    flex-shrink: 0;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.5);
    transition: all 0.3s ease;
    z-index: 100000 !important;
    cursor: pointer;
}

#connection-status.connected #connection-status-icon {
    background-color: #fff;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.6), 0 0 8px rgba(255, 255, 255, 0.4);
    width: 10px;
    height: 10px;
    animation: none;
}

#connection-status.disconnected #connection-status-icon {
    background-color: #fff;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.6);
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
        box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.6);
    }
    50% {
        opacity: 0.7;
        transform: scale(1.1);
        box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.4), 0 0 12px rgba(255, 255, 255, 0.3);
    }
}

#connection-status-text {
    flex: 1;
}

#connection-modal {
    position: fixed;
    top: 60px;
    right: 20px;
    z-index: 10000;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    max-width: 350px;
    width: calc(100% - 40px);
}

#connection-status.minimized ~ #connection-modal,
body:has(#connection-status.minimized) #connection-modal {
    top: 50px;
}

.connection-modal-content {
    background-color: #FEF9E7;
    border-radius: 12px;
    padding: 20px 24px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: flex-start;
    gap: 16px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    margin-top: 8px;
}

.connection-modal-icon {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.connection-modal-icon svg {
    width: 48px;
    height: 48px;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.1));
}

.connection-modal-text {
    flex: 1;
    color: #000;
}

.connection-modal-text h3 {
    margin: 0 0 8px 0;
    font-size: 18px;
    font-weight: bold;
    color: #000;
    line-height: 1.4;
}

.connection-modal-text p {
    margin: 0 0 16px 0;
    font-size: 14px;
    color: #000;
    line-height: 1.5;
}

.reconnect-link {
    color: #25D366;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    display: inline-block;
    transition: opacity 0.2s;
}

.reconnect-link:hover {
    opacity: 0.8;
    text-decoration: underline;
}

.reconnect-link:active {
    opacity: 0.6;
}

@media (max-width: 480px) {
    #connection-status {
        top: 10px;
        right: 10px;
        padding: 10px 16px;
        font-size: 12px;
        min-width: 120px;
    }
    
    #connection-modal {
        top: 70px;
        right: 10px;
        max-width: calc(100% - 20px);
    }
    
    .connection-modal-content {
        padding: 16px 20px;
    }
    
    .connection-modal-icon {
        width: 40px;
        height: 40px;
    }
    
    .connection-modal-icon svg {
        width: 40px;
        height: 40px;
    }
    
    .connection-modal-text h3 {
        font-size: 16px;
    }
    
    .connection-modal-text p {
        font-size: 13px;
    }
}
